【发布时间】:2012-01-27 03:15:18
【问题描述】:
我想在我的 android 应用程序中添加统计信息。 阅读文章http://code.google.com/intl/ru/apis/analytics/docs/mobile/android.html#startingTheTracker 并在下面完成
1 在我的应用程序中添加了库 libGoogleAnalytics.jar 2 添加到清单中
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
3 更改源代码
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 我为应用程序创建了“假”网站(https://sites.google.com/site/balancetransportcardkazan/ :))
5 个注册站点在https://www.google.com/analytics/,
常量GOOGLE_ANALYTICS 用于此站点。
统计为空,我忘了做什么?
【问题讨论】:
-
显示数据可能需要一些时间。你等了几天吗?