我正在安装谷歌分析,当我编写代码行时:
tracker.start(UA-..., 10)
Eclipse 发出警告,指出启动方法已弃用。最近有人做过这个吗?是否有关于如何安装谷歌分析的新指令集?我找不到它。
最佳答案
@Valeh 那个链接里面仍然有折旧代码。
@NoviceMe 我遇到了同样的问题,您可能已经发现了,但如果它对其他人有帮助的话。它不会破坏您的代码,但请查看“折旧”标题下的此页面
http://analytics.blogspot.com/2011/08/new-google-analytics-sdk-for-android.html
它说:
We are deprecating the start and stop methods in favor of the startNewSession and stopSession. The existing methods will continue to be in the library, so your applications will still work when you upgrade, but we highlight recommend you move to these new methods.
之前你有:
tracker.start("UA-YOUR-GA-ACC-NUM", intCallPeriod, getApplication());
tracker.stop();
您将拥有:
tracker.startNewSession("UA-YOUR-GA-ACC-NUM", intCallPeriod, getApplication());
tracker.stopSession();
希望对您有所帮助。
关于android - 尝试为 Android 应用安装谷歌分析 - 启动方法已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8319044/