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


Java FirebaseCrash.log方法代码示例

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


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

示例1: fetchAccessToken

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
private void fetchAccessToken(Intent intent) {
    Uri uri = intent.getData();
    String code = uri.getQueryParameter("code");
    String state = uri.getQueryParameter("state");
    originalHashState = sharedPreferences.getString(PREF_CODE_STATE, null);
    if (code != null && state != null && state.equals(originalHashState)) {
        if (state.equals(originalHashState)) {
            SharedPreferences.Editor sharedPreferencesEditor = sharedPreferences.edit();
            sharedPreferencesEditor.putString(PREF_ACCESS_CODE, code);
            sharedPreferencesEditor.apply();
            requestAccessToken(code);
        } else {
            FirebaseCrash.log("Invalid state received. Possible security attack");
            EventBus.getDefault().postSticky(loginEvent.setLoginSuccess(false));
            finish();
        }
    } else {
        FirebaseCrash.log("No access_code received");
        EventBus.getDefault().postSticky(loginEvent.setLoginSuccess(false));
        finish();
    }
}
 
开发者ID:Protino,项目名称:CodeWatch,代码行数:23,代码来源:LoginActivity.java

示例2: onPostExecute

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
@Override
protected void onPostExecute(@Constants.ErrorCodes Integer result) {
    if (swipeRefreshLayout != null) {
        swipeRefreshLayout.setRefreshing(false);
    }
    switch (result) {
        case INTERNET_OFF:
            showSnackBar(R.string.internet_error_message);
            break;
        case STATS_UPDATING:
            showSnackBar(R.string.stats_updating_error_message);
            break;
        case UNKNOWN_ERROR:
            FirebaseCrash.log("Unknown error occurred while fetching stats - error code" + UNKNOWN_ERROR);
            break;
        default:
            break;
    }
}
 
开发者ID:Protino,项目名称:CodeWatch,代码行数:20,代码来源:DashboardFragment.java

示例3: handleGoogleSignInResult

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
@DebugLog
void handleGoogleSignInResult(GoogleSignInResult result) {
    if (result.isSuccess()) {
        // Successful Google sign in, authenticate with Firebase.
        GoogleSignInAccount acct = result.getSignInAccount();
        firebaseAuthWithGoogle(acct);
    } else {
        // Unsuccessful Google Sign In, show signed-out UI
        Timber.e("Google Sign-In failed.");
        Timber.e("status code : " + result.getStatus().getStatusCode());
        Timber.e(result.getStatus().getStatusMessage());
        String error = "Google Sign-In failed. status code : " +
                result.getStatus().getStatusCode() + " . reason: " +
                result.getStatus().getStatusMessage();
        Toast.makeText(this, error, Toast.LENGTH_SHORT).show();
        FirebaseCrash.log(error);
    }
}
 
开发者ID:hbmartin,项目名称:firebase-chat-android-architecture-components,代码行数:19,代码来源:ProfileActivity.java

示例4: onLoginResult

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
@Override
public void onLoginResult(final boolean onResult, final String message) {
    if (onResult) {
        //Notifications
        userSearchForNews();

        /*TODO DEBUG PART
        NotificationManager manager = new NotificationManager(getApplicationContext());
        manager.deactivateRecurrentService();*/

        //Updates
        FirebaseCrash.log("Trying update in UAService with last time " + String.valueOf(app.lastUpdateTime));
        if (!message.equals("_ISFIRST") && UpdaterHelper.needsSilenceUpdate(app.lastUpdateTime)) {
            //Silence Update
            Intent intent = new Intent(UAService.this, UAUpdate.class);
            intent.putExtra(Common.INTENT_KEY_UPDATE_TYPE, Common.UAUPDATE_TYPE_SILENCE);
            startService(intent);
        }
    }
}
 
开发者ID:Onelio,项目名称:ConnectU,代码行数:21,代码来源:UAService.java

