How to Retrieve Data From Firebase Database in Android | Android Firebase Part 4

How to Retrieve Data From Firebase Database in Android | Android Firebase Part 4

CodingZest

3 года назад

36,066 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

RAHUL T S
RAHUL T S - 19.10.2022 14:27

Hi sir, i enter almost same code but addValueEventListener is not firing. i share my code here

FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference referenceArea = database.getReference("Area");
referenceArea.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
AreaInfo info = snapshot.getValue(AreaInfo.class);
String Area_Code = info.getAR_CODE();
String Area_Name = info.getArea_Name();

AreaExist = dbMain.hasObjectArea(Integer.parseInt(Area_Code));
if (AreaExist == false && !Area_Name.trim().equals("")) {
dbMain.addArea(Integer.parseInt(Area_Code), Area_Name);
}
}
}

@Override
public void onCancelled(@NonNull DatabaseError databaseError) {

}
});

Ответить
Bhai Tera worrior
Bhai Tera worrior - 20.05.2022 19:46

Retrieve data wala button kab add kiya home screen pe??

Ответить
Rahul Ramchandani
Rahul Ramchandani - 12.01.2022 01:18

What if i want to retrieve data of a particular student?

Ответить
Ren Ji
Ren Ji - 19.12.2021 15:56

why its keep on crashing? didn't show the data on list view and afterwards it crash.

Ответить
shaufi sopie
shaufi sopie - 19.12.2021 10:54

hello sir can u show me ur activity main activity java.
i have built some intent but the code cant run.

help me cause i need to teach my student.tq sir

Ответить
Caner Altuner
Caner Altuner - 05.10.2021 18:38

Thank you so much, it was helped me a lot

Ответить
Ganesh_Janapati Creations
Ganesh_Janapati Creations - 01.10.2021 07:37

inserting data suceessfull. But Data not retrievinng

Ответить
Abhinav Singh
Abhinav Singh - 30.08.2021 20:06

Please help sir

Ответить
Abhinav Singh
Abhinav Singh - 30.08.2021 20:06

Dude you are perfect but actually I am not able to show the data

Ответить
Tips Codes
Tips Codes - 29.07.2021 20:13

I have a problem with my apps, but a follow all of your tutorial. But my apps keep crashing when i try to retrieve data from firebase.. but the data has been uploaded to firebase. But its crash when you go to retrieve activity. Please help me sir

Ответить
Lovemore panashe Matiyenga
Lovemore panashe Matiyenga - 19.07.2021 17:31

sir how can l retrieve data to a fragment layout

Ответить
The Gaming Profile
The Gaming Profile - 04.07.2021 19:48

you never showed to make the button that gets the information

Ответить
Aina Afifah
Aina Afifah - 03.07.2021 10:16

Good day, sir, I have a problem retrieving the data, can you help me out? the list view is displayed but the data from database did not appear

Ответить
Efath Ferdush
Efath Ferdush - 22.06.2021 23:45

what is your OS?

Ответить
SOUL GAMING YT
SOUL GAMING YT - 09.06.2021 06:44

where is source code

Ответить
Aida Nurul
Aida Nurul - 08.06.2021 22:02

hi ...how can i display it in textview? please help me

Ответить
Shah Khalid
Shah Khalid - 01.06.2021 18:33

AOA
Sir please make a video how to retrieve data from two nodes or table from firebase android

Ответить
Ahmad Irfan Ismail
Ahmad Irfan Ismail - 31.05.2021 10:15

Hello Please help me! i have an error datasnapshot. i have been follow your coding but the app crash

Ответить
Muhammad sufyan
Muhammad sufyan - 31.05.2021 08:17

help me sir plz

Ответить
Muhammad sufyan
Muhammad sufyan - 31.05.2021 08:16

sir i found error

Ответить
prajwal maddy
prajwal maddy - 26.05.2021 11:58

Working Thank you!!!

Ответить
bivishan dhungana
bivishan dhungana - 18.05.2021 11:36

oh brother, i was wondering for 2 days to find bug in my app. you just help me. cant explain how much glad i am.

Ответить
Kavindu Wijethunga
Kavindu Wijethunga - 01.05.2021 19:21

how can get retrieve button and how will do click the retrieve button and get those data? you don't show it in your video. please can you explain it?I'm in trouble in that

Ответить
Shashika Nuwan
Shashika Nuwan - 24.04.2021 20:18

Hi ! I done Exactly what you done . But Page is Empty no errors ?

Ответить
mehra__323
mehra__323 - 21.04.2021 15:11

Sir button retrieve data pa set on click listener nhi lagaya

