[android] Basic statistics.

This commit is contained in:
Alex Zolotarev 2015-01-27 13:09:19 +03:00
parent fa889fbae0
commit 5a47c7376b
3 changed files with 22 additions and 0 deletions

View file

@ -255,6 +255,10 @@ public class MWMApplication extends android.app.Application implements ActiveCou
initMrgs();
WorkerService.startActionUpdateAds(this);
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
org.alohalytics.Statistics.setDebugMode(BuildConfig.DEBUG);
// We try to take into an account if app was previously installed.
org.alohalytics.Statistics.setup(BuildConfig.STATISTICS_URL, this, isNewUser());
}
}

View file

@ -60,4 +60,18 @@ public class MWMFragmentActivity extends ActionBarActivity
else
return super.onOptionsItemSelected(item);
}
@Override
protected void onResume()
{
super.onResume();
org.alohalytics.Statistics.logEvent("$onResume", this.getClass().getSimpleName());
}
@Override
protected void onPause()
{
super.onPause();
org.alohalytics.Statistics.logEvent("$onPause", this.getClass().getSimpleName());
}
}

View file

@ -168,6 +168,8 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
};
mPathManager.startExternalStorageWatching(this, receiver, null);
storagePathSetup();
org.alohalytics.Statistics.logEvent("$onResume", this.getClass().getSimpleName());
}
@Override
@ -175,6 +177,8 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
{
super.onPause();
mPathManager.stopExternalStorageWatching();
org.alohalytics.Statistics.logEvent("$onPause", this.getClass().getSimpleName());
}
@Override