示例5: saveData

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
private void saveData(int count) {
    //Put count
    try {
        content.put("count", count);
    } catch (JSONException e) {
        //Error setting count
        FirebaseCrash.report(e);
    }
    //Save to file
    DatabaseManager database = new DatabaseManager(context);
    String result = content.toString();
    if (result == null) {
        result = "";
    }
    database.putString(Common.PREFERENCE_JSON_NOTIFICATIONS, result);
    //Load to main
    app.notifications = content;
    app.newNotifications = newcontent;
    FirebaseCrash.log("XX-Alerts parsed with " + newcontent.length() + " news");
}
 
开发者ID:Onelio,项目名称:ConnectU,代码行数:21,代码来源:HomeRequest.java

示例6: sessionCreate

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
void sessionCreate() {
    FirebaseCrash.log("02-Creating login");
    final LoginRequest login = new LoginRequest(this);
    login.createSession(new LoginRequest.LoginCallback() {
        @Override
        public void onLoginResult(boolean onResult, String message) {
            if (onResult) {
                LauncherActivity.this.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        if (app.loadUser()) {
                            //Continue to login
                            login.loginAccount(app.account.getEmail(), app.account.getPassword(), onUserLogin);
                        } else {
                            //Do first login
                            FirebaseCrash.log("03-Requesting first login");
                            requestLogin();
                        }
                    }
                });
            } else {
                //Error login in
                ErrorManager error = new ErrorManager(layout);
                if (!error.handleError(message)) {
                    Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show();
                    FirebaseCrash.report(new Exception("**Exception making session: " + message));
                }
            }
        }
    });
}
 
开发者ID:Onelio,项目名称:ConnectU,代码行数:32,代码来源:LauncherActivity.java

示例7: doMainWork

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
void doMainWork() {
    FirebaseCrash.log("05-Login completed");
    //Start loading data
    if (UpdaterHelper.isFirstLauncher(app.lastUpdateTime)) { //Update first time data
        undefProg.setVisibility(View.INVISIBLE);
        Picasso.with(getBaseContext())
                .load(app.account.getPictureURL())
                .error(R.drawable.ic_placeholder)
                .into(profile, new com.squareup.picasso.Callback() {
                    @Override
                    public void onSuccess() {
                        rlayout.setVisibility(View.VISIBLE);
                    }

                    @Override
                    public void onError() {
                        rlayout.setVisibility(View.VISIBLE);
                    }
                });
        //Normal Update
        Intent intent = new Intent(this, UAUpdate.class);
        intent.putExtra(Common.INTENT_KEY_UPDATE_TYPE, Common.UAUPDATE_TYPE_NORMAL);
        startService(intent);
    } else {
        //Everything is OK
        completeAccess();
    }

}
 
开发者ID:Onelio,项目名称:ConnectU,代码行数:30,代码来源:LauncherActivity.java

示例8: log

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
public static void log(String message) {
    FirebaseCrash.log(message);
}
 
开发者ID:gejiaheng,项目名称:Protein,代码行数:4,代码来源:FirebaseCrashUtils.java

示例9: log

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
@Override
public void log(String message) {
  FirebaseCrash.log(message);
}
 
开发者ID:ashdavies,项目名称:eternity,代码行数:5,代码来源:FirebaseLogger.java

示例10: log

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
public static void log(String s) {
    FirebaseCrash.log(s);
}
 
开发者ID:gigabytedevelopers,项目名称:FireFiles,代码行数:4,代码来源:CrashReportingManager.java

示例11: log

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void log(String message)
{
    FirebaseCrash.log(message);
}
 
开发者ID:mk-5,项目名称:gdx-fireapp,代码行数:9,代码来源:Crash.java

示例12: LogException

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
@Override public void LogException(String exception) {
    FirebaseCrash.log(exception);
}
 
开发者ID:riteshakya037,项目名称:Wallpapers-Android-Clean-Architecture,代码行数:4,代码来源:FirebaseTracker.java

