[Android] Update tracking

This commit is contained in:
zilmar 2017-05-07 09:26:40 +10:00
parent 8bb5e6a240
commit 22f4586498
3 changed files with 34 additions and 24 deletions

View File

@ -247,12 +247,6 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
}
});
UpdateLanguage();
((Project64Application) getApplication()).getDefaultTracker().send(new HitBuilders.EventBuilder()
.setCategory("mobile")
.setAction("start")
.setLabel(NativeExports.appVersion())
.build());
}
void UpdateLanguage()
@ -839,6 +833,11 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
public void ShowSupportWindow(final Boolean ResumeGame)
{
((Project64Application) getApplication()).getDefaultTracker().send(new HitBuilders.EventBuilder()
.setCategory("Patreon Window")
.setLabel(NativeExports.appVersion())
.build());
Boolean TimeDelayed = NativeExports.UISettingsLoadDword(UISettingID.Game_RunCount.getValue()) > 15;
AlertDialog.Builder builder = new AlertDialog.Builder(this);
@ -917,6 +916,10 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
@Override
public void onClick(View v)
{
((Project64Application) getApplication()).getDefaultTracker().send(new HitBuilders.EventBuilder()
.setCategory("Patreon page")
.setLabel(NativeExports.appVersion())
.build());
Intent browse = new Intent( Intent.ACTION_VIEW , Uri.parse( "https://www.patreon.com/bePatron?u=841905" ) );
startActivity( browse );
}

View File

@ -13,6 +13,8 @@ package emu.project64;
import java.io.File;
import java.util.List;
import com.google.android.gms.analytics.HitBuilders;
import emu.project64.R;
import emu.project64.jni.NativeExports;
import emu.project64.jni.SettingsID;
@ -89,6 +91,11 @@ public class SplashActivity extends Activity implements ExtractAssetsListener
InitProject64();
}
((Project64Application) getApplication()).getDefaultTracker().send(new HitBuilders.EventBuilder()
.setCategory("start")
.setLabel(NativeExports.appVersion())
.build());
// Extract the assets in a separate thread and launch the menu activity
// Handler.postDelayed ensures this runs only after activity has resumed
Log.e( "Splash", "extractAssetsTaskLauncher - startup");

View File

@ -27,12 +27,12 @@ import android.util.Log;
* A small class to encapsulate the notification process for Mupen64PlusAE.
*/
public final class Notifier
{
{
private static Runnable sDisplayMessager = null;
/**
* Pop up a temporary message on the device.
*
*
* @param activity The activity to display from
* @param message The message string to display.
*/
@ -52,9 +52,9 @@ public final class Notifier
final AlertDialog dialog = new AlertDialog.Builder(finalActivity)
.setTitle("Error")
.setMessage(finalMessage)
.setPositiveButton("OK", new DialogInterface.OnClickListener()
.setPositiveButton("OK", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
public void onClick(DialogInterface dialog, int id)
{
// You don't have to do anything here if you just want it dismissed when clicked
synchronized(sDisplayMessager)
@ -64,7 +64,7 @@ public final class Notifier
}
})
.setCancelable(false)
.create();
.create();
dialog.setCanceledOnTouchOutside(false);
dialog.show();
}
@ -72,11 +72,11 @@ public final class Notifier
activity.runOnUiThread( sDisplayMessager );
synchronized(sDisplayMessager)
{
try
try
{
sDisplayMessager.wait();
}
catch (InterruptedException e)
catch (InterruptedException e)
{
}
catch (IllegalMonitorStateException e)
@ -85,7 +85,7 @@ public final class Notifier
}
Log.d("DisplayError", "Done");
}
public static void showMessage( Activity activity, String message, int Duratation )
{
if( activity == null )
@ -94,10 +94,10 @@ public final class Notifier
GameOverlay overlay = (GameOverlay) activity.findViewById(R.id.gameOverlay);
if (overlay == null)
return;
overlay.SetDisplayMessage(message, Duratation);
}
public static void showMessage2( Activity activity, String message )
{
if( activity == null )
@ -106,14 +106,14 @@ public final class Notifier
GameOverlay overlay = (GameOverlay) activity.findViewById(R.id.gameOverlay);
overlay.SetDisplayMessage2(message);
}
public static void EmulationStarted (Activity activity)
{
((Project64Application) activity.getApplication()).getDefaultTracker().send(new HitBuilders.EventBuilder()
.setCategory("mobile")
.setAction("game")
.setLabel(NativeExports.SettingsLoadString(SettingsID.Rdb_GoodName.getValue()))
.build());
.setCategory("game")
.setAction(NativeExports.SettingsLoadString(SettingsID.Rdb_GoodName.getValue()))
.setLabel(NativeExports.appVersion())
.build());
}
private static Runnable runEmulationStopped = null;
@ -136,11 +136,11 @@ public final class Notifier
activity.runOnUiThread( runEmulationStopped );
synchronized(runEmulationStopped)
{
try
try
{
runEmulationStopped.wait();
}
catch (InterruptedException e)
catch (InterruptedException e)
{
}
catch (IllegalMonitorStateException e)