Cannot save Data to Firebase from HTC android device! WHY?

Viewed 272

I am saving data to Firebase Realtime Database. When it comes to HTC 820 the data is not sending to Firebase Database.

  1. Everything works fine with Samsung devices from version 4.0 (Ice Cream Sandwich) till 7.0 (Nougat).

  2. Tested an .apk on HTC 10 which has android version 7.0, the app is working and data is saved in Firebase Database.

  3. But, when tested an .apk on HTC 820 it is not saving a data to Firebase Database. To understand the problem, used Log.d() and in Logcat it represented the data which is sending from the device.

Did anyone had similar issue like this?

1 Answers

Please check your Google Play Service before the access to the Firebase to verify if the google play service is updated or if your device is supported or not using this code:

public boolean checkPlayServices() {
    GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
    int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
    if (resultCode != ConnectionResult.SUCCESS) {
        if (apiAvailability.isUserResolvableError(resultCode)) {
            apiAvailability.getErrorDialog(this, resultCode,9000).show();
        } else {
            Log.i("error", "This device is not supported.");
            finish();
        }
        return false;
    }
    return true;
}
Related