本文整理汇总了Java中com.bugsense.trace.BugSenseHandler类的典型用法代码示例。如果您正苦于以下问题:Java BugSenseHandler类的具体用法?Java BugSenseHandler怎么用?Java BugSenseHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BugSenseHandler类属于com.bugsense.trace包,在下文中一共展示了BugSenseHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
public static void init(Context ctx){
context = ctx;
preferences = ctx.getSharedPreferences(CHAT_SDK_SHRED_PREFS, Context.MODE_PRIVATE);
VolleyUtils.init(ctx);
DaoCore.init(ctx);
BFacebookManager.init(context.getString(R.string.facebook_id), ctx);
//Bug Sense
if (BNetworkManager.BUGSENSE_ENABLED && StringUtils.isNotEmpty( context.getString(R.string.bug_sense_key) )) {
BugSenseHandler.initAndStartSession(ctx, context.getString(R.string.bug_sense_key));
BugSenseHandler.addCrashExtraData("Version", BuildConfig.VERSION_NAME);
}
}
示例2: onFailure
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
@Override
public void onFailure(FastRequest request, VolleyError error) {
super.onFailure(request, error);
if(error instanceof SessionError){
FastAlert.error(this, error.getMessage());
Activity activity = getActivity();
if(activity != null){
startActivity(new Intent(getActivity(), LoginActivity.class));
getActivity().finish();
}
}else if(error instanceof SomeError){
FastAlert.error(this, error.getMessage());
}else{
BugSenseHandler.sendException(error);
}
}
示例3: deliver
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
@Override
public void deliver(final Boolean success) {
mLogs.info("SettingsFragment. Login succeed");
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
Utils.setLoading(mActivity, false);
if (!type.equals("FB"))
BugSenseHandler.setUserIdentifier(Prefs.getApiUsername(mActivity));
setupOptions();
mActivity.startService(new Intent(mActivity, XmppService.class));
if (mDoAfterLogin != null)
mDoAfterLogin.run();
}
});
}
示例4: onCreate
import com.bugsense.trace.BugSenseHandler; //导入依赖的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");
}
示例5: onCreate
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
if (LOG) Log.d(TAG, "onCreated");
// registerVolumeButtonReceiver();
BugSenseHandler.initAndStartSession(CallerFlashlight.this, "2b2cf28e");
prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.registerOnSharedPreferenceChangeListener(this);
editor = prefs.edit();
commit = new Runnable() {
public void run() {
if (LOG) Log.d(TAG, "Committing preferences");
savePreferences();
}
};
loadPreferences();
BugSenseHandler.addCrashExtraData("driver", String.valueOf(getType()));
}
示例6: onCreate
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
if (LOG) Log.d(TAG, "onCreated");
// registerVolumeButtonReceiver();
BugSenseHandler.initAndStartSession(CallerFlashlight.this, "00000000");
prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.registerOnSharedPreferenceChangeListener(this);
editor = prefs.edit();
commit = new Runnable() {
public void run() {
if (LOG) Log.d(TAG, "Committing preferences");
savePreferences();
}
};
loadPreferences();
BugSenseHandler.addCrashExtraData("driver", String.valueOf(getType()));
BugSenseHandler.addCrashExtraData("who", this.getPackageName());
}
示例7: onCreate
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
enableDebugLog(ENABLE_DEBUG, TAG);
BugSenseHandler.initAndStartSession(MainActivity.this, "9c65e78b");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
if (savedInstanceState == null && getInvitationId() == null) {
showScreen(Screen.MAIN);
}
EventBus.getDefault().register(this);
}
示例8: emit
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
public void emit(Context context, String text, byte[] picture, String fingerprint) {
String media = GifMedia.mediaFromGIFbytes(picture);
if (media == null) {
// malformed GIF
if (!BuildConfig.DEBUG) {
BugSenseHandler.sendEvent("null gif, bytes==null "+ (picture == null));
}
return;
}
ChatRequest chatRequest = new ChatRequest(
apiKey,
text,
media,
fingerprint
);
BusManager.get().getChatBus().post(chatRequest);
}
示例9: onAttach
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
//Log.w(MainActivity.TAG_SETUP, "onAttach()");
mActivity = activity;
// Make sure that the parent activity implemented the callback.
try {
mOnDoneWithSetupListener = (OnDoneWithSetupListener) mActivity;
} catch (ClassCastException ex) {
BugSenseHandler.log(MainActivity.TAG_SETUP, ex);
throw new ClassCastException(mActivity.toString() + "must implement OnDoneWithSetupListener");
}
}
示例10: onCreate
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
if (LOG) Log.d(TAG, "onCreated");
// registerVolumeButtonReceiver();
BugSenseHandler.initAndStartSession(CallerFlashlight.this, "2b2cf28e");
prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.registerOnSharedPreferenceChangeListener(this);
editor = prefs.edit();
commit = new Runnable() {
public void run() {
if (LOG) Log.d(TAG, "Committing preferences");
savePreferences();
}
};
loadPreferences();
BugSenseHandler.addCrashExtraData("driver", String.valueOf(getType()));
BugSenseHandler.addCrashExtraData("who", this.getPackageName());
}
示例11: onStartCommand
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
copyEnabled = intent.getBooleanExtra("COPY", false);
Utils.logger("d", "Copy to extSdcard: " + copyEnabled, DEBUG_TAG);
audio = intent.getStringExtra("AUDIO");
Utils.logger("d", "Audio extraction: " + audio, DEBUG_TAG);
removeVideo = settings.getBoolean("remove_video", false);
try {
if (audio.equals("none")) removeVideo = false;
} catch (NullPointerException ne) {
removeVideo = false;
Log.e(DEBUG_TAG, "DownloadsService: " + ne.getMessage());
BugSenseHandler.sendExceptionMessage(DEBUG_TAG + "-> DownloadsService: ", ne.getMessage(), ne);
}
Utils.logger("d", "Video removal: " + removeVideo, DEBUG_TAG);
super.onStartCommand(intent, flags, startId);
return START_NOT_STICKY;
}
示例12: doInBackground
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
protected String doInBackground(String... urls) {
try {
Utils.logger("d", "doInBackground...", DEBUG_TAG);
if (settings.getBoolean("show_thumb", false)) {
downloadThumbnail(generateThumbUrl());
}
return downloadUrl(urls[0]);
} catch (IOException e) {
Log.e(DEBUG_TAG, "downloadUrl: " + e.getMessage());
BugSenseHandler.sendExceptionMessage(DEBUG_TAG + "-> downloadUrl: ", e.getMessage(), e);
return "e";
} catch (RuntimeException re) {
Log.e(DEBUG_TAG, "downloadUrl: " + re.getMessage());
BugSenseHandler.sendExceptionMessage(DEBUG_TAG + "-> downloadUrl: ", re.getMessage(), re);
//Toast.makeText(ShareActivity.this, getString(R.string.error), Toast.LENGTH_LONG).show();
return "e";
}
}
示例13: tempDownloadToSdcard
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
private void tempDownloadToSdcard(Request request) {
videoUri = Uri.parse(dir_Downloads.toURI() + composedVideoFilename);
Utils.logger("d", "** NEW ** videoUri: " + videoUri, DEBUG_TAG);
request.setDestinationUri(videoUri);
try {
enqueue = dm.enqueue(request);
} catch (IllegalArgumentException e) {
Log.e(DEBUG_TAG, "tempDownloadToSdcard: " + e.getMessage());
BugSenseHandler.sendExceptionMessage(DEBUG_TAG + "-> tempDownloadToSdcard", e.getMessage(), e);
} catch (NullPointerException ne) {
Log.e(DEBUG_TAG, "callDownloadApk: " + ne.getMessage());
BugSenseHandler.sendExceptionMessage(DEBUG_TAG + "-> tempDownloadToSdcard: ", ne.getMessage(), ne);
Toast.makeText(this, getString(R.string.error), Toast.LENGTH_LONG).show();
}catch (SecurityException se) {
Log.e(DEBUG_TAG, "callDownloadApk: " + se.getMessage());
BugSenseHandler.sendExceptionMessage(DEBUG_TAG + "-> tempDownloadToSdcard: ", se.getMessage(), se);
Toast.makeText(this, getString(R.string.error), Toast.LENGTH_LONG).show();
}
}
示例14: digest
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
private void digest(byte[] bytes) {
try {
IOUtils.write(bytes, digestOutputStream);
} catch (Exception e) {
BugSenseHandler.sendExceptionMessage( "DEBUG", "Digesting bytes", e );
// ignore, all data goes to a NullOutputStream
}
}
示例15: init
import com.bugsense.trace.BugSenseHandler; //导入依赖的package包/类
public static void init(Context context) {
mActionHistory = new BoundedLinkedList<String>(8);
if(Studentportal.isDebugBuild()) {
mFlurryApiKey = FLURRY_API_KEY_DEBUG;
mBugsenseApiKey = BUGSENSE_API_KEY_DEBUG;
} else {
mFlurryApiKey = FLURRY_API_KEY_RELEASE;
mBugsenseApiKey = BUGSENSE_API_KEY_RELEASE;
}
BugSenseHandler.initAndStartSession(context, mBugsenseApiKey);
}