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


Java Crashlytics.log方法代码示例

本文整理汇总了Java中com.crashlytics.android.Crashlytics.log方法的典型用法代码示例。如果您正苦于以下问题:Java Crashlytics.log方法的具体用法?Java Crashlytics.log怎么用?Java Crashlytics.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.crashlytics.android.Crashlytics的用法示例。


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

示例1: DatabaseHandler

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
private DatabaseHandler(Context context, String databaseName) throws SQLException {
  String base = QuranFileUtils.getQuranDatabaseDirectory(context);
  if (base == null) return;
  String path = base + File.separator + databaseName;
  Crashlytics.log("opening database file: " + path);
  try {
    database = SQLiteDatabase.openDatabase(path, null,
      SQLiteDatabase.NO_LOCALIZED_COLLATORS, new DefaultDatabaseErrorHandler());
  } catch (SQLiteDatabaseCorruptException sce) {
    Crashlytics.log("corrupt database: " + databaseName);
    throw sce;
  } catch (SQLException se){
    Crashlytics.log("database file " + path +
        (new File(path).exists()? " exists" : " doesn't exist"));
    throw se;
  }

  schemaVersion = getSchemaVersion();
  matchString = "<font color=\"" +
      ContextCompat.getColor(context, R.color.translation_highlight) +
      "\">";
}
 
开发者ID:Elias33,项目名称:Quran,代码行数:23,代码来源:DatabaseHandler.java

示例2: logExceptionToFabric

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
public static void logExceptionToFabric(Throwable ex, String tag) {

        if (ex == null) {
            return;
        }

        try {
            ex.printStackTrace();
        } catch (StackOverflowError ignored) {
            Crashlytics.log("StackOverflowError in Logger " + ignored);
            return;
        }

        if (Fabric.isInitialized() && !TextUtils.isEmpty(ex.getMessage())) {
            Crashlytics.logException(ex);
        }
    }
 
开发者ID:ukevgen,项目名称:BizareChat,代码行数:18,代码来源:Logger.java

示例3: showHereMapsTerms

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
private void showHereMapsTerms() {
    Crashlytics.log(Log.INFO, SettingsActivity.class.getSimpleName(), "showHereMapsTerms()");

    WebView webView = new WebView(this);
    webView.setWebViewClient(new WebViewClient());
    webView.loadUrl(getString(R.string.here_maps_terms_url));

    new AlertDialog.Builder(this)
            .setView(webView)
            .setCancelable(true)
            .setPositiveButton(R.string.accept_terms_button_text, new DialogInterface.OnClickListener() {
                public void onClick(final DialogInterface dialog, final int id) {
                    Prefs.setHereMapsTermsAccepted(SettingsActivity.this, true);
                    limitProviderSelectorHandler(true); //Set limit provider now that terms have been accepted
                    Answers.getInstance().logCustom(new CustomEvent("Enabled HERE"));
                }})
            .setNegativeButton(R.string.reject_terms_button_text, null)
            .show();
}
 
开发者ID:jakehilborn,项目名称:speedr,代码行数:20,代码来源:SettingsActivity.java

示例4: getKeyPair

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
@NotNull
private KeyPair getKeyPair() {
    if (keyPair == null) {
        final Context context = assetSenderView.getContext();
        try {
            keyPair = KeyPair.getKeyPair(context);
        } catch (NoSuchPaddingException | UnrecoverableKeyException | NoSuchAlgorithmException
                | KeyStoreException | InvalidKeyException | IOException e) {
            Log.e(TAG, "getKeyPair: ", e);
            Crashlytics.log(Log.ERROR, AssetSenderPresenter.TAG, e.getMessage());
            assetSenderView.showError(ErrorMessageFactory.create(context, e));
            return new KeyPair("", "");
        }
    }
    return keyPair;
}
 
开发者ID:soramitsu,项目名称:iroha-demo-android,代码行数:17,代码来源:AssetSenderPresenter.java

