How to retrieve data from Firebase Realtime database to a Listview. Android Studio Tutorial
HTML-код
- Опубликовано: 29 сен 2024
- In this video, I am going to show you how to retrieve data from the firebase real-time database to a list view. I hope you must enjoy this tutorial because most tutorials are for beginners this is also an android studio tutorial for beginners
Donate me:
Paypal: paypal.me/fine....
Binance Pay ID: 253333352
==============================
Follow us Links:
Instagram: / fine_gap
Facebook: / cubixsol
Linkedin: / cubixsol
Whatsapp: +923233151852
================================================
ANY CAPTION ABOUT Tutorial
Yes, great and simple ^_^
Caption: clean
Facu man you the best i love you 😎🤜🤛
i love you to.
I have spend 4 days looking for a tutorial, that can show me how to retreive text from Firebase to my app, I have watched more than 15 tutorials, read hundred of forum pages, with no success, and yesterday I watched a 45 min tutorial and it gave me bunch of erreur, till today, I gave it a shot with your tutorial, and first try it work, thank you so much for this.
I have one question if I want to desplay only a part of the data for example in page one (Faheem), Page two (Hassan) page three ( Ali) .... etc, is that possible?
yes it is possible
Hey there I'm creating a chat app and I send msg to a child in firebase and I retrieve the msg of others through onDataChange in value event listener but the problem is when I retrieve msg I their particular activity page it works well but when I leave that page and moves to another person chat and comes back to his chat page Im receiving his last chat against due to the value event listener so I have done another way. It is I have deleted the msg from firebase once I have read it from firebase and put an if condition at onDataChange stating if the firebase value is not empty then perform the task inside onDataChange else not . now it works well but when I go back for twice or thrice and comes back the new msg from him is displaying twice or thrice accordingly to me pls help me.
here some error in datasnapshot
whats the error?
change per : snapshop
what if i want it to show me the newest one in the top . from the newest tho the previous?
Abe e kay sab hey sab ka sab galat hey 😂😂😂😂😂
Thanks for your feedback. Please tell us how can i correct it?
dataSnapshot gives error
It doesen't work
Please watch the video again or search your error on stackoverflow or email us whats error you are getting?
Bro.. good tutorial.. just simple advice.. dont rush.. slow down and make some good tutorial
Thanks for the tip
Hi.... Could you tell please.. Sir, i want to play youtube video using Firebase database and dont want to add Video ID in code, i want to add Video ID to database and then get it from there...and play in our app. By using RUclips player View.
Please help me🙏🙏🙏🙏
I just have blank page. It did not show the list. Please help me
too
Please i cannot help you without seeing your console.
why my DatabaseReference gets red? and when i write firebasedatabase it also red?
when i add listview my application does't opens even if it's not on the main activity.
i am using Linear Layout
com.google.firebase.database.DatabaseException: Failed to convert value of type java.util.HashMap to String . I spent 2hours checking error.
Please sorry i did not understand your message.
Не знаю вашего языка, напишу на Русском) Самое краткое видео, и главное что по сути)) Выражаю вам уважение) Спасибо
kindly tell us in english
plz upload more ....amazing method
Don't worry, more video it will be upload soon
How will I fetch list of item VALUE onClick of the list item in another activity??... please help out
You simple have to set on click listener on the list item and pass the unique id of that list as a string in the next page you can retrieve the value of that id by making a database connection to that path
if i press button to retrieve data from firebase and then press the same button again then it retrieve same thing again and again many time when button pressed, how to solve this ?
How I can add an ImageView?
there's a error with "Failed to convert value of type java.util.HashMap to String" ,How to solve this problem?
Use hashmap.getValue()
it's not retrive data on app plz do something..
what is the error>
@@Cubixsolution same plz help me as i ave to submit my project. It is also not showing any error
@@anumaamir3441 Please explain to me how I can help you?
@@Cubixsolution i do the same step but i got an empty activity i, not showing list?????/help please
@Cubix Sol i have this problem , the app crash and close after click in the activity , and i do do the step by step of vídeo .
thank you man
THANKS FOR SUPPORT.
can we use the same code that receiving data on realtime , if arduino and firebase + android is connected
?
May be some customization will need i cannot answer it 100%
Hello. How can I show specific user information and not all of it? (For example: just user email)
In that case we will have that user email in child and we can easily retrive the email of each user in the list view by using a loop and child data path
@@Cubixsolution Thank you! Do you think that there is a way to retrieve different information? I saw you can do getCurrentUser.getEmail(). I added "score" to all of my users, and I'm struggling with retrieving it because there is no getScore() function.
What if I want data from specific child
Its simple. Then you have to give child path
This video is very useful
THANKS FOR SUPPORT
Amazing video thank you
Glad you enjoyed it
very informative video
Why my app is crashed I run the app plz guide me
I can only help if i will see your code
@@Cubixsolution my app crash after click in this activity .
My Code :
public class Drinks extends AppCompatActivity {
ListView myListView;
ArrayList MyArrayList = new ArrayList();
DatabaseReference mRef;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drinks);
final ArrayAdapter MyArrayAdapter = new ArrayAdapter(Drinks.this,android.R.layout.simple_list_item_1,MyArrayList);
myListView = (ListView) findViewById(R.id.ListView1);
myListView.setAdapter(MyArrayAdapter);
mRef = FirebaseDatabase.getInstance().getReference("Main");
mRef.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {
String value = snapshot.getValue(String.class);
MyArrayList.add(value);
MyArrayAdapter.notifyDataSetChanged();
}
@Override
public void onChildChanged(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {
MyArrayAdapter.notifyDataSetChanged();
}
@Override
public void onChildRemoved(@NonNull DataSnapshot snapshot) {
}
@Override
public void onChildMoved(@NonNull DataSnapshot snapshot, @Nullable String previousChildName) {
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
}
@@kingcripto5443 same happend to me app crashes and code is the same. did you do anything please let me know
it didnt work with me no error in java but the app go out whe i run it
you should try to google it
can you give the source code in the description link?
source code is lost but we will try to give the source code in next videos.
Data snapshot shows error
In my case it works i cannot show you the problem with out seeing your screen
Hello! How can we read from integers? I always get a null value..
I think you should convert it to interger value first by using parse.int
I just saw this comment, first check if dataSnapshot.nodeValue != null, then try parsing. Also check if you gave permission on firebase. It could be10000 things
easy, simple and it works! you save my live bro. may Allah bless you
ohhh Thank you soo much
how to do the same with a single text view?
its video will be upload soon
nice
THANKS FOR SUPPORT
plz upload source code to github
i will try to upload the next videos source code. Please current videos source code is not available
@@Cubixsolution ok.
thank you babae
your welcome my babe.
Firebase se kese connect kr
please simply search on youtube its soo simple
where is source code ?
please we did not upload the source code of this video
@@Cubixsolution then leave it 😉
Your tutorials are very helpful for me. thank you
Thanks
Ok, idk why but we need to specify the link of db in this Main Activity Class, till that it won't show anything. Other code is easy to understand bcoz of u and thnx for it.
Ok and 2nd of all GO TO DB and allow READ and WRITE.
Thanks
@@Cubixsolution yeah, thnx for helping by tut too...