适用于Android的Google AnalyticsSDK不会跟踪应用使用情况

时间:2013-10-03 20:23:21

标签: java android google-analytics google-analytics-api

我正在尝试使用以下教程跟踪我的Android应用程序的使用情况:

https://developers.google.com/analytics/devguides/collection/android/v3/

然而,即使在多个设备上安装应用程序并在模拟器中运行它之后,我的仪表板也似乎永远不会显示任何用法。

我的实施如下:

STARTACTIVITY.java

public class StartActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.start);
            EasyTracker.getInstance(this).activityStart(this); 

ANALYTICS.xml

<?xml version="1.0" encoding="utf-8" ?>

<resources xmlns:tools="http://schemas.android.com/tools"
tools:ignore="TypographyDashes">
  <!--Replace placeholder ID with your tracking ID-->
  <string name="ga_trackingId">UA-xxxxxxx-2</string>

  <!--Enable automatic activity tracking-->
  <bool name="ga_autoActivityTracking">true</bool>

  <!--Enable automatic exception tracking-->
  <bool name="ga_reportUncaughtExceptions">true</bool>
</resources>

清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.test.datasettings"
   android:versionCode="4"
    android:versionName="1.3" >

<uses-permission android:name="android.permission.WRITE_APN_SETTINGS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    <uses-feature android:name="android.hardware.telephony" android:required="false" />

    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <application
        android:icon="@drawable/notifications_icon"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar" >
        <activity
            android:name="com.example.test.datasettings.StartActivity"
            android:label="@string/display_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
         <activity
            android:name="com.example.test.datasettings.UpdateActivity"
            android:label="@string/app_name"
            android:configChanges="orientation|keyboardHidden|screenSize">
        </activity>
        <activity
            android:name="com.example.test.datasettings.ConfigFinalActivity"
            android:configChanges="orientation|keyboardHidden|screenSize">
        </activity>
            <activity
            android:name="com.example.test.datasettings.MySSLSocketFactory"
            android:configChanges="orientation">
        </activity>
        <activity 
            android:name="com.example.test.datasettings.NotificationActivityForMultiProf"
            android:theme="@android:style/Theme.NoDisplay" >
        </activity>
    </application>

</manifest>

控制板:

http://datasettings.site90.net/Capture.PNG

0 个答案:

没有答案