示例5: privacyAndTermsOnClick

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
public void privacyAndTermsOnClick(View view) {
    Crashlytics.log(Log.INFO, SettingsActivity.class.getSimpleName(), "privacyAndTermsOnClick()");

    String content = getString(R.string.privacy_policy_content).replace("HERE_TERMS_PLACEHOLDER", getString(R.string.here_maps_terms_url));

    String localizedTerms = getString(R.string.speedr_terms_content);
    String englishTerms = "Speedr is for informational purposes only. Its function is to quantify how much time, or how little time, one saves when speeding in their car to help the user decide if speeding is worth the safety, monetary, and legal risks. Speeding is illegal and dangerous. By accepting these terms you absolve the Speedr developers, speed limit providers, and all other parties of any responsibility for accidents, legal consequences, and any and all other outcomes. The data presented by Speedr is not guaranteed to be accurate. Outdated/incorrect speed limit data and innaccurate GPS sensors may produce faulty data. Pay attention to the posted speed limits of roads as Speedr may not present accurate speed limits and pay attention to your vehicles' speedometer as Speedr may not present accurate current speed readings.";

    //These terms are important. Always show original in addition to localized terms since we can't rely on translators to correctly word this.
    if (!localizedTerms.equals(englishTerms)) {
        content += "<br><br>" + localizedTerms + "<br><br>" + englishTerms;
    } else {
        content += "<br><br>" + englishTerms;
    }

    ((TextView) new AlertDialog.Builder(this)
            .setTitle(R.string.privacy_policy_title)
            .setMessage(Html.fromHtml(content))
            .setCancelable(true)
            .setNegativeButton(R.string.close_dialog_button, null)
            .show()
            .findViewById(android.R.id.message)) //These 2 lines make the hyperlinks clickable
            .setMovementMethod(LinkMovementMethod.getInstance());

    Answers.getInstance().logCustom(new CustomEvent("Viewed privacy policy"));
}
 
开发者ID:jakehilborn,项目名称:speedr,代码行数:27,代码来源:SettingsActivity.java

示例6: onOptionsItemSelected

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.dev_info_appbar_button:
            devInfoOnClick();
            return true;
        case android.R.id.home:
            Crashlytics.log(Log.INFO, SettingsActivity.class.getSimpleName(), "AppBar Home pressed");
            if (newHereCredentials()) {
                return true;
            } else {
                return super.onOptionsItemSelected(item);
            }
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:jakehilborn,项目名称:speedr,代码行数:18,代码来源:SettingsActivity.java

示例7: registerFailure

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
private void registerFailure(Throwable throwable) {
    accountRegisterView.hideProgress();

    KeyPair.delete(accountRegisterView.getContext());

    Context c = accountRegisterView.getContext();
    if (NetworkUtil.isOnline(c)) {
        Crashlytics.log(Log.ERROR, AccountRegisterPresenter.TAG, throwable.getMessage());
        accountRegisterView.showError(ErrorMessageFactory.create(c, throwable));
    } else {
        accountRegisterView.showError(ErrorMessageFactory.create(c, new NetworkNotConnectedException()));
    }
}
 
开发者ID:soramitsu,项目名称:iroha-demo-android,代码行数:14,代码来源:AccountRegisterPresenter.java

示例8: onReceivedError

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.M)
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
  super.onReceivedError(view, request, error);
  Crashlytics.log(5, "KolibriWebView",
      "onReceivedError() called with: request = [" + request + "], error = [" + error + "]");

  // We ignore errors regarding assets loading,
  // so in this case we check if the request url and webview url are same
  if (request.getUrl().toString().equals(view.getUrl()) || request.isForMainFrame()) {
    for (KolibriWebViewClient webClient : webClients) {
      webClient.onReceivedError(view, request, error);
    }
  }
}
 
开发者ID:azmedien,项目名称:kolibri-android,代码行数:16,代码来源:KolibriWebView.java

示例9: requestLocationPermission

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
private boolean requestLocationPermission() {
    if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOCATION);
        Crashlytics.log(Log.INFO, MainActivity.class.getSimpleName(), "Request location permission");
        return false; //Short circuit startMainService() call, it will be recalled onRequestPermissionsResult()
    }
    Crashlytics.log(Log.INFO, MainActivity.class.getSimpleName(), "Location permission granted");
    return true;
}
 
开发者ID:jakehilborn,项目名称:speedr,代码行数:10,代码来源:MainActivity.java

