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


Java StandardExceptionParser类代码示例

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


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

示例1: trackException

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
public void trackException(Exception e) {
    if (e != null) {
        Tracker t = getGoogleAnalyticsTracker();

        t.send(new HitBuilders.ExceptionBuilder()
                .setDescription(
                        new StandardExceptionParser(this, null)
                                .getDescription(Thread.currentThread().getName(), e))
                .setFatal(false)
                .build()
        );
    }
}
 
开发者ID:MuditSrivastava,项目名称:Canvas-Vision,代码行数:14,代码来源:MyApplication.java

示例2: trackException

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
/***
 * Tracking exception
 *
 * @param e exception to be tracked
 */
public void trackException(Exception e) {
    if (e != null) {
        Tracker t = getGoogleAnalyticsTracker();

        t.send(new HitBuilders.ExceptionBuilder()
                .setDescription(
                        new StandardExceptionParser(this, null)
                                .getDescription(Thread.currentThread().getName(), e))
                .setFatal(false)
                .build()
        );
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:19,代码来源:ApplicationLoader.java

示例3: trackException

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
public void trackException(Exception e) {
    if (e != null) {
        Tracker t = getGoogleAnalyticsTracker();

        t.send(new HitBuilders.ExceptionBuilder()
                .setDescription(new StandardExceptionParser(this, null).getDescription(Thread.currentThread().getName(), e))
                .setFatal(false)
                .build()
        );
    }
}
 
开发者ID:reyanshmishra,项目名称:Rey-MusicPlayer,代码行数:12,代码来源:Common.java

示例4: exception

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
@Override
public void exception(Exception e) {
    if (e != null) {
        tracker.send(new HitBuilders.ExceptionBuilder()
                .setDescription(
                        new StandardExceptionParser(applicationContext, null).getDescription(Thread.currentThread().getName(), e))
                .setFatal(false)
                .build()
        );
    }
}
 
开发者ID:florent37,项目名称:AndroidAnalytics,代码行数:12,代码来源:GoogleAnalyticsProvider.java

示例5: sendAnalyticsError

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
public void sendAnalyticsError(Throwable e)
{
	String analyticsPath = this.getClass().getName();

	Tracker t = ((E621Application) getApplication()).getTracker();

	t.send(new HitBuilders.ExceptionBuilder().
		setDescription(new StandardExceptionParser(this, null).getDescription(analyticsPath, e)).
		setFatal(false).
		build()
	);

}
 
开发者ID:e621Mobile,项目名称:E621Mobile,代码行数:14,代码来源:BaseActivity.java

示例6: Tracker

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
@Inject
public Tracker(@ForApplication Context context) {
    this.context = context;
    analytics = GoogleAnalytics.getInstance(context);
    tracker = analytics.newTracker(R.xml.google_analytics);
    tracker.setAppVersion(Integer.toString(BuildConfig.VERSION_CODE));
    exceptionParser = new StandardExceptionParser(context, null);
    if (BuildConfig.DEBUG) {
        analytics.setDryRun(true);
    }
}
 
开发者ID:andyCano,项目名称:TaskApp,代码行数:12,代码来源:Tracker.java

示例7: sendException

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
@Override
public void sendException(Throwable throwable, boolean isFatal) {
    this.tracker.send(new HitBuilders.ExceptionBuilder()
            .setDescription(new StandardExceptionParser(this.application, null).getDescription(Thread.currentThread().getName(), throwable))
            .setFatal(isFatal)
            .build());
}
 
开发者ID:zamojski,项目名称:TowerCollector,代码行数:8,代码来源:GoogleAnalyticsReportingService.java

示例8: trackException

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
/***
 * Tracking exception
 * Note: LogHelper will track exceptions as well,
 * so no need to call if making use of LogHelper with a throwable.
 *
 * @param e exception to be tracked
 */
public void trackException(Exception e) {
    if (e != null) {
        Tracker tracker = getGoogleAnalyticsTracker();

        tracker.send(new HitBuilders.ExceptionBuilder()
                .setDescription(new StandardExceptionParser(this, null)
                        .getDescription(Thread.currentThread().getName(), e))
                .setFatal(false)
                .build()
        );
    }
}
 
开发者ID:avluis,项目名称:Hentoid,代码行数:20,代码来源:HentoidApp.java

示例9: getViewObject

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
public synchronized <T extends ViewObject> T getViewObject(Class<T> clazz) {
    if (!data.containsKey(clazz.getName())) {
        try {
            Constructor<T> constructor = clazz.getConstructor(Context.class);
            data.put(clazz.getName(), constructor.newInstance(this));
        } catch (Exception e) {
            Log.w(TAG, "failed to create empty viewstate", e);
            Tracker t = getTracker();
            t.send(new HitBuilders.ExceptionBuilder()
                    .setDescription(new StandardExceptionParser(this, null).getDescription(Thread.currentThread().getName(), e))
                    .setFatal(false).build());
        }
    }
    return (T) data.get(clazz.getName());
}
 
开发者ID:egelke,项目名称:eIDSuite,代码行数:16,代码来源:EidSuiteApp.java

示例10: onStartDiag

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
@Override
public void onStartDiag() {
    try {
        Message msg = Message.obtain(null, EidService.DIAG, 0, 0);
        msg.replyTo = mEidServiceResponse;
        mEidService.send(msg);
    } catch (Exception e) {
        Tracker t = ((EidSuiteApp) this.getApplication()).getTracker();
        t.send(new HitBuilders.ExceptionBuilder()
                .setDescription(new StandardExceptionParser(this, null).getDescription(Thread.currentThread().getName(), e))
                .setFatal(false).build());
        Toast.makeText(this, R.string.toastFailed, Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:egelke,项目名称:eIDSuite,代码行数:15,代码来源:ViewActivity.java

示例11: navigate

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
private void navigate() {
    try {
        String urlValue  = url.getText().toString();
        URL parsed = new URL(urlValue.contains("://") ? urlValue : "http://" + urlValue);
        listener.onGo(parsed.toString());
    } catch (MalformedURLException e) {
        Toast.makeText(GoDialog.this.getActivity(), R.string.toastInvalidUrl, Toast.LENGTH_LONG).show();
        Tracker tracker = ((EidSuiteApp) GoDialog.this.getActivity().getApplication()).getTracker();
        tracker.send(new HitBuilders.ExceptionBuilder()
                .setDescription(new StandardExceptionParser(GoDialog.this.getActivity(), null).getDescription(Thread.currentThread().getName(), e))
                .setFatal(false).build());
    }
}
 
开发者ID:egelke,项目名称:eIDSuite,代码行数:14,代码来源:GoDialog.java

示例12: onCreateDialog

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setMessage(R.string.diagEndMsg)
            .setTitle(R.string.diagTitle)
            .setNegativeButton(R.string.cancel, null)
            .setPositiveButton(R.string.send, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    Intent i = new Intent(Intent.ACTION_SENDTO);
                    i.setType("text/plain");
                    i.setData(Uri.parse("mailto:[email protected]"));
                    i.putExtra(Intent.EXTRA_SUBJECT, "eID Suite: Diagnostics");
                    i.putExtra(Intent.EXTRA_TEXT, getArguments().getString("Result"));
                    i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    try {
                        startActivity(i);
                    } catch (ActivityNotFoundException ex) {
                        Toast.makeText(getActivity(), R.string.toastNoMailClient, Toast.LENGTH_SHORT).show();
                        Tracker tracker = ((EidSuiteApp) EndDiagDialog.this.getActivity().getApplication()).getTracker();
                        tracker.send(new HitBuilders.ExceptionBuilder()
                                .setDescription(new StandardExceptionParser(EndDiagDialog.this.getActivity(), null).getDescription(Thread.currentThread().getName(), ex))
                                .setFatal(false).build());
                    }
                }
            });
    return builder.create();
}
 
开发者ID:egelke,项目名称:eIDSuite,代码行数:28,代码来源:EndDiagDialog.java

示例13: sendException

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
@Override
public void sendException(Context c, Exception e, boolean fatal, String additionalData) {
    try {
        Tracker t = getAppTracker();
        if (t != null && e != null) {
            HitBuilders.ExceptionBuilder eb = new HitBuilders.ExceptionBuilder()
                    .setFatal(fatal)
                    .setCustomDimension(GA_DIM_EXCEPTION_NAME,
                            e.getClass().getCanonicalName())
                    .setDescription(
                            new StandardExceptionParser(c, null)
                                    .getDescription(Thread.currentThread()
                                            .getName(), e)
                    );
            if (!TextUtils.isEmpty(additionalData)) {
                eb.setCustomDimension(GA_DIM_ADDITIONAL_DATA, additionalData.substring(0, Math.min(additionalData.length(), 4096)));
            }
            eb.setCustomDimension(GA_DIM_EXCEPTION_MESSAGE, e.getMessage());

            t.send(eb.build());
        }
    } catch (Exception e2) {
        Log.e(TAG, "sendException", e2);
    }
    if (BuildConfig.DEBUG) {
        if (e != null) {
            Log.d(TAG, String.format("%s (%s)", e.getMessage(), additionalData));
        }
    }
}
 
开发者ID:marunjar,项目名称:anewjkuapp,代码行数:31,代码来源:AnalyticsFlavor.java

示例14: setExceptionHandler

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
private void setExceptionHandler() {
    ExceptionReporter handler = new ExceptionReporter(getTracker(), Thread.getDefaultUncaughtExceptionHandler(), this);
    StandardExceptionParser exceptionParser =
            new StandardExceptionParser(getApplicationContext(), null) {
                @Override
                public String getDescription(String threadName, Throwable t) {
                    return "{" + threadName + "} " + Log.getStackTraceString(t);
                }
            };

    handler.setExceptionParser(exceptionParser);
    Thread.setDefaultUncaughtExceptionHandler(handler);
}
 
开发者ID:nextgis,项目名称:android_gisapp,代码行数:14,代码来源:MainApplication.java

示例15: trackException

import com.google.android.gms.analytics.StandardExceptionParser; //导入依赖的package包/类
@Override
public void trackException(String s, Exception e, boolean fatal) {
    final String description = new StandardExceptionParser(ctx, null)
            .getDescription(Thread.currentThread().getName(), e);

    final Map<String, String> exceptionMap = new HitBuilders.ExceptionBuilder()
            .setDescription(s + " " + description)
            .setFatal(fatal).build();

    tracker.send(exceptionMap);
}
 
开发者ID:ligi,项目名称:AJShA,代码行数:12,代码来源:AnalyticsTracker.java


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