Java 类com.google.android.gms.analytics.Logger 实例源码

项目:Tower-develop    文件:GAUtils.java   
public static void initGATracker(DroidPlannerApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!DroidPlannerPrefs.getInstance(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
项目:droidplanner-master    文件:GAUtils.java   
public static void initGATracker(DroidPlannerApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity
        // reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
项目:droidplanner-master    文件:GAUtils.java   
public static void initGATracker(DroidPlannerApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
项目:nongfei-missionplane    文件:GAUtils.java   
public static void initGATracker(DroidPlannerApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity
        // reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
项目:nongfei-missionplane    文件:GAUtils.java   
public static void initGATracker(DroidPlannerApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
项目:DroidPlanner-Tower    文件:GAUtils.java   
public static void initGATracker(DroidPlannerApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
项目:EDU_SYZT    文件:Analytics.java   
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);

        /*Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(
                R.xml.global_tracker)
                : analytics.newTracker(Constants.GOOGLE_ANALYTICS_TRACKING_ID);*/
        Tracker t = analytics.newTracker(Constants.GOOGLE_ANALYTICS_TRACKING_ID);

        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
项目:Gprs_droidplanner    文件:GAUtils.java   
public static void initGATracker(DroidPlannerApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity
        // reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
项目:Gprs_droidplanner    文件:GAUtils.java   
public static void initGATracker(DroidPlannerApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
项目:manatee-android    文件:MyApplication.java   
synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.setDryRun(false);
        analytics.getLogger().setLogLevel(Logger.LogLevel.INFO);
        analytics.setLocalDispatchPeriod(30);
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(R.xml.app_tracker)
                : null;
        if (t != null) {
            t.enableAdvertisingIdCollection(false);
        }
        mTrackers.put(trackerId, t);

    }
    return mTrackers.get(trackerId);
}
项目:XDA-One    文件:OneApplication.java   
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (mTrackers.containsKey(trackerId)) {
        return mTrackers.get(trackerId);
    }

    final GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
    analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);

    final Tracker tracker;
    switch (trackerId) {
        case APP_TRACKER:
            tracker = analytics.newTracker(PROPERTY_ID);
            break;
        case GLOBAL_TRACKER:
            tracker = analytics.newTracker(R.xml.global_tracker);
            break;
        default:
            tracker = analytics.newTracker(R.xml.global_tracker);
            break;
    }
    tracker.enableAdvertisingIdCollection(true);
    mTrackers.put(trackerId, tracker);

    return tracker;
}
项目:barterli_android    文件:GoogleAnalyticsManager.java   
/**
 * Initialize the tracker
 */
private void initTracker() {

    final Context context = BarterLiApplication.getStaticContext();

    if (!BuildConfig.REPORT_GOOGLE_ANALYTICS) {
        GoogleAnalytics.getInstance(context).setDryRun(true);
        GoogleAnalytics.getInstance(context).getLogger()
                .setLogLevel(Logger.LogLevel.VERBOSE);
    } else {
        GoogleAnalytics.getInstance(context).setDryRun(false);
        GoogleAnalytics.getInstance(context).getLogger()
                .setLogLevel(Logger.LogLevel.ERROR);
    }
    mApplicationTracker = GoogleAnalytics.getInstance(context)
            .newTracker(context.getString(R.string.ga_tracking_id));

    //We will track manually since we use Fragments
    mApplicationTracker.enableAutoActivityTracking(false);
    mApplicationTracker.setSessionTimeout(SESSION_TIMEOUT);

}
项目:3DRServices    文件:GAUtils.java   
public static void initGATracker(DroidPlannerServicesApp app) {
    if (sAppTracker == null) {
        final Context context = app.getApplicationContext();

        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);

        // Call is needed for now to allow dispatching of auto activity
        // reports
        // (http://stackoverflow.com/a/23256722/1088814)
        analytics.enableAutoActivityReports(app);

        analytics.setAppOptOut(!new DroidPlannerPrefs(context).isUsageStatisticsEnabled());

        // If we're in debug mode, set log level to verbose.
        if (BuildConfig.DEBUG) {
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        }

        sAppTracker = analytics.newTracker(R.xml.google_analytics_tracker);
    }
}
项目:IndiaSatelliteWeather    文件:AnalyticsUtil.java   
public void initializeGATracker() {

        // Set dryRun flag.
        GoogleAnalytics.getInstance(context).setDryRun(GA_IS_DRY_RUN);

        // Set the log level to verbose if dryRun.
        // DEFAULT is set to DRY RUN (only logging will happen)
        GoogleAnalytics.getInstance(context).getLogger()
                .setLogLevel(GA_IS_DRY_RUN ? Logger.LogLevel.VERBOSE : Logger.LogLevel.WARNING);

        // Set the opt out flag when user updates a tracking preference.
        /*
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
        sp.registerOnSharedPreferenceChangeListener(
                new SharedPreferences.OnSharedPreferenceChangeListener() {
                    @Override
                    public void onSharedPreferenceChanged(SharedPreferences pref, String key) {
                        if (key.equals(TRACKING_PREF_KEY)) {
                            GoogleAnalytics.getInstance(getApplicationContext()).setAppOptOut(
                                    pref.getBoolean(key, false));
                        }
                    }
                });
                */
    }
项目:Ships    文件:Analytics.java   
public void init(final Context context){
    if (tracker==null) {
           if (context==null){
               throw new IllegalArgumentException("No context set.");
           }
        // Create new tracker
        final GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        tracker = analytics.newTracker(R.xml.analytics);
    }
}
项目:StudyMovie    文件:LEApplication.java   
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(
                R.xml.global_tracker)
                : analytics.newTracker(R.xml.ecommerce_tracker);
        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
项目:friendlyping    文件:AnalyticsHelper.java   
/**
 * Get the default {@link Tracker} for this {@link Application}.
 *
 * @return tracker
 */
public static synchronized Tracker getDefaultTracker(Context context) {
    if (mTracker == null) {
        GoogleAnalytics analytics = GoogleAnalytics
                .getInstance(context.getApplicationContext());
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        mTracker = analytics.newTracker(R.xml.global_tracker);
    }
    return mTracker;
}
项目:moment-for-android-wear    文件:MomentApp.java   
private void setupAnalyticsTools() {
    boolean isProd = !BuildConfig.DEBUG && BuildConfig.FLAVOR.equals("prod");

    // setup fabric
    Crashlytics crashlytics = new Crashlytics.Builder().disabled(!isProd).build();
    final Fabric fabric = new Fabric.Builder(this)
            .kits(crashlytics)
            .build();
    Fabric.with(fabric);

    // set up timber
    Timber.plant(isProd ? new CrashlyticsTree() : new Timber.DebugTree());

    // set up analytics
    GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
    SharedPreferences userPrefs = PreferenceManager.getDefaultSharedPreferences(this);

    analytics.setAppOptOut(!userPrefs.getBoolean(getString(R.string.key_analytics), true));
    analytics.getLogger().setLogLevel(Logger.LogLevel.ERROR);
    analytics.setDryRun(!isProd);

    userPrefs.registerOnSharedPreferenceChangeListener(new SharedPreferences.OnSharedPreferenceChangeListener() {
        @Override
        public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
            if (key.equals(getString(R.string.key_analytics))) {
                GoogleAnalytics.getInstance(getApplicationContext()).setAppOptOut(!sharedPreferences.getBoolean(key, true));
            }
        }
    });
}
项目:lmis-moz-mobile    文件:AnalyticsTrackers.java   
/**
 * Don't instantiate directly - use {@link #getInstance()} instead.
 */
private AnalyticsTrackers(Context context) {
    Context mContext = context.getApplicationContext();
    GoogleAnalytics.getInstance(mContext).setDryRun(mContext.getResources().getBoolean(R.bool.ga_dryRun));
    GoogleAnalytics.getInstance(mContext).getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
    mTracker = GoogleAnalytics.getInstance(mContext).newTracker(mContext.getString(R.string.ga_trackingId));
    mTracker.setSessionTimeout(300);
    mTracker.setAppVersion(BuildConfig.VERSION_NAME);
    mTracker.setAppId(BuildConfig.APPLICATION_ID);
}
项目:v2ex-android    文件:TrackerUtils.java   
public static void init(Context context) {
    Preconditions.checkState(mAnalytics == null, "can't init twice");

    mAnalytics = GoogleAnalytics.getInstance(context);
    if (BuildConfig.DEBUG) {
        mAnalytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        mAnalytics.setDryRun(true);
    }

    mTracker = mAnalytics.newTracker(R.xml.analytics_config);

    onAppCreate();
}
项目:TPTrashCan    文件:TPTrashCan.java   
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        if (APPDEBUG) {
            analytics.getInstance(this).setDryRun(true);
        }
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                : analytics.newTracker(R.xml.global_tracker);
        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
项目:Raven-Messenger    文件:GoogleAnalyticsTrack.java   
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        Tracker t = analytics.newTracker(PROPERTY_ID);
        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
项目:News    文件:BaseApplication.java   
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        if (APPDEBUG) {
            analytics.getInstance(this).setDryRun(true);
        }
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                : analytics.newTracker(R.xml.global_tracker);
        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
项目:currency-and-stock-widget    文件:App.java   
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        Tracker t = analytics.newTracker(R.xml.app_tracker);
        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
项目:BuddhaVoice    文件:BuddhaVoice.java   
public synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        if (APPDEBUG) {
            analytics.getInstance(this).setDryRun(true);
        }
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                : analytics.newTracker(R.xml.global_tracker);
        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
项目:Movie-Maniac-Android    文件:GAUtils.java   
private void initTracking() {
    if (mTracker == null) {
        GoogleAnalytics ga = GoogleAnalytics.getInstance(MovieManiacApp.getContext());
        mTracker = ga.newTracker(R.xml.ga_config);
        ga.enableAutoActivityReports(MovieManiacApp.INSTANCE);
        ga.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
    }
}
项目:CUMtd    文件:CUMtdApplication.java   
public synchronized Tracker getTracker() {
    if (tracker == null) {
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.enableAutoActivityReports(this);
        if (BuildConfig.DEBUG) {
            analytics.setDryRun(true);
        } else {
            analytics.getLogger().setLogLevel(Logger.LogLevel.ERROR);
        }
        tracker = analytics.newTracker(R.xml.global_tracker);
    }
    return tracker;
}
项目:mini-hacks    文件:SyncManager.java   
public SyncManager(Context context) {
    this.context = context;

    Manager.enableLogging("CityExplorer", Logger.LogLevel.VERBOSE);
    Manager.enableLogging("Sync", Logger.LogLevel.VERBOSE);

    openDatabase();
}
项目:android-uploader    文件:Nightscout.java   
synchronized public Tracker getTracker() {
    Log.d(TAG, "getTracker called");
    if (tracker == null) {
        Log.d(TAG, "tracker was null - returning new tracker");
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.setDryRun(false);
        analytics.getLogger().setLogLevel(Logger.LogLevel.WARNING);
        analytics.setLocalDispatchPeriod(7200);
        tracker = analytics.newTracker(R.xml.app_tracker);
        return tracker;
    }
    return tracker;
}
项目:list    文件:ListApplication.java   
public synchronized Tracker getTracker(TrackerName trackerId) {
    //Log.d(TAG, "getTracker()");
    if (!mTrackers.containsKey(trackerId)) {
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);

        //analytics.getLogger().setLogLevel(Logger.LogLevel.INFO);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);

        // Global GA Settings
        // <!-- Google Analytics SDK V4 BUG20141213 Using a GA global xml freezes the app! -->
        analytics.setDryRun(false);
        analytics.enableAutoActivityReports(this);
        analytics.setLocalDispatchPeriod(30);

        // Create a new tracker
        Tracker t = (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(R.xml.global_tracker) : null;
        if (t != null) {
            t.setSampleRate(100.0);
            t.setSessionTimeout(300);
            t.setAnonymizeIp(true);
            t.enableExceptionReporting(true);
            t.enableAutoActivityTracking(true);
        }
        mTrackers.put(trackerId, t);
        //Log.v(TAG, "put mTrackers: " + trackerId.toString());
    }
    Log.v(TAG, "return mTrackers");
    return mTrackers.get(trackerId);
}
项目:Path-of-Exile-Racer    文件:RacerApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    GraphHolder.getInstance().addModules(getModules());
    if (BuildConfig.DEBUG) {
        GoogleAnalytics.getInstance(this).setDryRun(true);
        GoogleAnalytics.getInstance(this).getLogger().setLogLevel(Logger.LogLevel.VERBOSE);

        Crashlytics.getInstance().setDebugMode(true);
    }

    Crashlytics.start(this);
}
项目:HereAStory-Android    文件:AnalyticsSampleApp.java   
synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(
                        R.xml.global_tracker)
                        : analytics.newTracker(R.xml.ecommerce_tracker);
        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
项目:Onesearch    文件:OnesearchApp.java   
@Override
public void onCreate() {
    super.onCreate();
    // Enabling Advertising Features in Google Analytics allows you to take advantage of
    // Remarketing, Demographics & Interests reports, and more.
    Tracker t = getTracker(TrackerName.APP_TRACKER);
    t.enableAdvertisingIdCollection(true);

    if(BuildConfig.DEBUG) {
        GoogleAnalytics.getInstance(this).getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        GoogleAnalytics.getInstance(this).setDryRun(true);
    }
}
项目:gaia-android    文件:MainActivity.java   
public synchronized static Tracker getTracker(TrackerName trackerId) {
    if( GaiaGoogleAnalytics.playServiceAvviable(context)){
        if (!mTrackers.containsKey(trackerId)) {

            GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);
            analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
            Tracker t = analytics.newTracker(PROPERTY_ID);
            t.enableAdvertisingIdCollection(true);
            mTrackers.put(trackerId, t);
        }
        return mTrackers.get(trackerId);
    }
    return null;
}
项目:JWP    文件:AnalyticsSampleApp.java   
synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID)
                : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(
                R.xml.global_tracker)
                : analytics.newTracker(R.xml.ecommerce_tracker);
        t.enableAdvertisingIdCollection(true);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
项目:Now-Playing    文件:GoogleAnalyticsHelper.java   
private GoogleAnalyticsHelper() {
    mGoogleAnalytics = GoogleAnalytics.getInstance(mContext);
    mGoogleAnalytics.enableAutoActivityReports(mContext);
    mGoogleAnalytics.getLogger().setLogLevel(BuildConfig.DEBUG && Boolean.valueOf(mContext.getString(R.string.analytics_logging_enabled)) ? Logger.LogLevel.VERBOSE : Logger.LogLevel.ERROR);
    mGoogleAnalytics.setDryRun(BuildConfig.DEBUG);
}