com.crashlytics.android.Crashlytics Java Examples
The following examples show how to use
com.crashlytics.android.Crashlytics.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PalmApp.java From OmniList with GNU Affero General Public License v3.0 | 6 votes |
@Override public void onCreate() { super.onCreate(); Fabric.with(this, new Crashlytics()); mInstance = this; MultiDex.install(this); Colorful.init(this); /* * Enable stetho only in debug mode. */ if (BuildConfig.DEBUG) { Stetho.initializeWithDefaults(this); } AlarmsManager.init(getApplicationContext()); WakeLockManager.init(getApplicationContext(), false); }
Example #2
Source File: JianShiApplication.java From jianshi with Apache License 2.0 | 6 votes |
@Override public void onCreate() { super.onCreate(); appComponent = DaggerAppComponent.builder() .appModule(new AppModule(JianShiApplication.this)) .build(); final Fabric fabric = new Fabric.Builder(this) .kits(new Crashlytics()) .debuggable(true) .build(); Fabric.with(fabric); Stetho.initializeWithDefaults(this); instance = this; FlowManager.init(new FlowConfig.Builder(this).openDatabasesOnInit(true).build()); initLog(); CalligraphyConfig.initDefault(new CalligraphyConfig.Builder() .setDefaultFontPath("fonts/jianshi_default.otf") .setFontAttrId(R.attr.fontPath) .build() ); }
Example #3
Source File: DirectoryFragment.java From FireFiles with Apache License 2.0 | 6 votes |
@Override protected Long doInBackground(Uri... params) { if (isCancelled()) return null; Long result = null; try { if (!TextUtils.isEmpty(mPath)) { File dir = new File(mPath); result = Utils.getDirectorySize(dir); } } catch (Exception e) { if (!(e instanceof OperationCanceledException)) { Log.w(TAG, "Failed to calculate size for " + mPath + ": " + e); } Crashlytics.logException(e); } return result; }
Example #4
Source File: PocketPlaysApplication.java From Pocket-Plays-for-Twitch with GNU General Public License v3.0 | 6 votes |
@Override public void onCreate() { super.onCreate(); mContext = this.getApplicationContext(); initNotificationChannels(); if (!BuildConfig.DEBUG) { try { Fabric.with(this, new Crashlytics()); final Fabric fabric = new Fabric.Builder(this) .kits(new Crashlytics()) .debuggable(true) .build(); Fabric.with(fabric); } catch (Exception e) { e.printStackTrace(); } } }
Example #5
Source File: KcUtils.java From GotoBrowser with GNU General Public License v3.0 | 6 votes |
public static void clearApplicationCache(Context context, File file) { File dir = null; if (file == null) { dir = context.getCacheDir(); } else { dir = file; } if (dir == null) return; File[] children = dir.listFiles(); try { for (File child : children) if (child.isDirectory()) clearApplicationCache(context, child); else child.delete(); } catch (Exception e) { Crashlytics.logException(e); } }
Example #6
Source File: LoginRegistrationActivity.java From Password-Storage with MIT License | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Fabric.with(this, new Crashlytics()); setContentView(R.layout.activity_login_registration); login = (Button) findViewById(R.id.btn_login); register = (Button) findViewById(R.id.btn_register); cardView=(CardView)findViewById(R.id.layout2); splashActivity=new SplashActivity(); login.setOnClickListener(this); register.setOnClickListener(this); b=splashActivity.containsPass("password"); if(b==true) { register.setVisibility(View.INVISIBLE); cardView.setVisibility(View.INVISIBLE); } }
Example #7
Source File: RegistrationActivity.java From Password-Storage with MIT License | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Fabric.with(this, new Crashlytics()); setContentView(R.layout.activity_registration); auth = FirebaseAuth.getInstance(); appStatus=new AppStatus(getApplicationContext()); register = (Button) findViewById(R.id.btn_register); existinguser = (Button) findViewById(R.id.existinguser); edt_Password = (EditText) findViewById(R.id.edt_Rpassword); edt_RePassword = (EditText) findViewById(R.id.edt_RRepassword); edt_Email = (EditText) findViewById(R.id.edt_email); progressBar=(ProgressBar)findViewById(R.id.progressBar); register.setOnClickListener(this); existinguser.setOnClickListener(this); }
Example #8
Source File: DirectoryFragment.java From FireFiles with Apache License 2.0 | 6 votes |
private boolean onUninstallApp(DocumentInfo doc) { final Context context = getActivity(); final ContentResolver resolver = context.getContentResolver(); boolean hadTrouble = false; if (!doc.isDeleteSupported()) { Log.w(TAG, "Skipping " + doc); hadTrouble = true; return hadTrouble; } try { DocumentsContract.deleteDocument(resolver, doc.derivedUri); } catch (Exception e) { Log.w(TAG, "Failed to delete " + doc); Crashlytics.logException(e); hadTrouble = true; } return hadTrouble; }
Example #9
Source File: FlowApplication.java From flow-android with MIT License | 6 votes |
@Override public void onCreate() { super.onCreate(); Crashlytics.start(this); // Do init here FlowAsyncClient.init(getApplicationContext()); DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder() .cacheInMemory(true) .cacheOnDisc(true) .displayer(new FadeInBitmapDisplayer(500)) .build(); ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()) .defaultDisplayImageOptions(defaultOptions) .build(); ImageLoader.getInstance().init(config); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); if (preferences != null) { mIsUserLoggedIn = preferences.getBoolean(IS_USER_LOGGED_IN_KEY, false); } getMixpanel(); }
Example #10
Source File: DocumentsActivity.java From FireFiles with Apache License 2.0 | 6 votes |
@Override protected Uri doInBackground(Void... params) { final ContentResolver resolver = getContentResolver(); final DocumentInfo cwd = getCurrentDirectory(); ContentProviderClient client = null; Uri childUri = null; try { client = DocumentsApplication.acquireUnstableProviderOrThrow( resolver, cwd.derivedUri.getAuthority()); childUri = DocumentsContract.createDocument( resolver, cwd.derivedUri, mMimeType, mDisplayName); } catch (Exception e) { Log.w(TAG, "Failed to create document", e); Crashlytics.logException(e); } finally { ContentProviderClientCompat.releaseQuietly(client); } if (childUri != null) { saveStackBlocking(); } return childUri; }
Example #11
Source File: tools.java From HAPP with GNU General Public License v3.0 | 6 votes |
public static List<TimeSpan> getActiveProfile(String profile, SharedPreferences prefs){ Integer activeProfileIndex=-1; List<TimeSpan> activeProfile; String profileRawString = prefs.getString(profile, ""); if (profileRawString.equals("")){ //We do not have any profiles, return an empty one activeProfile = newEmptyProfile(); } else { ArrayList<ArrayList> profileDetailsArray = new Gson().fromJson(profileRawString,new TypeToken<List<ArrayList>>() {}.getType() ); for(int index = 0; index < profileDetailsArray.size(); index++){ if (profileDetailsArray.get(index).get(1).equals("active")) activeProfileIndex = index; } if (activeProfileIndex.equals(-1)){ //Could not find the profile, return an empty one activeProfile = newEmptyProfile(); Crashlytics.log(1,TAG,"Could not find the profile, return an empty one " + profile); } else { activeProfile = getProfile(profile, activeProfileIndex, prefs); } } return activeProfile; }
Example #12
Source File: StarterApplication.java From Gazetti_Newspaper_Reader with MIT License | 6 votes |
@Override public void onCreate() { super.onCreate(); Parse.enableLocalDatastore(this); Parse.initialize(this, Constants.getConstant(this, R.string.PARSE_APP_ID), Constants.getConstant(this, R.string.PARSE_CLIENT_KEY)); Fabric.with(this, new Crashlytics()); Crashlytics.getInstance().setDebugMode(false); Crashlytics.log(Log.INFO, StarterApplication.class.getName(), "Starting Application - " + System.currentTimeMillis()); NewsCatFileUtil.getInstance(this); UserPrefUtil.getInstance(this); ParseConfig.getInBackground(new ConfigCallback() { @Override public void done(ParseConfig config, ParseException e) { ConfigService.getInstance(); ConfigService.getInstance().setInstance(StarterApplication.this); } }); }
Example #13
Source File: CommentsItemView.java From 1Rramp-Android with MIT License | 6 votes |
private void setSteemEarnings(CommentModel commentModel) { try { double pendingPayoutValue = Double.parseDouble(commentModel.getPendingPayoutValue().split(" ")[0]); double totalPayoutValue = Double.parseDouble(commentModel.getTotalPayoutValue().split(" ")[0]); double curatorPayoutValue = Double.parseDouble(commentModel.getCuratorPayoutValue().split(" ")[0]); String briefPayoutValueString; if (pendingPayoutValue > 0) { briefPayoutValueString = String.format(Locale.US, "%1$.3f", pendingPayoutValue); } else { //cashed out briefPayoutValueString = String.format(Locale.US, "%1$.3f", totalPayoutValue + curatorPayoutValue); } payoutValue.setText(briefPayoutValueString); } catch (Exception e) { Crashlytics.log(e.toString()); } }
Example #14
Source File: WebsiteDetailFragment.java From Gazetti_Newspaper_Reader with MIT License | 6 votes |
private BookmarkModel getBookmarkModelObject() { final BookmarkModel bookmarkModel = new BookmarkModel(); try { bookmarkModel.setmArticleHeadline(mArticleHeadline); bookmarkModel.setCategoryName(catNameString); bookmarkModel.setNewspaperName(npNameString); bookmarkModel.setmArticleURL(mArticleURL); bookmarkModel.setmArticleBody(mArticleBody); bookmarkModel.setmArticleImageURL(mArticleImageURL); bookmarkModel.setmArticlePubDate(mArticlePubDate); } catch (Exception e) { Crashlytics.log("Exception while creating bookmark object - " + e.getMessage()); Crashlytics.logException(e); } return bookmarkModel; }
Example #15
Source File: LocaleUtils.java From prayer-times-android with Apache License 2.0 | 6 votes |
@NonNull public static String formatDate(@NonNull HijriDate date) { String format = getDateFormat(true); format = format.replace("DD", az(date.getDay(), 2)); if (format.contains("MMM")) { try { format = format.replace("MMM", getHijriMonth(date.getMonth() - 1)); } catch (ArrayIndexOutOfBoundsException ex) { Crashlytics.logException(ex); return ""; } } format = format.replace("MM", az(date.getMonth(), 2)); format = format.replace("YYYY", az(date.getYear(), 4)); format = format.replace("YY", az(date.getYear(), 2)); return formatNumber(format); }
Example #16
Source File: RecordingActivity.java From voice-pitch-analyzer with GNU Affero General Public License v3.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Fabric.with(this, new Crashlytics()); setContentView(R.layout.activity_recording); tabHost = (FragmentTabHost)findViewById(R.id.tabhost); tabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent); this.addTab(ReadingFragment.class, getString(R.string.title_text)); this.addTab(RecordGraphFragment.class, getString(R.string.realtime_graph)); SharedPreferences sharedPref = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE); Integer tabIndex = sharedPref.getInt(getString(R.string.recording_tab_index), 0); tabHost.setCurrentTab(tabIndex); }
Example #17
Source File: CrossPromoActivity.java From BusyBox with Apache License 2.0 | 6 votes |
private void showAppList() { AppListAdapter adapter = new AppListAdapter(this); List<RootAppInfo> crossPromoAppInfos = null; try { crossPromoAppInfos = getFeaturedRootApps(); } catch (Exception e) { Crashlytics.logException(e); } if (crossPromoAppInfos == null) { crossPromoAppInfos = new ArrayList<>(); } adapter.setAppInfos(crossPromoAppInfos); ObservableGridView gridView = (ObservableGridView) getViewById(R.id.list); gridView.setAdapter(adapter); }
Example #18
Source File: PoemBuilderActivity.java From cannonball-android with Apache License 2.0 | 6 votes |
private void createPoem() { if (poemContainer.getChildCount() > 0) { final String poemText = getPoemText(); final SparseIntArray imgList = poemTheme.getImageList(); // the line below seems weird, but relies on the fact that the index of SparseIntArray could be any integer final int poemImage = imgList.keyAt(imgList.indexOfValue(imgList.get(poemImagePager.getCurrentItem() + 1))); Crashlytics.setString(App.CRASHLYTICS_KEY_POEM_TEXT, poemText); Crashlytics.setInt(App.CRASHLYTICS_KEY_POEM_IMAGE, poemImage); Answers.getInstance().logCustom(new CustomEvent("clicked save poem") .putCustomAttribute("poem size", poemText.length()) .putCustomAttribute("poem theme", poemTheme.getDisplayName()) .putCustomAttribute("poem image", poemImage)); AppService.createPoem(getApplicationContext(), poemText, poemImage, poemTheme.getDisplayName(), dateFormat.format(Calendar.getInstance().getTime())); } else { Toast.makeText(getApplicationContext(), getResources().getString(R.string.toast_wordless_poem), Toast.LENGTH_SHORT) .show(); Crashlytics.log("PoemBuilder: User tried to create poem without words on it"); } }
Example #19
Source File: DirectoryContainerView.java From FireFiles with Apache License 2.0 | 6 votes |
@SuppressWarnings("unchecked") @Override protected void dispatchDraw(Canvas canvas) { try { Field field = ViewGroup.class.getDeclaredField("mDisappearingChildren"); field.setAccessible(true); mDisappearingChildren = (ArrayList<View>) field.get(this); } catch (Exception e) { Crashlytics.logException(e); } final ArrayList<View> disappearing = mDisappearingChildren; if (mDisappearingFirst && disappearing != null) { for (int i = 0; i < disappearing.size(); i++) { super.drawChild(canvas, disappearing.get(i), getDrawingTime()); } } super.dispatchDraw(canvas); }
Example #20
Source File: MainApp.java From BusyBox with Apache License 2.0 | 6 votes |
@Override public void onCreate() { super.onCreate(); MultiDex.install(this); // Logging if (BuildConfig.DEBUG) { Jot.add(new Jot.DebugLogger()); } else { Jot.add(new CrashlyticsLogger()); } // Fabric Fabric.with(this, new Crashlytics(), new Answers()); Analytics.add(AnswersLogger.getInstance()); // Crashlytics Crashlytics.setString("GIT_SHA", BuildConfig.GIT_SHA); Crashlytics.setString("BUILD_TIME", BuildConfig.BUILD_TIME); FirebaseMessaging.getInstance().subscribeToTopic("main-" + BuildConfig.FLAVOR); }
Example #21
Source File: NoteActivity.java From FireFiles with Apache License 2.0 | 6 votes |
private void getName(){ Uri uri = getIntent().getData(); if(null == uri){ return; } String name = ""; String scheme = uri.getScheme(); if (!TextUtils.isEmpty(scheme) && scheme.startsWith(ContentResolver.SCHEME_CONTENT)) { String part = uri.getSchemeSpecificPart(); final int splitIndex = part.indexOf(':', 1); if(splitIndex != -1) { name = part.substring(splitIndex + 1); } if(TextUtils.isEmpty(name)){ name = uri.getLastPathSegment(); } } else if (!TextUtils.isEmpty(scheme) && scheme.startsWith(ContentResolver.SCHEME_FILE)) { name = uri.getLastPathSegment(); } else { Crashlytics.log(Log.ERROR, "Error", "URI Error"); //incomplete } getSupportActionBar().setTitle(FileUtils.getName(name)); getSupportActionBar().setSubtitle(""); }
Example #22
Source File: AIDLDumper.java From Prodigal with Apache License 2.0 | 6 votes |
public void play(final SongBean song, final int index) { final PlayerServiceAIDL service = getService(); if (service == null) { class Fetcher {} pending.add(new RemoteOperation(Fetcher.class.getEnclosingMethod(), song, index)); return; } new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { try { service.play(song, index); } catch (Exception e) { Logger.dExp(e); Crashlytics.logException(e); } } }); }
Example #23
Source File: NewsCatFileUtil.java From Gazetti_Newspaper_Reader with MIT License | 6 votes |
public void updateSelectionWithNewAssets(Map<String, Object> map){ Crashlytics.log(Log.INFO, LOG_TAG, "Received map - "+map); Map<String, List<String>> selected = getUserFeedMapFromJsonMap(map); Crashlytics.log(Log.INFO, LOG_TAG, "New selected - "+selected); for (String newspaper : selected.keySet()) { List<String> categories; if (userSelectionMap.containsKey(newspaper)) { categories = userSelectionMap.get(newspaper); categories.addAll(selected.get(newspaper)); } else { categories = selected.get(newspaper); } userSelectionMap.put(newspaper, categories); Crashlytics.log(Log.INFO, LOG_TAG, "New selection for "+newspaper+ " is "+categories); } Crashlytics.log(Log.INFO, LOG_TAG, "newUserSelectionMap - "+userSelectionMap); setUserPrefChanged(true); convertUserFeedMapToJsonMap(); }
Example #24
Source File: FileUtils.java From FireFiles with Apache License 2.0 | 6 votes |
public static boolean copy(InputStream inputStream, OutputStream outputStream){ boolean successful = false; try { IoUtils.copy(inputStream, outputStream); outputStream.flush(); successful = true; } catch (IOException e) { Log.e("TransferThread", "writing failed"); Crashlytics.logException(e); } finally { IoUtils.closeQuietly(inputStream); IoUtils.closeQuietly(outputStream); } return successful; }
Example #25
Source File: FlowDatabaseLoader.java From flow-android with MIT License | 5 votes |
public void queryUserScheduleImage(String id, final FlowDatabaseImageCallback callback) { new AsyncTask<String, Void, ScheduleImage>() { @Override protected ScheduleImage doInBackground(String... strings) { try { String arg = strings[0]; if (arg == null) { arg = sp.getString(Constants.PROFILE_ID_KEY, null); if (arg == null) return null; } Dao<ScheduleImage, String> scheduleImageStringDao = flowDatabaseHelper.getUserSchduleImageDao(); QueryBuilder<ScheduleImage, String> queryBuilder = scheduleImageStringDao.queryBuilder(); queryBuilder.where().eq("id", arg); List<ScheduleImage> images = scheduleImageStringDao.query(queryBuilder.prepare()); if (!images.isEmpty()) return images.get(0); } catch (Exception e) { Crashlytics.logException(e); } return null; } @Override protected void onPostExecute(ScheduleImage result) { if (callback != null) { callback.onScheduleImageLoaded(result); } } }.execute(id); }
Example #26
Source File: IOB.java From HAPP with GNU General Public License v3.0 | 5 votes |
public static JSONObject iobCalc(Bolus bolus, Date time, Double dia) { JSONObject returnValue = new JSONObject(); Double diaratio = 3.0 / dia; Double peak = 75D ; Double end = 180D ; //if (treatment.type.equals("Insulin") ) { //Im only ever passing Insulin Date bolusTime = bolus.getTimestamp(); //Time the Insulin was taken Double minAgo = diaratio * (time.getTime() - bolusTime.getTime()) /1000/60; //Age in Mins of the treatment Double iobContrib = 0D; Double activityContrib = 0D; if (minAgo < peak) { //Still before the Peak stage of the insulin taken Double x = (minAgo/5 + 1); iobContrib = bolus.getValue() * (1 - 0.001852 * x * x + 0.001852 * x); //Amount of Insulin active? // TODO: 28/08/2015 getting negative numbers at times, what is this doing? //var activityContrib=sens*treatment.insulin*(2/dia/60/peak)*minAgo; activityContrib=bolus.getValue() * (2 / dia / 60 / peak) * minAgo; } else if (minAgo < end) { Double y = (minAgo-peak)/5; iobContrib = bolus.getValue() * (0.001323 * y * y - .054233 * y + .55556); //var activityContrib=sens*treatment.insulin*(2/dia/60-(minAgo-peak)*2/dia/60/(60*dia-peak)); activityContrib=bolus.getValue() * (2 / dia / 60 - (minAgo - peak) * 2 / dia / 60 / (60 * dia - peak)); } try { returnValue.put("iobContrib", iobContrib); if (activityContrib.isInfinite()) activityContrib = 0D; //*HAPP added* returnValue.put("activityContrib", activityContrib); } catch (JSONException e) { Crashlytics.logException(e); e.printStackTrace(); } return returnValue; //} }
Example #27
Source File: NetworkStorageProvider.java From FireFiles with Apache License 2.0 | 5 votes |
@Override public ParcelFileDescriptor openDocument(final String documentId, final String mode, CancellationSignal signal) throws FileNotFoundException { final NetworkFile file = getFileForDocId(documentId); final NetworkConnection connection = getNetworkConnection(documentId); try { final boolean isWrite = (mode.indexOf('w') != -1); if (isWrite) { return null; } else { Uri ftpUri = connection.toUri(file); URL url = new URL(ftpUri.toString()); URLConnection conn = url.openConnection(); InputStream inputStream = conn.getInputStream(); if(null != inputStream){ return ParcelFileDescriptorUtil.pipeFrom(inputStream); } } return null; } catch (Exception e) { Crashlytics.logException(e); throw new FileNotFoundException("Failed to open document with id " + documentId + " and mode " + mode); } }
Example #28
Source File: VPNhtApplication.java From android with GNU General Public License v3.0 | 5 votes |
@Override public void onCreate() { super.onCreate(); PRNGFixes.apply(); Fabric.with(this, new Crashlytics()); sThis = this; if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); } VpnStatus.addStateListener(this); }
Example #29
Source File: LogWrapper.java From Intra with Apache License 2.0 | 5 votes |
public static void log(int i, String s, String s1) { if (BuildConfig.DEBUG) { Log.println(i, s, s1); return; } try { Crashlytics.log(i, s, s1); } catch (IllegalStateException e) { // This only occurs during unit tests. } }
Example #30
Source File: MotionDetectorController.java From Telephoto with Apache License 2.0 | 5 votes |
private void saveProcessingTime(long time) { L.i("Processing time: " + time); processingTimes.add(time); if (processingTimes.size() > 10) { long res = 0; for (Long l : processingTimes) { res += l; } res = res / processingTimes.size(); processingTimes.clear(); Crashlytics.setLong("Processing time", res); } }