当前位置: 首页>>代码示例>>Java>>正文


Java Tracker类代码示例

本文整理汇总了Java中com.google.analytics.tracking.android.Tracker的典型用法代码示例。如果您正苦于以下问题:Java Tracker类的具体用法?Java Tracker怎么用?Java Tracker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Tracker类属于com.google.analytics.tracking.android包,在下文中一共展示了Tracker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTracker

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
private static Tracker getTracker(){
    if(sTracker==null){
        sTracker = GoogleAnalytics.getInstance(sInstance).getTracker(BuildConfig.GoogleAnalytics_KEY);

        ExceptionReporter handler = new ExceptionReporter(
                sTracker,                                        // Currently used Tracker.
                GAServiceManager.getInstance(),                   // GAServiceManager singleton.
                Thread.getDefaultUncaughtExceptionHandler(),
                sInstance);     // Current default uncaught exception handler.

        // Make handler the new default uncaught exception handler for main(GUI) thread.
        Thread.setDefaultUncaughtExceptionHandler(handler);

    }
    return sTracker;
}
 
开发者ID:progress-engine,项目名称:metrika_android,代码行数:17,代码来源:YandexMetrikaApplication.java

示例2: trackView

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
private void trackView(String screenname, CallbackContext callbackContext) {
if (! trackerStarted ) {
           callbackContext.error("Tracker not started");
    return;
}

       Tracker tracker = GoogleAnalytics.getInstance(this.cordova.getActivity()).getDefaultTracker();
       addCustomDimensionsToTracker(tracker);
       
       if (null != screenname && screenname.length() > 0) {
           tracker.set(Fields.SCREEN_NAME, screenname);
           tracker.send(MapBuilder
             .createAppView()
             .build()
           );
           callbackContext.success("Track Screen: " + screenname);
       } else {
           callbackContext.error("Expected one non-empty string argument.");
       }
   }
 
开发者ID:psydrake,项目名称:pandacoinBalance,代码行数:21,代码来源:UniversalAnalyticsPlugin.java

示例3: trackEvent

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
private void trackEvent(String category, String action, String label, long value, CallbackContext callbackContext) {
if (! trackerStarted ) {
    callbackContext.error("Tracker not started");
    return;
}


       Tracker tracker = GoogleAnalytics.getInstance(this.cordova.getActivity()).getDefaultTracker();
       addCustomDimensionsToTracker(tracker);

       if (null != category && category.length() > 0) {
           tracker.send(MapBuilder
               .createEvent(category, action, label, value)
               .build()
           );
           callbackContext.success("Track Event: " + category);
       } else {
           callbackContext.error("Expected non-empty string arguments.");
       }
   }
 
开发者ID:psydrake,项目名称:pandacoinBalance,代码行数:21,代码来源:UniversalAnalyticsPlugin.java

示例4: onStart

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
@Override
public void onStart() {
	super.onStart();
	final Tracker tracker = EasyTracker.getInstance(getActivity());
	tracker.set(Fields.SCREEN_NAME, "Recipes list");
	tracker.send(MapBuilder.createAppView().build());
	IntentFilter intentFilter = new IntentFilter();
	intentFilter.addAction(RecipesManager.ACTION_FINISH_LOADING_RECIPES);
	intentFilter.addAction(RecipesManager.ACTION_START_LOADING_RECIPES);

	if (RecipesApplication.isLoadingRecipes) {
		getActivity().setProgressBarIndeterminateVisibility(true);
	} else {
		getActivity().setProgressBarIndeterminateVisibility(false);
	}
	LocalBroadcastManager.getInstance(getActivity()).registerReceiver(broadcastReceiver,
			intentFilter);
}
 
开发者ID:groupsky,项目名称:android-recipes-app,代码行数:19,代码来源:RecipeItemListFragment.java

示例5: onCreate

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_menu);

    Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
    serviceIntent.setPackage("com.android.vending");
    bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);

    findViewById(R.id.pack1_button).setOnClickListener(this);
    findViewById(R.id.pack2_button).setOnClickListener(this);

    Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3");
    tracker.send(MapBuilder.createAppView().set(Fields.SCREEN_NAME, "Home Screen").build());

    BugSenseHandler.initAndStartSession(MainMenu.this, "718d6664");
}
 
