firebase-realtime-database

Two Android apps and one Firebase database

馋奶兔 提交于 2019-12-24 16:43:08
问题 I need to use one Firebase database for two Android apps. One app will have write access to database and another will have read access to database. These two apps have to be separated. I can't merge them. Can I use one Firebase database for two apps? How? Please guide step by step. I am new to Firebase. 回答1: Well from what I know you can add as many apps as you want for you'r project,just press add app on the FirebaseConsole . You can use different package name or signing key 来源: https:/

Firebase - realtime database set additional value to user throws exception

狂风中的少年 提交于 2019-12-24 16:42:37
问题 I have class User which has additional info, but it is throwing: com.google.firebase.database.DatabaseException: Serializing Collections is not supported, please use Lists instead My code is: User user = new User(Gender.valueOf(mGenderSpinner.getSelectedItem().toString())); Log.d("GENDER", user.getGender().toString()); mFirebaseDatabase.getReference("Users") .child(mAuth.getCurrentUser().getUid()) .setValue(user) The question is how I can still set User.class value or this is not possible?

Firebase - realtime database set additional value to user throws exception

南楼画角 提交于 2019-12-24 16:42:25
问题 I have class User which has additional info, but it is throwing: com.google.firebase.database.DatabaseException: Serializing Collections is not supported, please use Lists instead My code is: User user = new User(Gender.valueOf(mGenderSpinner.getSelectedItem().toString())); Log.d("GENDER", user.getGender().toString()); mFirebaseDatabase.getReference("Users") .child(mAuth.getCurrentUser().getUid()) .setValue(user) The question is how I can still set User.class value or this is not possible?

How to count children in addChildEventListener?

泪湿孤枕 提交于 2019-12-24 15:20:05
问题 My problem is how can I count child nodes in addChildEventListener? The code below work on addValueEventListener and It counts my child correctly but when I use addChildEventListener. It doesn't work. The reason why I used this, is because of this thread: Firebase Android count children/ badge. I tried this but It doesn't work somehow in my code. In this picture, the borrowed books should count as 2 but it returns to 10: This picture shows my database in firebase: . The reason why it returns

Querying user specific data (incl. population) with react-redux-firebase in one compose method

☆樱花仙子☆ 提交于 2019-12-24 14:28:37
问题 i'm working with react-native and have the problem to load only user specific data with firebaseConnect . Imagine there are thousends of todos , users and doers and don't want to reference all elements of them. First of all, a shortcut of my data structure in the real time database: - todos |- cleanRoom | |- createdBy: alica | |- title: "Clean the room up" | |- doerList | |- roomCleanerMichael | |- roomCleanerAlica |- playBall |- createdBy: michael |- title: "Play the ball" |- doerList |-

Three-Way Relationship in Firebase

非 Y 不嫁゛ 提交于 2019-12-24 14:24:30
问题 I've been learning a lot about denormalised data over the past few months, but I wanted to know if the following is possible in a flattened architecture world. I know how to handle two-way relationships in Firebase, but what about a three-way relationship. Let me explain... I have 5 items in my database, services , providers , serviceAtProvider , reviews and users . I want to be able to add providers to services and vice versa. I'd also like there to be a specific page for a provider inside a

How to add data in firebase database

你离开我真会死。 提交于 2019-12-24 14:18:01
问题 I am creating car park app and i want users to enter some information in edit texts before registering. The edit texts are as follows: First Name , Last Name , Email , password , car no . When user hits register button, i want to store these values in firebase database connected to my project.I want to know how to create tables in firebase and how these values will be stored. I am new to programming. 回答1: First retrieve the edittexts: String email = textEmail.getText().toString().trim();

FirebaseException: Failed to bounce to type in Android but Model class properties and JSON properties are same

情到浓时终转凉″ 提交于 2019-12-24 14:15:09
问题 I'm still getting an exception: com.firebase.client.FirebaseException: Failed to bounce to type exception for following line Peoples people = dataSnapshot.getValue(Peoples.class); Peoples object public class Peoples { private String ambition; private String fname; private String lname; private String emailid; Peoples(){ } Peoples(String ambition,String fname,String lname,String emailid){ this.ambition=ambition; this.fname=fname; this.lname=lname; this.emailid=emailid; } public String

Using transactions in Firebase

拥有回忆 提交于 2019-12-24 13:47:02
问题 In my project app I use Firebase Storage and Database simultaneously. I would like to use transactions concept, however I have never used it before so it's not obvious for me. Users are allowed to upload a file to the server. I track these uploads in database (assigning url's of the uploaded file to the user). So I perform 2 actions at the same time: uploading the file updating database I wanna be sure that if any of those actions fails, none is performed (e.g. Internet connection is down). I

Search in firebase database for android?

亡梦爱人 提交于 2019-12-24 12:27:34
问题 project name > users > user1key > name , latitude , longitude user2key > name , latitude , longitude This is the tree in database. I want a query to search the user using its name. and get its details. 回答1: Something like this should do the trick: DatabaseReference ref = FirebaseDatabase.getInstance().getReference("users"); ref.orderByChild("name").equalTo("Yash Mehta").addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) {