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
    ================================================

Комментарии • 101

  • @Cubixsolution
    @Cubixsolution  4 года назад

    ANY CAPTION ABOUT Tutorial

  • @شيلات-ي2ه
    @شيلات-ي2ه 4 года назад +1

    Facu man you the best i love you 😎🤜🤛

  • @skrillexsn
    @skrillexsn 4 года назад +3

    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?

  • @dhakshnamoorthy8673
    @dhakshnamoorthy8673 4 года назад +1

    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.

  • @statusmemesentertaintment7048
    @statusmemesentertaintment7048 3 года назад +1

    here some error in datasnapshot

  • @iraqiiraqi-w8w
    @iraqiiraqi-w8w 4 года назад +4

    what if i want it to show me the newest one in the top . from the newest tho the previous?

  • @rajkumarrupapara8221
    @rajkumarrupapara8221 4 года назад +2

    Abe e kay sab hey sab ka sab galat hey 😂😂😂😂😂

    • @Cubixsolution
      @Cubixsolution  4 года назад

      Thanks for your feedback. Please tell us how can i correct it?

  • @hafsanaeem9325
    @hafsanaeem9325 2 года назад +2

    dataSnapshot gives error

  • @mensaka99
    @mensaka99 Год назад +1

    It doesen't work

    • @Cubixsolution
      @Cubixsolution  Год назад

      Please watch the video again or search your error on stackoverflow or email us whats error you are getting?

  • @nayandas4713
    @nayandas4713 3 года назад +3

    Bro.. good tutorial.. just simple advice.. dont rush.. slow down and make some good tutorial

  • @kamalabaikattimani6994
    @kamalabaikattimani6994 3 года назад +1

    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🙏🙏🙏🙏

  • @ayauthor605
    @ayauthor605 4 года назад +2

    I just have blank page. It did not show the list. Please help me

  • @rioaryas
    @rioaryas 3 года назад +1

    why my DatabaseReference gets red? and when i write firebasedatabase it also red?

  • @BIlalKhan-te6ii
    @BIlalKhan-te6ii 3 года назад +2

    when i add listview my application does't opens even if it's not on the main activity.

  • @mopiko9742
    @mopiko9742 4 года назад +1

    com.google.firebase.database.DatabaseException: Failed to convert value of type java.util.HashMap to String . I spent 2hours checking error.

    • @Cubixsolution
      @Cubixsolution  4 года назад

      Please sorry i did not understand your message.

  • @asfkja9332
    @asfkja9332 2 года назад +2

    Не знаю вашего языка, напишу на Русском) Самое краткое видео, и главное что по сути)) Выражаю вам уважение) Спасибо

  • @newshubwithzaini2928
    @newshubwithzaini2928 4 года назад +2

    plz upload more ....amazing method

    • @Cubixsolution
      @Cubixsolution  4 года назад

      Don't worry, more video it will be upload soon

  • @yuireisingngalung301
    @yuireisingngalung301 3 года назад +1

    How will I fetch list of item VALUE onClick of the list item in another activity??... please help out

    • @Cubixsolution
      @Cubixsolution  3 года назад

      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

  • @subhashkumar5896
    @subhashkumar5896 4 года назад +1

    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 ?

  • @gabrielerandazzo7194
    @gabrielerandazzo7194 2 года назад +1

    How I can add an ImageView?

  • @82682eric
    @82682eric 4 года назад +1

    there's a error with "Failed to convert value of type java.util.HashMap to String" ,How to solve this problem?

  • @clout1743
    @clout1743 4 года назад +2

    it's not retrive data on app plz do something..

    • @Cubixsolution
      @Cubixsolution  4 года назад

      what is the error>

    • @anumaamir3441
      @anumaamir3441 4 года назад

      @@Cubixsolution same plz help me as i ave to submit my project. It is also not showing any error

    • @Cubixsolution
      @Cubixsolution  4 года назад

      @@anumaamir3441 Please explain to me how I can help you?

    • @manalbenchrif2961
      @manalbenchrif2961 4 года назад

      @@Cubixsolution i do the same step but i got an empty activity i, not showing list?????/help please

    • @kingcripto5443
      @kingcripto5443 3 года назад

      @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 .

  • @ginkooo2970
    @ginkooo2970 4 года назад +2

    thank you man

  • @studyonline131
    @studyonline131 3 года назад +1

    can we use the same code that receiving data on realtime , if arduino and firebase + android is connected
    ?

    • @Cubixsolution
      @Cubixsolution  3 года назад

      May be some customization will need i cannot answer it 100%

  • @amirchernin7254
    @amirchernin7254 3 года назад +1

    Hello. How can I show specific user information and not all of it? (For example: just user email)

    • @Cubixsolution
      @Cubixsolution  3 года назад +1

      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

    • @amirchernin7254
      @amirchernin7254 3 года назад +1

      @@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.

  • @Jatinvys
    @Jatinvys 3 года назад +1

    What if I want data from specific child

    • @Cubixsolution
      @Cubixsolution  3 года назад

      Its simple. Then you have to give child path

  • @sanatabasum4599
    @sanatabasum4599 4 года назад +2

    This video is very useful

  • @khadijahh1366
    @khadijahh1366 4 года назад +2

    Amazing video thank you

  • @ridaistikhar4496
    @ridaistikhar4496 4 года назад +1

    very informative video

  • @farahnaz5399
    @farahnaz5399 3 года назад +1

    Why my app is crashed I run the app plz guide me

    • @Cubixsolution
      @Cubixsolution  3 года назад

      I can only help if i will see your code

    • @kingcripto5443
      @kingcripto5443 3 года назад

      @@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) {
      }
      });
      }
      }

    • @hafsanaeem9325
      @hafsanaeem9325 2 года назад

      @@kingcripto5443 same happend to me app crashes and code is the same. did you do anything please let me know

  • @alabri60
    @alabri60 4 года назад +1

    it didnt work with me no error in java but the app go out whe i run it

  • @md.tahiranamtamin8255
    @md.tahiranamtamin8255 4 года назад +1

    can you give the source code in the description link?

    • @Cubixsolution
      @Cubixsolution  4 года назад +1

      source code is lost but we will try to give the source code in next videos.

  • @87nehal
    @87nehal 4 года назад +1

    Data snapshot shows error

    • @Cubixsolution
      @Cubixsolution  4 года назад

      In my case it works i cannot show you the problem with out seeing your screen

  • @mervinlee450
    @mervinlee450 4 года назад +1

    Hello! How can we read from integers? I always get a null value..

    • @Cubixsolution
      @Cubixsolution  4 года назад

      I think you should convert it to interger value first by using parse.int

    • @Nikola1999
      @Nikola1999 2 года назад

      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

  • @muhdfikri4709
    @muhdfikri4709 4 года назад +1

    easy, simple and it works! you save my live bro. may Allah bless you

  • @60_9
    @60_9 4 года назад +1

    how to do the same with a single text view?

  • @opk9526
    @opk9526 4 года назад +1

    nice

  • @Hindu10111
    @Hindu10111 4 года назад +1

    plz upload source code to github

    • @Cubixsolution
      @Cubixsolution  4 года назад +1

      i will try to upload the next videos source code. Please current videos source code is not available

    • @Hindu10111
      @Hindu10111 4 года назад

      @@Cubixsolution ok.

  • @HikayatNoor1
    @HikayatNoor1 4 года назад +1

    thank you babae

  • @rkshorts..70
    @rkshorts..70 4 года назад +1

    Firebase se kese connect kr

    • @Cubixsolution
      @Cubixsolution  4 года назад

      please simply search on youtube its soo simple

  • @bmwchannel24
    @bmwchannel24 4 года назад +1

    where is source code ?

    • @Cubixsolution
      @Cubixsolution  4 года назад

      please we did not upload the source code of this video

    • @bmwchannel24
      @bmwchannel24 4 года назад

      @@Cubixsolution then leave it 😉

  • @kiranmustafa589
    @kiranmustafa589 4 года назад +1

    Your tutorials are very helpful for me. thank you

  • @Sidex150-g1p
    @Sidex150-g1p 3 года назад +2

    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.