开发者ID:AlexZaiats,项目名称:Coloring-book,代码行数:18,代码来源:MainMenu.java

示例6: onActivityResult

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == 1001) {
        if (resultCode == Activity.RESULT_OK) {
            try {
                Intent intent = new Intent(this, DrawerSliderActivity.class);
                intent.putExtra("pack", "pack2");
                startActivity(intent);

                Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3");
                tracker.send(MapBuilder
                        .createEvent("Buy", "pack", "item_bouth", null)
                        .build());
            } catch (Exception e) {

                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:AlexZaiats,项目名称:Coloring-book,代码行数:21,代码来源:MainMenu.java

示例7: done

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
@SuppressWarnings("unused")
public void done(int numberOfParsedObjects) {
    if(finished) {
        if(BuildConfig.DEBUG) {
            //only crash if we are in a dev build
            throw new IllegalStateException("Timer already had finished before!");
        }
        return;
    }
    finished = true;
    Tracker tracker = EasyTracker.getTracker();
    
    long finalTime = SystemClock.elapsedRealtime();
    tracker.sendTiming(CATEGORY_SHARED_PREFS, firstStepTime-startTime , name, Integer.toString(numberOfParsedObjects));
    tracker.sendTiming(ParsingAnalytics.CATEGORY, finalTime - firstStepTime, name, Integer.toString(numberOfParsedObjects));
    tracker.sendTiming(CATEGORY_BOTH, finalTime-startTime , name, Integer.toString(numberOfParsedObjects));
}
 
开发者ID:antonyt,项目名称:TflTravelAlerts,代码行数:18,代码来源:LoadSharedPreferencesAnalytics.java

示例8: done

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
@SuppressWarnings("unused")
public void done(int numberOfParsedObjects) {
    if(finished) {
        if(BuildConfig.DEBUG) {
            //only crash if we are in a dev build
            throw new IllegalStateException("Timer already had finished before!");
        }
        return;
    }
    finished = true;
    Tracker tracker = EasyTracker.getTracker();
    
    long finalTime = SystemClock.elapsedRealtime();
    tracker.sendTiming(CATEGORY_SERIALIZING, firstStepTime-startTime , name, Integer.toString(numberOfParsedObjects));
    tracker.sendTiming(CATEGORY_SHARED_PREFS, finalTime - firstStepTime, name, Integer.toString(numberOfParsedObjects));
    tracker.sendTiming(CATEGORY_BOTH, finalTime-startTime , name, Integer.toString(numberOfParsedObjects));
}
 
开发者ID:antonyt,项目名称:TflTravelAlerts,代码行数:18,代码来源:SaveSharedPreferencesAnalytics.java

示例9: sendEvent

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
public static void sendEvent(String eventName){
    android.util.Log.d(YandexMetrikaApplication.class.getSimpleName(), "sendEvent "+eventName);
    Tracker tracker = getTracker();
    if(tracker!=null) {
        tracker.send(MapBuilder.createEvent("mm_android", eventName, null, null).build());
    }
}
 
开发者ID:progress-engine,项目名称:metrika_android,代码行数:8,代码来源:YandexMetrikaApplication.java

示例10: addCustomDimensionsToTracker

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
private void addCustomDimensionsToTracker(Tracker tracker) {
	for (Entry<String, String> entry : customDimensions.entrySet()) {
		String key = entry.getKey();
		String value = entry.getValue();
	    //System.out.println("Setting tracker dimension slot " + key + ": <" + value+">");
	    tracker.set(Fields.customDimension(Integer.parseInt(key)), value);
	}
}
 
开发者ID:psydrake,项目名称:pandacoinBalance,代码行数:9,代码来源:UniversalAnalyticsPlugin.java

示例11: onStart

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
@Override
public void onStart() {
	super.onStart();
	final Tracker tracker = EasyTracker.getInstance(getActivity());
	tracker.set(Fields.SCREEN_NAME, "Recipe Details");
	tracker.send(MapBuilder.createAppView().build());
}
 
开发者ID:groupsky,项目名称:android-recipes-app,代码行数:8,代码来源:RecipeItemDetailFragment.java

示例12: finish_anim

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
public void finish_anim() {
    Animation animFadein = AnimationUtils.loadAnimation(
            getApplicationContext(), R.anim.slide_finish);
    level_finished.setVisibility(View.VISIBLE);
    animFadein.setAnimationListener(finish_anim);

    level_finished.startAnimation(animFadein);

    int count = screenH / 100;

    for (int i = 0; i < count; i++) {
        int id_image = 0;
        if (i % 2 == 0)
            id_image = R.drawable.star_pink;
        else
            id_image = R.drawable.star_white;

        ParticleSystem ps = new ParticleSystem(this, 100, id_image, 800);
        ps.setScaleRange(0.7f, 1.3f);
        ps.setSpeedRange(0.2f, 0.5f);
        ps.setRotationSpeedRange(90, 180);
        ps.setFadeOut(200, new AccelerateInterpolator());
        int xStart = (int) (screenW * Math.random());
        int yStart = (int) (screenH * Math.random());
        ps.oneShot(xStart, yStart, 70);
    }


    final Animation scale = AnimationUtils.loadAnimation(
            getApplicationContext(), R.anim.scale_anim);

    homeBtn.startAnimation(scale);

    Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3");
    tracker.send(MapBuilder
            .createEvent("Level", packName, "finish_drawing_" + level, null)
            .build());

}
 
开发者ID:AlexZaiats,项目名称:Coloring-book,代码行数:40,代码来源:DrawerActivity.java

示例13: onClick

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
@Override
public void onClick(View v) {

    switch (v.getId()) {
        case R.id.pack1_button:
            Intent intent = new Intent(this, DrawerSliderActivity.class);
            intent.putExtra("pack", "pack1");
            startActivity(intent);
            break;
        case R.id.pack2_button:

            Tracker tracker = GoogleAnalytics.getInstance(this).getTracker("UA-51610813-3");
            tracker.send(MapBuilder
                    .createEvent("Buy", "pack", "try_to_buy", null)
                    .build());

            if (deviceHasGoogleAccount())
                buyClick(v);
            else {
                tracker.send(MapBuilder
                        .createEvent("Buy", "pack", "no_account", null)
                        .build());
            }

            break;
    }
}
 
开发者ID:AlexZaiats,项目名称:Coloring-book,代码行数:28,代码来源:MainMenu.java

示例14: pushSettingChengedEvent

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
/**
 * 設定変更をpushする.
 * 
 * @param context {@link Context}
 * @param key キー
 * @param newValue 値
 */
public static void pushSettingChengedEvent(Context context, String key, Object newValue) {
    Tracker tracker = EasyTracker.getInstance(context);
    if (newValue != null && newValue instanceof Set) {
        pushSettingChengedEvent(tracker, key, (Set<?>) newValue);
    } else {
        String newValueStr = newValue == null ? "nullpo" : String.valueOf(newValue);
        tracker.send(MapBuilder.createEvent("settingChenged", key, newValueStr, null).build());
    }
}
 
开发者ID:75py,项目名称:XUtilities,代码行数:17,代码来源:AnalyticsUtil.java

示例15: trackAnalytics

import com.google.analytics.tracking.android.Tracker; //导入依赖的package包/类
private void trackAnalytics() {
    EasyTracker.getInstance().setContext(this);
    Tracker tracker = EasyTracker.getInstance().getTracker();

    if (mPhotoUser != null) {
        tracker.set("&uid", mPhotoUser.id.toString());
    } else {
        tracker.set("&uid", null);
    }

    if (mPhoto != null) {
        tracker.trackView("image/" + mPhoto.id);
    }
}
 
开发者ID:vicfryzel,项目名称:gplus-photohunt-client-android,代码行数:15,代码来源:ViewImageActivity.java


注:本文中的com.google.analytics.tracking.android.Tracker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。