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


Java GAServiceManager类代码示例

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


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

示例1: getTracker

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的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: setupUncaughtExceptionHandler

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
/**
 * Report uncaught exceptions (crashes) to Analytics
 */
private void setupUncaughtExceptionHandler() {
    ExceptionReporter myHandler = new ExceptionReporter(EasyTracker.getInstance(this),
            GAServiceManager.getInstance(), Thread.getDefaultUncaughtExceptionHandler(), this);

    StandardExceptionParser exceptionParser =
            new StandardExceptionParser(getApplicationContext(), null) {
                @Override
                public String getDescription(String threadName, Throwable t) {
                    return "{" + threadName + "} " + "{" + Build.MODEL + "} " + "{" + Build.VERSION.SDK_INT + "} " + Log.getStackTraceString(t);
                }
            };

    myHandler.setExceptionParser(exceptionParser);
    Thread.setDefaultUncaughtExceptionHandler(myHandler);
}
 
开发者ID:PhaniGaddipati,项目名称:Stacks-Flashcards,代码行数:19,代码来源:MainActivity.java

示例3: TrackerInst

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
public TrackerInst() {
    try {
        EasyTracker.getInstance().setContext(MyApplication.self);
        tracker = EasyTracker.getTracker();

        // Use custom exception reporter to avoid but in GA v2.0 beta 4
        exceptionReporter = new ExceptionReporter(
            tracker,
            GAServiceManager.getInstance(),
            Thread.getDefaultUncaughtExceptionHandler(),
            MyApplication.self
        );

        exceptionReporter.setExceptionParser(new MyExceptionParser());
        Thread.setDefaultUncaughtExceptionHandler(exceptionReporter);
    } catch (Exception ex) {
        Common.log(ex);
        tracker = null;
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:21,代码来源:TrackerInst.java

示例4: onCreate

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    mInstance = this;

    mPreferences = PreferenceManager.getDefaultSharedPreferences(this);

    mGoogleAnalytics = GoogleAnalytics.getInstance(this);
    mGaTracker = mGoogleAnalytics.getTracker(getString(R.string.ga_trackingId));
    mGoogleAnalytics.setAppOptOut(mPreferences.getBoolean("analytics", false));

    Thread.UncaughtExceptionHandler myHandler = new ExceptionReporter(
            mGaTracker,                                        // Currently used Tracker.
            GAServiceManager.getInstance(),                   // GAServiceManager singleton.
            Thread.getDefaultUncaughtExceptionHandler(), this);     // Current default uncaught exception handler.

    // Make myHandler the new default uncaught exception handler.
    Thread.setDefaultUncaughtExceptionHandler(myHandler);

    // work-around for Android defect 9431
    System.setProperty("java.net.preferIPv4Stack", "true");
    System.setProperty("java.net.preferIPv6Addresses", "false");
    System.setProperty("org.eclipse.jetty.util.UrlEncoded.charset", "utf-8");
}
 
开发者ID:mauimauer,项目名称:cheapcast,代码行数:25,代码来源:App.java

示例5: startTracker

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void startTracker(String id, CallbackContext callbackContext) {
       if (null != id && id.length() > 0) {
           GoogleAnalytics.getInstance(this.cordova.getActivity()).getTracker(id);
           callbackContext.success("tracker started");
           trackerStarted = true;
           GAServiceManager.getInstance().setLocalDispatchPeriod(30); //deprecated but whatcha gonna do? set dispatch period to 30 sec
        // Set the log level to verbose.
         /*GoogleAnalytics.getInstance(this.cordova.getActivity()).getLogger()
               .setLogLevel(LogLevel.VERBOSE);*/
       } else {
           callbackContext.error("tracker id is not valid");
       }
   }
 
开发者ID:psydrake,项目名称:pandacoinBalance,代码行数:15,代码来源:UniversalAnalyticsPlugin.java

示例6: init

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
@Kroll.method
public void init( String trackingId, boolean dryRun, boolean manualSession, boolean async, int dispatch){
	async_state = async;
	
	if( async_state == false ){
		GAServiceManager.getInstance().setLocalDispatchPeriod(dispatch);
	}
	
	mInstance.setDryRun(dryRun);
	tracker = mInstance.getTracker(trackingId);
	
	if( manualSession == true ){
		tracker.set(Fields.SESSION_CONTROL, "start");
	}
}
 
开发者ID:UnRyongPark,项目名称:Titanium-Google-Analytics-for-Android-v3,代码行数:16,代码来源:GaAndroidModule.java

示例7: trackEvent

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
@Kroll.method
public void trackEvent(HashMap props){
	KrollDict propsDict = new KrollDict(props);
	String category = TiConvert.toString(propsDict, "category");
	String action = TiConvert.toString(propsDict, "action");
	String label = TiConvert.toString(propsDict, "label");
	long value = TiConvert.toInt(propsDict, "value");
	
	tracker.send(MapBuilder.createEvent(category, action, label, value).build());
	if( async_state == true ){
		GAServiceManager.getInstance().dispatchLocalHits();
	}
}
 
开发者ID:UnRyongPark,项目名称:Titanium-Google-Analytics-for-Android-v3,代码行数:14,代码来源:GaAndroidModule.java

示例8: trackScreen

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
@Kroll.method
public void trackScreen(String screen){
	tracker.set(Fields.SCREEN_NAME, screen);
	tracker.send(MapBuilder.createAppView().build());
	
	if( async_state == true ){
		GAServiceManager.getInstance().dispatchLocalHits();
	}
}
 
开发者ID:UnRyongPark,项目名称:Titanium-Google-Analytics-for-Android-v3,代码行数:10,代码来源:GaAndroidModule.java

示例9: onCreate

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    Log.d(LOG_TAG, "onCreate()");

    mWifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE);
    mNetIf = Utils.getActiveNetworkInterface();

    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        mPreferences = getSharedPreferences("cheapcast", MODE_PRIVATE | MODE_MULTI_PROCESS);
    } else {
        mPreferences = getSharedPreferences("cheapcast", MODE_PRIVATE);
    }
    Log.d(LOG_TAG, String.format("Starting up: friendlyName: %s", mPreferences.getString("friendly_name","CheapCasto")));
    mGson = new Gson();

    mGoogleAnalytics = GoogleAnalytics.getInstance(this);
    mGaTracker = mGoogleAnalytics.getTracker(getString(R.string.ga_trackingId));
    mGoogleAnalytics.setAppOptOut(mPreferences.getBoolean("analytics", false));

    Thread.UncaughtExceptionHandler myHandler = new ExceptionReporter(
            mGaTracker,                                        // Currently used Tracker.
            GAServiceManager.getInstance(),                   // GAServiceManager singleton.
            Thread.getDefaultUncaughtExceptionHandler(), this);     // Current default uncaught exception handler.


    mGaTracker.sendEvent("CheapCastService","ServiceStart", null,null);

    mRegisteredApps = new HashMap<String, App>();
    registerApp(new App("ChromeCast", "https://www.gstatic.com/cv/receiver.html?$query"));
    registerApp(new App("YouTube", "https://www.youtube.com/tv?$query"));
    registerApp(new App("PlayMovies", "https://play.google.com/video/avi/eureka?$query", new String[]{"play-movies", "ramp"}));
    registerApp(new App("GoogleMusic", "https://play.google.com/music/cast/player"));

    registerApp(new App("GoogleCastSampleApp", "http://anzymrcvr.appspot.com/receiver/anzymrcvr.html"));
    registerApp(new App("GoogleCastPlayer", "https://www.gstatic.com/eureka/html/gcp.html"));
    registerApp(new App("Fling", "$query"));
    registerApp(new App("TicTacToe", "http://www.gstatic.com/eureka/sample/tictactoe/tictactoe.html", new String[]{"com.google.chromecast.demo.tictactoe"}));
}
 
