• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ExceptionReporter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getTracker

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

import com.google.analytics.tracking.android.ExceptionReporter; //导入依赖的package包/类
private void initializeExceptionParser() {
    List<String> packages = Arrays.asList( "com.iwobanas", "com.google.android.vending");
    ExceptionParser exceptionParser = new AnalyticsExceptionParser(getApplicationContext(), packages);
    EasyTracker.getTracker().setExceptionParser(exceptionParser);
    Thread.UncaughtExceptionHandler uncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
    if (uncaughtExceptionHandler instanceof ExceptionReporter) {
        ExceptionReporter exceptionReporter = (ExceptionReporter) uncaughtExceptionHandler;
        exceptionReporter.setExceptionParser(exceptionParser);
    }
}
 
开发者ID:iwo,项目名称:SCR-Screen-Recorder-app,代码行数:11,代码来源:RecorderService.java


示例6: GoogleAnalyticsTracking

import com.google.analytics.tracking.android.ExceptionReporter; //导入依赖的package包/类
public GoogleAnalyticsTracking(Context context) {
    mTracker = EasyTracker.getInstance(context);

    Thread.UncaughtExceptionHandler uncaughtExceptionHandler =
            Thread.getDefaultUncaughtExceptionHandler();
    if (uncaughtExceptionHandler instanceof ExceptionReporter) {
        ExceptionReporter exceptionReporter = (ExceptionReporter) uncaughtExceptionHandler;
        exceptionReporter.setExceptionParser(new AnalyticsExceptionParser());
    }
}
 
开发者ID:johnjohndoe,项目名称:Umweltzone,代码行数:11,代码来源:GoogleAnalyticsTracking.java


示例7: onCreate

import com.google.analytics.tracking.android.ExceptionReporter; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    EasyTracker.getInstance(this);
    Thread.UncaughtExceptionHandler uncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
    if (uncaughtExceptionHandler instanceof ExceptionReporter) {
        ExceptionReporter exceptionReporter = (ExceptionReporter) uncaughtExceptionHandler;
        exceptionReporter.setExceptionParser(new AnalyticsExceptionParser());
    }
    mInstance = this;
}
 
开发者ID:Trolldad,项目名称:Reddit-Headlines,代码行数:12,代码来源:RedditHeadlinesApplication.java


示例8: onCreate

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DataItemAsset类代码示例发布时间:2022-05-23
下一篇:
Java JSONObject类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap