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


Java FirebaseCrash类代码示例

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


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

示例1: onOptionsItemSelected

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.invite_menu:
            sendInvitation();
            return true;
        case R.id.crash_menu:
            FirebaseCrash.logcat(Log.ERROR, TAG, "crash caused");
            causeCrash();
            return true;
        case R.id.sign_out_menu:
            mFirebaseAuth.signOut();
            Auth.GoogleSignInApi.signOut(mGoogleApiClient);
            mFirebaseUser = null;
            mUsername = ANONYMOUS;
            mPhotoUrl = null;
            startActivity(new Intent(this, SignInActivity.class));
            finish();
            return true;
        case R.id.fresh_config_menu:
            fetchConfig();
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:firebase,项目名称:friendlychat-android,代码行数:27,代码来源:MainActivity.java

示例2: refreshChange

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
@SuppressWarnings("ResultOfMethodCallIgnored")
private List<Observable<TrainHeader>> refreshChange(Map<Pair<String, String>, String> info) {
    List<Observable<TrainHeader>> o = new LinkedList<>();
    for (Pair<String, String> p : info.keySet()) {
        try {
            Integer.parseInt(p.first);
            Integer.parseInt(p.second);
            Integer.parseInt(info.get(p));
        } catch (NumberFormatException e) {
            view.showSnackbar("Problema di aggiornamento", ENUM_SNACKBAR_ACTIONS.NONE, Snackbar.LENGTH_SHORT);
            Log.e("refreshChange: ", "There are problems with these parameters:", p.first, p.second, info.get(p));
            FirebaseCrash.report(new Exception(("REFRESH CHANGE ERROR There are problems with these parameters:" + p.first + " " + p.second + " " + info.get(p))));
            continue;
        }

        o.add(APINetworkingFactory.createRetrofitService(JourneyService.class)
                .getDelay(p.first,
                        p.second,
                        info.get(p))
                .observeOn(AndroidSchedulers.mainThread()));
    }
    return o;
}
 
开发者ID:albertogiunta,项目名称:justintrain-client-android,代码行数:24,代码来源:JourneyResultsPresenter.java

示例3: setNickNameToUI

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
private void setNickNameToUI(DatabaseReference databaseReference, FirebaseUser firebaseUser) {
    databaseReference.child("users")
            .child(firebaseUser.getUid())
            .addValueEventListener(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {
                    // Update the android UI
                    setNickNameToUI(dataSnapshot.getValue(User.class).getNickName());
                }

                @Override
                public void onCancelled(DatabaseError databaseError) {
                    Log.e(TAG, "Database Error Occurred", databaseError.toException());
                    FirebaseCrash.report(databaseError.toException());
                }
            });
}
 
开发者ID:moizalicious,项目名称:Forager,代码行数:18,代码来源:AccountSettings.java

示例4: setNumberOfMushroomsToUI

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
private void setNumberOfMushroomsToUI(DatabaseReference databaseReference, FirebaseUser firebaseUser) {
    databaseReference.child("users")
            .child(firebaseUser.getUid())
            .addValueEventListener(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {
                    // Update the android UI
                    setNumberOfMushroomsToUI(dataSnapshot.getValue(User.class).getNumberOfMushrooms());
                }

                @Override
                public void onCancelled(DatabaseError databaseError) {
                    Log.e(TAG, "Database Error Occurred", databaseError.toException());
                    FirebaseCrash.report(databaseError.toException());
                }
            });
}
 
开发者ID:moizalicious,项目名称:Forager,代码行数:18,代码来源:AccountSettings.java

示例5: setNumberOfPointsToUI

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
private void setNumberOfPointsToUI(DatabaseReference databaseReference, FirebaseUser firebaseUser) {
    databaseReference.child("users")
            .child(firebaseUser.getUid())
            .addValueEventListener(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {
                    // Update the android UI
                    setNumberOfPointsToUI(dataSnapshot.getValue(User.class).getNumberOfPoints());
                }

                @Override
                public void onCancelled(DatabaseError databaseError) {
                    Log.e(TAG, "Database Error Occurred", databaseError.toException());
                    FirebaseCrash.report(databaseError.toException());
                }
            });
}
 
开发者ID:moizalicious,项目名称:Forager,代码行数:18,代码来源:AccountSettings.java

示例6: setDistanceRemainingToUI

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
private void setDistanceRemainingToUI(final DatabaseReference databaseReference, FirebaseUser firebaseUser) {
    databaseReference.child("global")
            .child("distanceRemaining")
            .addValueEventListener(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {
                    // Update the android UI
                    setDistanceRemainingToUI(dataSnapshot.getValue(Long.class).intValue());
                }

                @Override
                public void onCancelled(DatabaseError databaseError) {
                    Log.e(TAG, "Database Error Occurred", databaseError.toException());
                    FirebaseCrash.report(databaseError.toException());
                }
            });
}
 
开发者ID:moizalicious,项目名称:Forager,代码行数:18,代码来源:Community.java

示例7: subtractFromDistanceRemaining

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
private void subtractFromDistanceRemaining(final DatabaseReference databaseReference, FirebaseUser firebaseUser) {
    databaseReference.child("global")
            .child("distanceRemaining")
            .addListenerForSingleValueEvent(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {
                    // Update the database
                    subtractFromDistanceRemaining(databaseReference, (dataSnapshot.getValue(Long.class).intValue() - 1));
                }

                @Override
                public void onCancelled(DatabaseError databaseError) {
                    Log.e(TAG, "Database Error Occurred", databaseError.toException());
                    FirebaseCrash.report(databaseError.toException());
                }
            });
}
 
开发者ID:moizalicious,项目名称:Forager,代码行数:18,代码来源:StartGame.java

示例8: addMushroomToDatabase

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
private void addMushroomToDatabase(final DatabaseReference databaseReference, final FirebaseUser firebaseUser) {
    databaseReference.child("users")
            .child(firebaseUser.getUid())
            .addListenerForSingleValueEvent(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {
                    // Update the cloud database
                    addMushroomToDatabase(databaseReference, firebaseUser, (dataSnapshot.getValue(User.class).getNumberOfMushrooms() + 1));
                }

                @Override
                public void onCancelled(DatabaseError databaseError) {
                    Log.e(TAG, "Database Error Occurred", databaseError.toException());
                    FirebaseCrash.report(databaseError.toException());
                }
            });
}
 
开发者ID:moizalicious,项目名称:Forager,代码行数:18,代码来源:StartGame.java

示例9: addPointToDatabase

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
private void addPointToDatabase(final DatabaseReference databaseReference, final FirebaseUser firebaseUser) {
    databaseReference.child("users")
            .child(firebaseUser.getUid())
            .addListenerForSingleValueEvent(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {
                    // Update the cloud database
                    addPointToDatabase(databaseReference, firebaseUser, (dataSnapshot.getValue(User.class).getNumberOfPoints() + 1));
                }

                @Override
                public void onCancelled(DatabaseError databaseError) {
                    Log.e(TAG, "Database Error Occurred", databaseError.toException());
                    FirebaseCrash.report(databaseError.toException());
                }
            });
}
 
开发者ID:moizalicious,项目名称:Forager,代码行数:18,代码来源:StartGame.java

示例10: testIfAppUpdateIsRequired

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
private void testIfAppUpdateIsRequired() {
    firebaseRemoteConfig.fetch()
            .addOnCompleteListener(this, new OnCompleteListener<Void>() {
                @Override
                public void onComplete(@NonNull Task<Void> task) {
                    if (task.isSuccessful()) {
                        firebaseRemoteConfig.activateFetched();
                    } else {
                        FirebaseCrash.report(task.getException());
                    }

                    if (firebaseRemoteConfig.getBoolean(Constants.APP_UPDATE_KEY)) {
                        showUpdateDialog();
                    } else {
                        startActivity(new Intent(PreChecksActivity.this, NavigationDrawerActivity.class));
                        finish();
                    }
                }
            });
}
 
开发者ID:Protino,项目名称:CodeWatch,代码行数:21,代码来源:PreChecksActivity.java

示例11: 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

示例12: 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

示例13: firebaseAuthWithGoogle

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
    Log.d(TAG, "firebaseAuthWithGooogle:" + acct.getId());
    AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
    showProgressDialog(getString(R.string.profile_progress_message));
    mAuth.signInWithCredential(credential)
            .addOnSuccessListener(this, new OnSuccessListener<AuthResult>() {
                @Override
                public void onSuccess(AuthResult result) {
                    handleFirebaseAuthResult(result);
                }
            })
            .addOnFailureListener(this, new OnFailureListener() {
                @Override
                public void onFailure(@NonNull Exception e) {
                    FirebaseCrash.logcat(Log.ERROR, TAG, "auth:onFailure:" + e.getMessage());
                    handleFirebaseAuthResult(null);
                }
            });
}
 
开发者ID:firebase,项目名称:friendlypix-android,代码行数:20,代码来源:ProfileActivity.java

示例14: 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

示例15: createService

import com.google.firebase.crash.FirebaseCrash; //导入依赖的package包/类
/**
 * Method returns a Call<S> to perform retrofit operations on
 * Should be called in an Async Task/Thread to avoid network calls on main thread exceptions
 * <br/>
 * @param serviceClass Any interface with @Call<T> return types
 * @param mContext Usual context object
 * <br/>
 * @return Retrofit Class from the serviceClass param
 */
public static <S> S createService(@NonNull Class<S> serviceClass, Context mContext) {
    try {
        if ((mToken = TokenReference.getInstance()) == null || mToken.getExpires() < (System.currentTimeMillis()/1000L))
            mToken = new TokenReference(mContext).reInitInstance();
        if(httpClient.interceptors().size() < 1) {
            httpClient.addInterceptor(new AuthInterceptor());
        }
    } catch (Exception e) {
        FirebaseCrash.report(e);
        e.printStackTrace();
    }
    if(ani_ret == null)
        ani_ret = builder.client(httpClient.build()).build();
    return ani_ret.create(serviceClass);
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:25,代码来源:ServiceGenerator.java


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