use of com.crashlytics.android.answers.CustomEvent in project quran_android by quran.
the class QuranDataActivity method checkPermissions.
private void checkPermissions() {
final String path = quranSettings.getAppCustomLocation();
final File fallbackFile = getExternalFilesDir(null);
boolean usesExternalFileDir = path != null && path.contains("com.quran");
if (path == null || (usesExternalFileDir && fallbackFile == null)) {
// suggests that we're on m+ and getExternalFilesDir returned null at some point
runListView();
return;
}
boolean needsPermission = !usesExternalFileDir || !path.equals(fallbackFile.getAbsolutePath());
if (needsPermission && !PermissionUtil.haveWriteExternalStoragePermission(this)) {
// request permission
if (PermissionUtil.canRequestWriteExternalStoragePermission(this)) {
Answers.getInstance().logCustom(new CustomEvent("storagePermissionRationaleShown"));
// show permission rationale dialog
permissionsDialog = new AlertDialog.Builder(this).setMessage(R.string.storage_permission_rationale).setCancelable(false).setPositiveButton(android.R.string.ok, (dialog, which) -> {
dialog.dismiss();
permissionsDialog = null;
Answers.getInstance().logCustom(new CustomEvent("storagePermissionRationaleAccepted"));
// request permissions
requestExternalSdcardPermission();
}).setNegativeButton(android.R.string.cancel, (dialog, which) -> {
// dismiss the dialog
dialog.dismiss();
permissionsDialog = null;
Answers.getInstance().logCustom(new CustomEvent("storagePermissionRationaleDenied"));
// fall back if we can
if (fallbackFile != null) {
quranSettings.setAppCustomLocation(fallbackFile.getAbsolutePath());
checkPages();
} else {
// set to null so we can try again next launch
quranSettings.setAppCustomLocation(null);
runListView();
}
}).create();
permissionsDialog.show();
} else {
// fall back if we can
if (fallbackFile != null) {
quranSettings.setAppCustomLocation(fallbackFile.getAbsolutePath());
checkPages();
} else {
// set to null so we can try again next launch
quranSettings.setAppCustomLocation(null);
runListView();
}
}
} else {
checkPages();
}
}
use of com.crashlytics.android.answers.CustomEvent in project quran_android by quran.
the class QuranImportActivity method showImportComplete.
public void showImportComplete() {
Answers.getInstance().logCustom(new CustomEvent("importDataSuccessful"));
Toast.makeText(QuranImportActivity.this, R.string.import_successful, Toast.LENGTH_LONG).show();
finish();
}
use of com.crashlytics.android.answers.CustomEvent in project VirtualXposed by android-hacker.
the class FlurryROMCollector method reportCameraNativeSetup.
private static void reportCameraNativeSetup() {
for (Method method : Camera.class.getDeclaredMethods()) {
if ("native_setup".equals(method.getName())) {
CustomEvent cameraSetup = new CustomEvent("camera::native_setup");
Map<String, String> methodDetails = createLogContent("method_details", Reflect.getMethodDetails(method));
for (String key : methodDetails.keySet()) {
cameraSetup.putCustomAttribute(key, methodDetails.get(key));
}
Answers.getInstance().logCustom(cameraSetup);
break;
}
}
}
use of com.crashlytics.android.answers.CustomEvent in project DisasterApp by cutmail.
the class MainActivity method openInquiry.
private void openInquiry() {
Answers.getInstance().logCustom(new CustomEvent("Open Inquiry"));
try {
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:cutmailapp@gmail.com"));
intent.putExtra(Intent.EXTRA_SUBJECT, "[地震・災害情報] お問い合わせ");
intent.putExtra(Intent.EXTRA_TEXT, "こちらにお問い合わせ内容をご記入ください。");
startActivity(intent);
} catch (ActivityNotFoundException e) {
Timber.e(e, e.getMessage());
}
}
use of com.crashlytics.android.answers.CustomEvent in project DisasterApp by cutmail.
the class MainActivity method openAbout.
private void openAbout() {
Answers.getInstance().logCustom(new CustomEvent("Open About"));
startActivity(new Intent(this, AboutActivity.class));
}
Aggregations