firebase-realtime-database

Firebase : Can't convert object of type java.lang.String to type com.example.g.Model.Cart

我只是一个虾纸丫 提交于 2020-01-30 11:42:24
问题 I had error that said com.google.firebase.database.DatabaseException: Can't convert object of type java.lang.String to type com.example.g.Model.Cart at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.convertBean(com.google.firebase:firebase-database@@16.0.5:423) at com.google.firebase.database.core.utilities.encoding.CustomClassMapper.deserializeToClass(com.google.firebase:firebase-database@@16.0.5:214) at com.google.firebase.database.core.utilities.encoding

Firebase RecyclerView UI not showing [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-30 11:34:05
问题 This question already has answers here : FirebaseListAdapter not pushing individual items for chat app - Firebase-Ui 3.1 (2 answers) Closed 2 years ago . I have been trying to implement firebase ui in my app with recyclerview . I have items on my firebase database which i want to with firebase ui recycler view . So far, i think i have done everything right, however, when i run my app it still shows blank. Any help would be greatly appreciated. public class UsersActivity extends

I am trying to get download url from firebase but it gives me some another link like “com.google.android.gms.tasks.zzu@b9761c8” [duplicate]

↘锁芯ラ 提交于 2020-01-30 11:14:58
问题 This question already has an answer here : Can't get download url from Firebase Storge in Android [duplicate] (1 answer) Closed 2 years ago . I am trying to get download url from firebase but it gives me some another link like "com.google.android.gms.tasks.zzu@b9761c8" 回答1: You need to add listeners when retrieving the url. Please read the documentations taskSnapshot.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { // Got the uri

I am trying to get download url from firebase but it gives me some another link like “com.google.android.gms.tasks.zzu@b9761c8” [duplicate]

∥☆過路亽.° 提交于 2020-01-30 11:10:46
问题 This question already has an answer here : Can't get download url from Firebase Storge in Android [duplicate] (1 answer) Closed 2 years ago . I am trying to get download url from firebase but it gives me some another link like "com.google.android.gms.tasks.zzu@b9761c8" 回答1: You need to add listeners when retrieving the url. Please read the documentations taskSnapshot.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() { @Override public void onSuccess(Uri uri) { // Got the uri

How can I return a value from firebase in Android? [duplicate]

此生再无相见时 提交于 2020-01-30 10:27:53
问题 This question already has answers here : Setting Singleton property value in Firebase Listener (3 answers) Closed 2 years ago . public void getFoodItem( String foodNum) { dbReference=firebaseDatabase.getReference("Food"+foodNum); dbReference.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { FoodItem foodItem = dataSnapshot.getValue(FoodItem.class); Log.d("h", "Gotdata" + foodItem.getImage()); //Data can be taken from here,

How can I return a value from firebase in Android? [duplicate]

陌路散爱 提交于 2020-01-30 10:27:24
问题 This question already has answers here : Setting Singleton property value in Firebase Listener (3 answers) Closed 2 years ago . public void getFoodItem( String foodNum) { dbReference=firebaseDatabase.getReference("Food"+foodNum); dbReference.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { FoodItem foodItem = dataSnapshot.getValue(FoodItem.class); Log.d("h", "Gotdata" + foodItem.getImage()); //Data can be taken from here,

Scroll Recycleview to Top position when activity starts using Linearlayoutmanager

拜拜、爱过 提交于 2020-01-30 10:25:08
问题 I"m retrieving Firebase RealTime Database to my Recycleview Adapter Class . I want to sort the data by date with latest post at top. I'm using llm.setReverseLayout(true); which works but now when activity opens then recycleview automatically scrolls to bottom itself. But I want it to force it to Top. Here is my Code rv.setHasFixedSize(true); LinearLayoutManager llm = new LinearLayoutManager(this); llm.setReverseLayout(true); rv.setLayoutManager(llm); llm.scrollToPositionWithOffset(0, 0); rv

How to make data unreadable once the time indicated on its time stamp has passed?

人走茶凉 提交于 2020-01-29 20:35:33
问题 Let’s say for instance a user writes about an event to the Firebase database, what the user writes has a time stamp attached to it and other users are able to read what was written in a list view using the FirebaseListAdapter. Is there a way to make the data written by the user unreadable once the time on the time stamp has passed? 回答1: There's a big difference here between whether you have a single item, or a list of items. Securing access to a single node If you have a single node like this

Android - Firebase RTDB retrieve and display data

巧了我就是萌 提交于 2020-01-28 11:55:12
问题 Hello I want to retrieve data but I don't see anything get displayed and at the same time my app crashes when I don't have data in my database so at least it seems the connection works. I'm also a beginner in Android Studio. Note: This is a follow-up question from an earlier question. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); Title = findViewById(R.id.tvNoteTitle); text = findViewById(R.id

Polymer + Firebase (Polymerfire): Cannot read property 'push' of undefined': 'this.$.query.ref.push(…)'

孤街浪徒 提交于 2020-01-28 10:15:25
问题 I'm following a Polymer + Firebase tutorial video using the Polymer App Tool Kit (initiated with the polymer CLI). When I try to push data to a Firebase collection, I get the following error: Cannot read property 'push' of undefined' Here's my code (firebase app is initiated in my-app.html with name "firebase-app"): <dom-module id="add-model"> <!-- Defines the element's style and local DOM --> <template> <firebase-auth user="{{user}}" app-name="firebase-app"></firebase-auth> <firebase-query