Ответить
Jaydeep Patel
Jaydeep Patel - 17.04.2021 12:06

how to retrive data for speacific user in EditTextView

Ответить
Balib Ramzi
Balib Ramzi - 11.04.2021 10:08

Hi sir! How to retrieve video + thumbnail from real time database in android studio?

Ответить
zainab jafar hussain
zainab jafar hussain - 07.04.2021 11:33

Not being able to view data....and activity gets closed after few seconds.

Error: skipped 11 frames. To much work done in main thread

Plz help with this

Ответить
saraswathi kumaran
saraswathi kumaran - 01.04.2021 12:53

Flow of explaining is excellent 🔥 thank you for sharing your knowledge 😁

Ответить
Sammii
Sammii - 29.03.2021 14:42

When I retrieve data my activity exit ,there is no error shown in error logs too. What is the problem

Ответить
Sammii
Sammii - 29.03.2021 11:04

Thank you for this , how can we retrieve firebase data in table layout or tableview ?

Ответить
Hasini Sewwandi
Hasini Sewwandi - 22.03.2021 10:42

How can create Retrive button

Ответить
Venkatesh M
Venkatesh M - 03.03.2021 23:08

Hii... I want to add Buttons and Textview togather in a childnode called user_id
Example:

Myproject3665
|
Users
|
user_id_1 (edittext)
| |
| Status:"comment" ( Textwiew)
| Status:"comment" ( Textwiew)
| Value:"0" Or "1" (Button)
| Value:"0" Or "1" (Button)
user_id_2 (edittext)
| |
| Status:"comment" ( Textwiew)
| Status:"comment" ( Textwiew)
| Value:"0" Or "1" (Button)
| Value:"0" Or "1" (Button)
Am unable to create this pattern in my android app with button and text view..i want to read and write my data in real-time database..... help me

Ответить
hamidreza095 ferdosei095
hamidreza095 ferdosei095 - 23.02.2021 16:42

nice

Ответить
nahid sonix
nahid sonix - 10.02.2021 21:13

thank you very much for sharing your knowledge,

Ответить
IfDef EndIf
IfDef EndIf - 06.02.2021 22:34

Exellent tutorial but where is the part where you create the Retrieve button. So the main activity can use the setOnclickLister and how to call the function.
Thanks for the tut.

Ответить
Prem Repal
Prem Repal - 31.01.2021 10:29

Sir I have error in dataSnapshot ...pls help

Ответить
Chris Hayes
Chris Hayes - 28.01.2021 20:27

I'm pretty confused about what exactly a snapshot is and can't find a clear answer. Does it contain all the data of an element and its children? I'm building an Android app and wondering, if I took a snapshot of a parent that was small in size but had 10,000 children, would it download the ALL of that data to the user's phone, even though most of it will be irrelevant? Thank you.

Ответить
Ali Gujjar
Ali Gujjar - 25.01.2021 01:24

Hellow Sir it will not show my data to me I code line by line as you

Ответить
Madushanka Wickramasingha
Madushanka Wickramasingha - 18.01.2021 20:29

Pls Help

Error = java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference

Code = public class RetreiveListAdapter extends ArrayAdapter {

private Activity mContext;
List<Info> infoList;

public RetreiveListAdapter(Activity mContext, List<Info> infoList) {
super(mContext, R.layout.activity_list_view_info, infoList);
this.mContext = mContext;
this.infoList = infoList;

}

@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {

LayoutInflater inflater = mContext.getLayoutInflater();
View listItemView = inflater.inflate(R.layout.activity_list_view_info, null, true);

TextView textView1 = listItemView.findViewById(R.id.textView1);
TextView textView2 = listItemView.findViewById(R.id.textView2);
TextView imageView = listItemView.findViewById(R.id.imageView);

Info info = infoList.get(position);

textView1.setText(info.getTitle());
textView2.setText(info.getDescription());
imageView.setText(info.getImage());

return listItemView;
}
}

Ответить
Usama Naufer
Usama Naufer - 17.01.2021 22:04

I’m not getting the .getName ? it’s not suggesting, where did the .getName come from?

Ответить
AllinOneGossip
AllinOneGossip - 10.01.2021 08:01

Can you help me please i have everything same what you have done in video, but my data is not visible , and i am not getting the error also please help me

Ответить
funvlogger🥰
funvlogger🥰 - 09.01.2021 20:27

I followed all instructions given here still facing issue...my app is getting close

Ответить
Asyraf Aliff
Asyraf Aliff - 09.01.2021 19:57

Thank you very much. Your video really help me to solve my app problem :). Keep on doing the tutorial.

Ответить