本文整理匯總了Java中com.google.android.gms.analytics.Tracker.enableExceptionReporting方法的典型用法代碼示例。如果您正苦於以下問題:Java Tracker.enableExceptionReporting方法的具體用法?Java Tracker.enableExceptionReporting怎麽用?Java Tracker.enableExceptionReporting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.analytics.Tracker
的用法示例。
在下文中一共展示了Tracker.enableExceptionReporting方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createTracker
import com.google.android.gms.analytics.Tracker; //導入方法依賴的package包/類
private static Tracker createTracker(Context aContext, String aTrackerId) {
GoogleAnalytics analytics = GoogleAnalytics.getInstance(aContext);
analytics.setLocalDispatchPeriod(LOCAL_DISPATCH_PERIOD);
Tracker tracker = analytics.newTracker(aTrackerId);
tracker.enableExceptionReporting(true);
return tracker;
}
示例2: prepareTrackersAndFbLogger
import com.google.android.gms.analytics.Tracker; //導入方法依賴的package包/類
/**
* Prepare Google analytics trackers and Facebook events logger.
* Send UTM campaign if exist.
*
* @param shop shop with app specific Google Ua or null, if global tracker is enough.
* @param context application context.
*/
public static synchronized void prepareTrackersAndFbLogger(Shop shop, Context context) {
GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);
// To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG
if (shop == null) {
deleteAppTrackers();
} else {
if (!mTrackers.containsKey(TRACKER_APP) && analytics != null) {
if (shop.getGoogleUa() != null && !shop.getGoogleUa().isEmpty()) {
Timber.d("Set new app tracker with id: %s", shop.getGoogleUa());
// App tracker determined by shop
Tracker appTracker = analytics.newTracker(shop.getGoogleUa());
appTracker.enableAutoActivityTracking(true);
appTracker.enableExceptionReporting(false);
appTracker.enableAdvertisingIdCollection(true);
mTrackers.put(TRACKER_APP, appTracker);
} else {
Timber.e(new RuntimeException(), "Creating GA app tracker with empty Google UA");
}
} else {
Timber.e("Trackers for this app already exist.");
}
}
// Add global tracker only one time.
if (!mTrackers.containsKey(TRACKER_GLOBAL) && analytics != null) {
Timber.d("Set new global tracker.");
// Global app tracker
Tracker appTrackerGlobal = analytics.newTracker(R.xml.global_tracker);
appTrackerGlobal.enableAutoActivityTracking(true);
appTrackerGlobal.enableExceptionReporting(true);
appTrackerGlobal.enableAdvertisingIdCollection(true);
mTrackers.put(TRACKER_GLOBAL, appTrackerGlobal);
// Send camping info only once time.
sendCampaignInfo();
}
facebookLogger = AppEventsLogger.newLogger(MyApplication.getInstance());
}
示例3: onCreate
import com.google.android.gms.analytics.Tracker; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Fabric init and ErrorHandler.
Fabric.with(this, new Crashlytics(), new Answers());
ErrorHandlerProvider.addErrorHandler(new FabricErrorHandler());
// Google Analytics init and ErrorHandling.
GoogleAnalytics googleAnalytics = GoogleAnalytics.getInstance(this);
final Tracker tracker = googleAnalytics.newTracker("UA-72699204-1");
tracker.enableExceptionReporting(true);
tracker.enableAdvertisingIdCollection(true);
tracker.enableAutoActivityTracking(true);
googleAnalytics.reportActivityStart(this);
ErrorHandlerProvider.addErrorHandler(new GoogleAnalyticsErrorHandler(tracker));
this.androidServices = new AndroidServices(this);
// App config and launch.
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useCompass = false;
config.useAccelerometer = true;
config.hideStatusBar = true;
config.useWakelock = true;
initialize(new SpaceTravels3(this.androidServices), config);
}
示例4: provideGoogleAnalyticsTracker
import com.google.android.gms.analytics.Tracker; //導入方法依賴的package包/類
@Singleton
@Provides
public Tracker provideGoogleAnalyticsTracker(Context context) {
GoogleAnalytics ga = GoogleAnalytics.getInstance(context);
Tracker tracker = ga.newTracker(BuildConfig.GA_TRACKING_ID);
tracker.enableAdvertisingIdCollection(true);
tracker.enableExceptionReporting(true);
return tracker;
}