开发者ID:mauimauer,项目名称:cheapcast,代码行数:40,代码来源:CheapCastService.java

示例10: initializeGa

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
/**
 * Initialize Google Analytics tracker.
 */
private void initializeGa() {
    mGa = GoogleAnalytics.getInstance(this);
    mTracker = mGa.getTracker(GA_PROPERTY_ID);

    // Set dispatch period.
    GAServiceManager.getInstance().setLocalDispatchPeriod(GA_DISPATCH_PERIOD);

    // Set Logger verbosity.
    mGa.getLogger().setLogLevel(GA_LOG_VERBOSITY);
}
 
开发者ID:swentel,项目名称:gentsefeesten,代码行数:14,代码来源:BaseActivity.java

示例11: init

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
public static void init(Context ctx, int dispatchSeconds) {
	// Start the tracker in manual dispatch mode...
	// tracker.startNewSession("UA-YOUR-ACCOUNT-HERE", this);
	// ...alternatively, the tracker can be started with a dispatch interval
	// (in seconds).
	GoogleAnalytics.getInstance(ctx);
	EasyTracker.getInstance(ctx);
	GAServiceManager.getInstance().setLocalDispatchPeriod(dispatchSeconds);
	
	if (me == null) {
		me = new AnalyticsGoogleV3();
		Analytics.add(me);
	}
}
 