示例13: onReceive

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    Bundle bundle = intent.getExtras();
    String message = (String)bundle.get(Common.INTENT_KEY_ERROR);
    UAUpdate.YearDataLoc num = (UAUpdate.YearDataLoc)bundle.get(Common.INTENT_KEY_LOC);
    if (bundle != null) {
        int resultCode = bundle.getInt(Common.INTENT_KEY_RESULT);
        if (resultCode == RESULT_FIRST_USER) {
            //Completed
            ltext.setText(getString(R.string.completed));
            profile.setImageResource(R.drawable.ic_accept_green);
            completeAccess();
        } else if (resultCode == RESULT_OK) {
            //Continue
            switch(num) {
                case YEARS:
                    ltext.setText(getString(R.string.loading1));
                    break;
                case C_DOSENCIA:
                    ltext.setText(getString(R.string.loading2));
                    break;
                case C_EVALUACION:
                    ltext.setText(getString(R.string.loading3));
                    break;
                case C_EXAMENES:
                    ltext.setText(getString(R.string.loading4));
                    break;
                case C_FESTIVOS:
                    ltext.setText(getString(R.string.loading5));
                    break;
            }
        }else {
            //Failed
            unregisterReceiver(receiver);
            profile.setImageResource(R.drawable.ic_cancel_red);
            ltext.setText(getString(R.string.app_name_error));
            ErrorManager error = new ErrorManager(LauncherActivity.this);
            if (!error.handleError(message)) {
                FirebaseCrash.log("Falied doing normal update in " + num.name());
                FirebaseCrash.log(message);
                FirebaseCrash.report(new Exception("Normal Update Error"));
                Toast.makeText(getBaseContext(), getString(R.string.error_problem_service) + " " + num.name(), Toast.LENGTH_LONG).show();
            }
        }
    }
}
 
开发者ID:Onelio,项目名称:ConnectU,代码行数:47,代码来源:LauncherActivity.java

示例14: userSearchForNews

import com.google.firebase.crash.FirebaseCrash; //导入方法依赖的package包/类
void userSearchForNews() {
    String title = "ConnectU";
    String text = getString(R.string.notifi_more_text);
    if (app.newNotifications.length() == 1) {
        //One new alert
        try {
            String jdata = app.newNotifications.getJSONObject(0).toString();
            Gson gson = new Gson();
            NotificationData data = gson.fromJson(jdata, NotificationData.class);
            //Set title
            title = data.getTitle();
            if (data.getTitle().isEmpty()) {
                title = data.getType();
            }
            //Set text
            text = data.getText();
        } catch (JSONException e) {
            FirebaseCrash.log(app.newNotifications.toString());
            FirebaseCrash.report(e);
            title = "Error";
            text = "Error";
        }
    } else if (app.newNotifications.length() > 1) {
        //More than one alert
        title = getString(R.string.notifi_more_title_have) + " " + String.valueOf(app.newNotifications.length()) + " " + getString(R.string.notifi_more_title_more);
        text = getString(R.string.notifi_more_text);
    }
    if (app.newNotifications.length() != 0) {

        Intent notificationIntent = new Intent(getBaseContext(), LauncherActivity.class);
        notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
        PendingIntent intent = PendingIntent.getActivity(getBaseContext(), 0, notificationIntent, 0);
        Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);

        boolean display = app.getPublicPreferenceB(Common.GLOBAL_SETTING_NOTIFICATIONDISPLAY);

        Notification notif;
        if (display) {
            notif = new android.support.v7.app.NotificationCompat.Builder(getBaseContext())
                    .setAutoCancel(true)
                    .setContentTitle(title)
                    .setContentText(text)
                    .setSmallIcon(R.drawable.icon)
                    .setGroup(Common.GROUP_KEY_ALERTS)
                    .setContentIntent(intent)
                    .setVibrate(new long[]{500, 500, 500, 500, 500})
                    .setLights(Color.BLUE, 3000, 3000)
                    .setSound(alarmSound)
                    .build();
        } else {
            notif = new android.support.v7.app.NotificationCompat.Builder(getBaseContext())
                    .setAutoCancel(true)
                    .setContentTitle(title)
                    .setContentText(text)
                    .setSmallIcon(R.drawable.icon)
                    .setGroup(Common.GROUP_KEY_ALERTS)
                    .setContentIntent(intent)
                    .build();
        }

        NotificationManagerCompat notificationManager = NotificationManagerCompat.from(getBaseContext());
        notificationManager.notify(0, notif);

        //end service
        UAService.this.stopSelf();
    }
}
 
开发者ID:Onelio,项目名称:ConnectU,代码行数:68,代码来源:UAService.java


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