[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

@ -110,10 +110,10 @@ public final class Notifier
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;