开发者ID:sheng168,项目名称:analytics-facade,代码行数:15,代码来源:AnalyticsGoogleV3.java

示例12: track

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
@Override
public void track(String name) {
	tracker.set(Fields.SCREEN_NAME, name);
	
	Map<String, String> param = MapBuilder.createAppView()
			.build();
	tracker.send(param);
	
	GAServiceManager.getInstance().dispatchLocalHits();
}
 
开发者ID:sheng168,项目名称:analytics-facade,代码行数:11,代码来源:AnalyticsGoogleTracker.java

示例13: init

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
public static void init(Context ctx, int dispatchSeconds, String trackingId) {
	Tracker tracker = GoogleAnalytics.getInstance(ctx).getTracker(
			trackingId);

	GAServiceManager.getInstance().setLocalDispatchPeriod(dispatchSeconds);

	if (me == null) {
		me = new AnalyticsGoogleTracker(tracker);
		Analytics.add(me);
	}
}
 
开发者ID:sheng168,项目名称:analytics-facade,代码行数:12,代码来源:AnalyticsGoogleTracker.java

示例14: init

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
public static void init(Context ctx, int dispatchSeconds) {
	// Start the tracker in manual dispatch mode...
	// tracker.startNewSession("UA-YOUR-ACCOUNT-HERE", this);
	// ...alternatively, the tracker can be started with a dispatch interval
	// (in seconds).
	EasyTracker.getInstance().setContext(ctx);
	GAServiceManager.getInstance().setDispatchPeriod(dispatchSeconds);
	
	if (me == null) {
		me = new AnalyticsGoogleV2();
		Analytics.add(me);
	}
}
 
开发者ID:sheng168,项目名称:analytics-facade,代码行数:14,代码来源:AnalyticsGoogleV2.java

示例15: Analytics

import com.google.analytics.tracking.android.GAServiceManager; //导入依赖的package包/类
public Analytics(Context context) {
	mGaInstance = GoogleAnalytics.getInstance(context);
	//testes UA-38962564-1 pra valer UA-40266822-1
	mGaTracker = mGaInstance.getTracker("UA-40266822-1");
	GAServiceManager.getInstance().setDispatchPeriod(30);
	String deviceId = ((TelephonyManager) context
			.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
	if (deviceId == null)
		deviceId = "anonymous";
	track("/user/" + deviceId);
}
 
开发者ID:simbiose,项目名称:nheengare,代码行数:12,代码来源:Analytics.java


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