Tag firebase

[Solved] How can i make the app work offline with Firebase database

Simply activate offline persistens as specified in the official documentation: Firebase applications work even if your app temporarily loses its network connection. You can enable disk persistence with just one line of code: FirebaseDatabase.getInstance().setPersistenceEnabled(true); solved How can i make the…

[Solved] App crashes when registration button is pressed

email and password should not be null or empty String email = mEmail.getText().toString(); String password = mPassword.getText().toString(); if(email.isEmpty() || password.isEmpty()) return; //you need to display message to the user mAuth.createUserWithEmailAndPassword(email, password) .addOnCompleteListener(CustomerLoginActivity.this, new OnCompleteListener<AuthResult>() { … }) solved App crashes…

[Solved] How to resolve method getDownloadUrl() [duplicate]

Try this: filepath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { //Do what you need to do with the URL } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception exception) { // Handle any errors } }); 0 solved How…

[Solved] how can i get the count of key , value pair in firebase? [closed]

you can count children this way. databaseRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { for (DataSnapshot snap: dataSnapshot.getChildren()) { Log.e(snap.getKey(),snap.getChildrenCount() + “”); } } @Override public void onCancelled(DatabaseError databaseError) { } }); 1 solved how can i get the…

[Solved] how to integrate firebase performance monitoring in Android [closed]

1. Go to project level build.gradle and add buildscript { repositories { jcenter() mavenLocal() google() } dependencies { //Your gradle version example classpath ‘com.android.tools.build:gradle:3.1.3’ //play services plugin example classpath ‘com.google.gms:google-services:3.2.0’ classpath ‘com.google.firebase:firebase-plugins:1.1.5’ // NOTE: Do not place your application dependencies…

[Solved] save text message in Shared Preferences [duplicate]

I don’t see why you would like to do that, but sure. If saving to SharedPrefs is all you want, it’s quite straight forward SharedPreferences sharedPref = getPreferences(Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPref.edit(); editor.putString(“yourMessageKey”, message); editor.commit(); And of course, to read…

[Solved] How to get specific document data from firebase and return as a string

It works for me Widget build(BuildContext context) { return new StreamBuilder( stream: Firestore.instance.collection(‘COLLECTION_NAME’).document(‘TEST’).snapshots(), builder: (context, snapshot) { if (!snapshot.hasData) { return Center(child: CircularProgressIndicator()); } var userDocument = snapshot.data; return new Text(userDocument[“property_name”]); } ); } 1 solved How to get specific…

[Solved] Retrieving location every 5 seconds

In a nutshell: LocationRequest locationrequest = LocationRequest.create(); locationrequest.setInterval(5000); // 5 seconds LocationClient locationclient = new LocationClient(this, this, this); locationclient.requestLocationUpdates(locationrequest, this); In this link, it is suggested that you use the new Google Play services location APIs. But they have…