Posts by Rosário Pereira Fernandes • 1,086 points
75 posts
-
0
votes1
answer145
viewsA: Returning Firebase data in an Array
Instead of using the on('child_added'), use the once('value'): var refTanque1 = db.ref("Dados tanque 1 (Caixa d'agua)"); refTanque1.once('value', function(listaSnapshot) { dataArr = [];…
-
0
votes1
answer803
viewsA: Problems with getDownloadUrl firebase
This method was removed in favor of StorageReference.getDownloadUrl(). This method returns a Task<Uri>. Then you have to add a Istener to the Task to get the downloadUrl:…
-
0
votes1
answer54
viewsA: How to write data to firebase by Ionic without erasing what is already saved?
Try making a push(): create(user: User): Promise<void> { return this.db.object(`/users`) .push(user) .catch(this.handlePromiseError); }
-
0
votes1
answer144
viewsA: how do I search the groups the user participates in Firebase?
If you want to know what are the groups where the user Z1FZPBz9m0T1yg21DBfRgI2bGFO2 participates, you can do: Query query =…
-
3
votes1
answer136
viewsA: Infinite loop while recovering and recording data in Firebase
This is because you are using a ValueEventListener. It is called whenever a change occurs in the Database. This means that whenever you increase the number of votes, it is called again and…
-
0
votes1
answer346
viewsA: Remove Child Firebase
In your delete, you call ref.remove(), but ref was never declared... To remove a Child, you need to indicate what your key is. I suggest you create a function that will receive the key to be removed…
-
0
votes1
answer214
viewsA: Broadcast Receiver with Firebase
You can use the Firebase Cloud Messaging in conjunction with Cloud Functions. Add FCM to Android as shown in the article and create a function that will send notifications. It would look something…
-
1
votes1
answer18
viewsA: Is it possible to use wilcard in firebase hosting?
As it shows the documentation, Firebase Hosting can do redirects. But these redirects only work in the URL (and not in subdomains as you need). For example, you could redirect…
firebaseanswered Rosário Pereira Fernandes 1,086 -
1
votes1
answer322
viewsA: Query in firestore to check item inside a document
I believe that Firebase is unable to execute such query. However, to solve the problem, I suggest you create a collection "People" at the root and put there those same attributes. Also add the…
-
0
votes1
answer126
viewsA: Send photo and recover link to download
Actually it is working yes. But it works asynchronously. I suggest you write data within this method: StorageReference ref; if(filepath != null) { ref =…
-
0
votes1
answer109
viewsA: Null Object Reference when listing data with Firebaserecycleradapter
I don’t see your class listed, but I suppose the line Listadedados.getDados().get(position) is returning null. Instead of passing this to your bind method, pass the Institution you receive on…
-
0
votes1
answer132
viewsA: After recovering the objects with Valueeventlistener the List does not retain the data
The data is not getting lost. They’ve simply never been there. That’s because Firebase reads data asynchronously. Due to asynchronous behavior, the second Log is called before the Arraylist is…
-
1
votes1
answer137
viewsA: How to copy children from one node to another node - Android with Firebase
I suggest you make this copy through a Cloud Function. This is because Cloud Functions run on the Cloud, while your code will run on your device. What if the user closes the app before the copy is…
-
1
votes1
answer777
viewsA: Connect Firebase to Postman
Firebase has a REST API very easy to use. You can take the URL, put in Postman and do your POST. An alternative way to register several products is through Firebase CLI. As demonstrated in this…
-
0
votes2
answers994
viewsA: Recover an image in firebase Storage and display in the app using GLIDE
This is because you are using the incorrect URL. With this URL only you have access to the image. Go to firebase console, and find the image in Storage and click "Generate Download URL", a URL will…
-
0
votes1
answer375
viewsA: What is the best way to generate Push notification using Firebase?
a) Short answer: Topics. Long answer: Single Devices would require you to create your own logic for the user to log in and out of groups. You would have to store each user’s token in a database…
-
0
votes1
answer210
viewsA: Incompatibility of firebase version with google services
You are using a very old version of Firebase and Google Play Services. Update your dependencies in the app’s Gradle: compile 'com.google.android.gms:play-services-maps:15.0.0' compile…
-
1
votes1
answer53
viewsA: Optimize firebase cloud Storage
I suggest you do the getDownloadURL() when you upload the image to Storage. Then you take this url and store it in your database. When you read the data, you will also read the downloadURL. No…
firebaseanswered Rosário Pereira Fernandes 1,086 -
4
votes2
answers551
viewsA: ". read" firebase security rules
So the error is taking a reference from the database because in the directory recipe (/recipe), I have no rule, only on /recipe/key That is absolutely correct! To solve this problem, you can use the…
-
0
votes1
answer133
viewsA: Multi-tenant with firebase
I would recommend that you have 2 nodes: Business and Users. Then when you have a new tenant (a company), you generate a new ID at the Companies node. And you put all the data of that company at…
-
0
votes1
answer57
viewsA: Error of Keys Firebase
Your mistake is documented here: A current registration token may no longer be valid in several situations, such as: If client app canceled registration with FCM. If the client app has the…
-
3
votes1
answer2002
viewsA: How to set up admin user and common user in Firebase
The Firebase Auth allows only 'login' and 'password' as you said, but the Realtime Database and the Cloud Firestore allow you to keep much more than that. When creating a user, store your data in…
-
0
votes1
answer19
viewsA: Is Analytics for Firebase integrated with google Analytics?
Firebase Analytics is the same as Google Analytics. They just took the existing product and included it in Firebase. Unfortunately, there is no separate console for other teams to see the records…
firebaseanswered Rosário Pereira Fernandes 1,086 -
0
votes3
answers106
viewsA: Find the size of the largest sequence of # in an array. JAVA
You reversed the variables i and j in his method output(): if(h.data[j][i]=='#'){ coluna++; } The correct thing is: if(h.data[i][j]=='#'){ coluna++; }…
-
1
votes1
answer195
viewsA: Information balloon in Edittext - Android
You can use a Textwatcher together with a Textinputlayout. In your XML would be: <android.support.design.widget.TextInputLayout android:id="@+id/inputLayoutEmail"…
androidanswered Rosário Pereira Fernandes 1,086 -
1
votes2
answers1479
viewsA: How to delete a specific Child in Firebase?
You will need to read and then delete. Use limitToFirst(), passing the value 1 to catch only the first Child: calendarioRef.limitToFirst(1).addListenerForSingleValueEvent(new ValueEventListener() {…
-
1
votes1
answer1785
viewsA: Definition of firebase security rules
1.To verify if the logged-in user is the user who registered the revenue, the variable is used auth.uid and the newData (in the case of writing) or data (in reading). That would be: "receitas":{…
-
1
votes1
answer176
viewsA: Persist data from Storage Firebase
I see that you are using Picasso to show the image on the screen. The Picasso library can persist the image on the device, but to do this you will need to add one more dependency (Okhttp) and some…
-
1
votes1
answer1074
viewsA: Pick up child object - firebase
Well, let’s go in pieces. First: Find all users' recipes The way you structured your data, you can’t find all the recipes. I suggest you change the data structure to have a "recipes" node and a…
-
2
votes1
answer464
viewsA: Icon rounded android studio
The Round Icon was introduced in version 7.1 (Nougat) of Android. When devices using this version of Android need to show the icon of their application, they will search for the android:icon or…
-
1
votes1
answer457
viewsA: How many projects can I have in firebase?
Check out Frank’s comment in this matter. Frank is one of the Firebase Engineers. He says: There’s no limit on the number of Projects in general, but there is a limit on the number of Projects on an…
firebaseanswered Rosário Pereira Fernandes 1,086 -
1
votes1
answer2021
viewsA: ref() or Child() when reading firebase web data
The 2 are methods of different classes, but return the same thing: a Reference. The ref() is of class Database and the child() class Reference. Let’s see how these methods work: ref() - returns a…
-
2
votes1
answer371
viewsA: Delete firebase web folder
To documentation says the method delete() serves only to delete files. It is not yet possible to delete folders as this indicates firebase-talk forum.…
-
1
votes1
answer501
viewsA: Sort firebase list
My recommendation is: save the image downloadURL in the bank when you save the image in Storage. So your object would be, for example: "exemploObj":{ "nome":"nomeAqui",…
-
0
votes1
answer82
viewsA: Doubt Cloud Function
Yes, the Cloud Functions executes Nodejs code. And you can import any npm package. But what happens is that on Firebase’s Spark (free) plan, you can only access Google’s services. If you want to use…
-
1
votes1
answer185
viewsA: Expandablelistview - change background color of header title group
In his method getGroupView() add line to change background color: if (convertView == null) { LayoutInflater infalInflater = (LayoutInflater)…
-
1
votes1
answer77
viewsA: Which method can I use to make a ticket layout?
This layout pleases you? It’s from a library called Ticketview. It works from API 15 up. You just have to add in your Gradle: dependencies { implementation 'com.vipulasri:ticketview:1.0.4' } And use…
androidanswered Rosário Pereira Fernandes 1,086 -
0
votes1
answer52
viewsA: How to use ""Quickcontactbadge" by passing a number to the "assignContactFromPhone" method per parameter?
This happens because the moment you call the assignContactFromPhone(), Edittext is still empty. Add a button to your activity_main.xml file. So you click on it to call assignContactFromPhone() (but…
-
0
votes1
answer24
viewsA: Receive information on the home page
You can create a unordered list in your HTML: <form onsubmit = "return a();"> <input type = "text" id = "name"> <input type = "text" id = "message"> <input type = "submit">…
-
0
votes1
answer221
viewsA: Recover Data from Firebase with Multiple Child
You are initiating the Adapter several times within the cycle forEach. Start only once when the cycle ends: databaseReference.child(user.getUid()).child("Protocolos").child("aqui preciso por a…
-
0
votes1
answer56
viewsA: Error while trying to run the application with Gluon Mobile using Gradle build
The error is clear: Please apply google-services plugin at the bottom of the build file. Means you have to put this dependency at the end of the file: buildscript { repositories { jcenter() }…
-
2
votes1
answer585
viewsQ: Firebase data reading always returns null
I’m trying to read data from users who are saved in Firebase, through an Android application. I’m always having null in Textviews, but I see the value in Android Studio’s Logcat. I’ve checked my…
-
3
votes1
answer585
viewsA: Firebase data reading always returns null
The reason the method of creating User works (and read not) is: Firebase reads data asynchronously. This means that the data reading is passed to another Thread (I will call it Secondary Thread)…
-
4
votes1
answer1007
viewsA: Android - What is the difference between getReadableDatabase() and getWritableDatabase()?
According to the documentation, the getReadableDatabase(): Create and/or open a database. This will be the same Object returned by getWritableDatabase() unless some problem, such as a full disk,…
-
0
votes1
answer171
viewsA: How do I call a method within a loop?
As Diego said: the 2nd function works asynchronously. When you return the array of values, it has not yet been initialized. You will need to place the function 2 body in function 1:…
-
0
votes1
answer53
viewsA: Data returns after view presentation
This is because Firebase performs the readings asynchronously. This means that when you return to the Shopping List, it has not yet been initialized. Do not create a separate class for the…
-
0
votes1
answer43
viewsA: Notification does not appear in "Assisant" in Firebase
Firebase Notifications works through the Cloud Messaging you can find in Firebase Assistant: Find more details on documentation.…
firebaseanswered Rosário Pereira Fernandes 1,086 -
0
votes2
answers541
viewsA: Problem in recovering data from firebase
For the IDE not to show the syntax error, you only need to declare the variable usuario globally in the class, rather than declaring locally in the method: public class FireBaseDB{ private…
-
0
votes1
answer849
viewsA: Firebase database modeling: n:n relations
But what if I want to know all events that a certain user participates. As I would? You can make a query without having to change its structure. For example, to see all the events David participates…
-
1
votes1
answer956
viewsA: Delete firebase record
You can add your key to your class, but not store that key in the database. Because if you do, the key will take up more space in your database and will be a (unnecessary) repetition of the key that…