示例10: openStreetMapCoverageOnClick

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
public void openStreetMapCoverageOnClick(View view) {
    Crashlytics.log(Log.INFO, SettingsActivity.class.getSimpleName(), "openStreetMapCoverageOnClick()");

    final String mapOfUnitedStates = "http://product.itoworld.com/map/124?lat=37.77557&lon=-100.44588&zoom=4";

    if (ContextCompat.checkSelfPermission(SettingsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
        googleApiClient = new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {
                    @Override
                    @SuppressWarnings("MissingPermission")
                    public void onConnected(Bundle bundle) {
                        Crashlytics.log(Log.INFO, SettingsActivity.class.getSimpleName(), "Coverage map with location");

                        String uri;
                        Location lastLocation = LocationServices.FusedLocationApi.getLastLocation(googleApiClient);
                        if (lastLocation != null) {
                            uri = "http://product.itoworld.com/map/124?lat=" + lastLocation.getLatitude() + "&lon=" + lastLocation.getLongitude() + "&zoom=14";
                        } else {
                            uri = mapOfUnitedStates;
                        }

                        launchWebpage(uri);
                        googleApiClient.disconnect();
                    }

                    @Override
                    public void onConnectionSuspended(int i) {}
                })
                .addApi(LocationServices.API)
                .build();

        googleApiClient.connect();
    } else {
        Crashlytics.log(Log.INFO, SettingsActivity.class.getSimpleName(), "Coverage map without location");
        launchWebpage(mapOfUnitedStates);
    }

    Answers.getInstance().logCustom(new CustomEvent("Launched OpenStreetMap coverage"));
}
 
开发者ID:jakehilborn,项目名称:speedr,代码行数:40,代码来源:SettingsActivity.java

示例11: destroy

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
public void destroy(Context context) {
    Crashlytics.log(Log.INFO, LimitFetcher.class.getSimpleName(), "destroy()");
    if (overpassSubscription != null) overpassSubscription.unsubscribe();
    if (hereMapsSubscription != null) hereMapsSubscription.unsubscribe();
    if (hereMapsError != null) hereMapsError.cancel();
    Prefs.setPendingHereActivation(context, false); //Set to false so the next time MainService is started the pending activation notice does not show
}
 
开发者ID:jakehilborn,项目名称:speedr,代码行数:8,代码来源:LimitFetcher.java

示例12: log

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
@Override
protected void log(int priority, String tag, String message, Throwable t) {
    Crashlytics.log(priority, message, tag);
    if (t != null) {
        Crashlytics.logException(t);
    }
    // If this is an error or a warning, log it as a exception so we see it in Crashlytics.
    if (priority >= Log.ERROR) {
        Crashlytics.logException(new Throwable(message));
    }
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:12,代码来源:IslamicLibraryApplication.java

示例13: stopMainService

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
private void stopMainService() {
    if (mainService != null) {
        mainService.stopTime = System.nanoTime();
        mainService.setCallback(null);
    }
    Crashlytics.log(Log.INFO, MainActivity.class.getSimpleName(), "Stopping MainService");
    styleStartStopButton(false);
    finalizeSessionInUI();
    unbindService(mainServiceConn);
    stopService(new Intent(this, MainService.class));
    mainService = null;
    driveTimeHandler.removeCallbacks(driveTimeRunnable);
    showHereSuggestion();
}
 
开发者ID:jakehilborn,项目名称:speedr,代码行数:15,代码来源:MainActivity.java

示例14: onStart

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
@Override
protected void onStart() {
    Crashlytics.log(Log.INFO, SettingsActivity.class.getSimpleName(), "onStart()");
    String versionString = getString(R.string.version_text) + " " + BuildConfig.VERSION_NAME;
    version.setText(versionString);

    if (BuildConfig.VERSION_CODE < Prefs.getLatestVersion(this)) {
        findViewById(R.id.update_available_section).setVisibility(View.VISIBLE);
        findViewById(R.id.update_available).setVisibility(View.VISIBLE);
    }

    super.onStart();
}
 
开发者ID:jakehilborn,项目名称:speedr,代码行数:14,代码来源:SettingsActivity.java

示例15: launchWebpage

import com.crashlytics.android.Crashlytics; //导入方法依赖的package包/类
private void launchWebpage(String uri) {
    Crashlytics.log(Log.INFO, SettingsActivity.class.getSimpleName(), "launchWebpage()");
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
    startActivity(intent);
}
 
开发者ID:jakehilborn,项目名称:speedr,代码行数:6,代码来源:SettingsActivity.java


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