I want to add statistic in my android application. Read article http://code.google.com/intl/ru/apis/analytics/docs/mobile/android.html#startingTheTracker and done below
1 added library libGoogleAnalytics.jar in my application 2 added in manifest
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
3 changed source code
private GoogleAnalyticsTracker tracker;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
tracker = GoogleAnalyticsTracker.getInstance();
// Start the tracker in manual dispatch mode...
tracker.startNewSession(GOOGLE_ANALYTICS, this);
tracker.trackPageView("/MainListView");
...
protected void onDestroy() {
super.onDestroy();
tracker.stopSession();
}
4 I created "fake" site for application (https://sites.google.com/site/balancetransportcardkazan/ :) )
5 registered site in https://www.google.com/analytics/,
constant GOOGLE_ANALYTICS
is for this site.
statistic is empty, What I forgot to do?
You have to dispatch the changes to the server. Here is an excerpt from my wrapper class around GoogleTracker to make it easier for me.