firebase-realtime-database

Firebase on Android : DataSnapshot.getChildrenCount() is returning 0

柔情痞子 提交于 2020-01-11 14:42:29
问题 This is my firebase realtime database : users company: "Indifair" image location: "Bangalore" name: "Anupam Singh" name_title_company_location: "Anupam Singh_Engineer_Indifair_Bangalore" number: 956156494 title: "Engineer" This is my code : DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference(); EditText t1 = (EditText) findViewById(R.id.editText10); EditText t2 = (EditText) findViewById(R.id.editText11); EditText t3 = (EditText) findViewById(R.id.editText13); EditText t4

Firebase on Android : DataSnapshot.getChildrenCount() is returning 0

南楼画角 提交于 2020-01-11 14:42:17
问题 This is my firebase realtime database : users company: "Indifair" image location: "Bangalore" name: "Anupam Singh" name_title_company_location: "Anupam Singh_Engineer_Indifair_Bangalore" number: 956156494 title: "Engineer" This is my code : DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference(); EditText t1 = (EditText) findViewById(R.id.editText10); EditText t2 = (EditText) findViewById(R.id.editText11); EditText t3 = (EditText) findViewById(R.id.editText13); EditText t4

How do I make my user student view all the classrooms he/she belong to?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-11 14:19:08
问题 In my web app, there are 2 types of user: Teacher and Student A Teacher can create virtual classrooms and view the students who joined his/her rooms. While Student can join a classroom and should be able to see the classroom he/she joined to. These codes allow the Teacher to create a classroom: function classcreation(q) { var checkcn = document.getElementById('classroomName').value; if(checkcn == "" && checkcn == null){ alert("Empty Class Name!!"); } else { var usuid = generateId(); var

Firebase database deleted when added app

旧城冷巷雨未停 提交于 2020-01-11 14:03:32
问题 Okay, so I am building an app that will go on the play store, it has the facility to add data to the Firebase (it cannot read it). Second app will remain with me, (it wont go on the play store) and it is used to read the data. Now what I did was, lets say the first app has package name : com.example.write and the second has com.example.read . So I went to Firebase, created a project, added an application using the package name com.example.write and setup my first app. Working perfectly, I

Value of variable not changing in observeSingleEvent

瘦欲@ 提交于 2020-01-11 13:40:13
问题 The variable num changes to what I want inside the observeSingleEvent, but just after it changes back to an empty value. How do i get the value of num to change?? var num = Int() FIRDatabase.database().reference().child("menus/Day1").observeSingleEvent(of: .value, with: {(snap) in print(snap) if let snapDict = snap.value as? [String:AnyObject]{ self.num = snapDict["date"] as! Int print(num) //returns the number I want } }) print(num) //Returns an empty value if num == 5 { print("number is 5")

Firebase functions how to send a notification in Android

China☆狼群 提交于 2020-01-11 13:40:06
问题 I want that every time that chat is modified from the firebase database this function is activated "sendNotification" but this error appears: sendNotification ReferenceError: receiverId is not defined at exports.sendNotification.functions.database.ref.onWrite.event (/user_code/index.js:11:29) at cloudFunctionNewSignature (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:105:23) at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:135:20) at /var

Showing empty field while loading cart data

耗尽温柔 提交于 2020-01-11 13:35:26
问题 I am doing a project on a food ordering app. Here,I have added a feature like an user can view their order on nav_order section. But when i click on this section, it can't see any kind of data but blank on cart. Here is my order_layout.xml <?xml version="1.0" encoding="utf-8"?> <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content"

Checking variable faster than while loop is running [closed]

两盒软妹~` 提交于 2020-01-11 13:17:09
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 days ago . I have a Firebase database setup, and a Python script using the pyrebase module that reads a "timer" variable, and a "cancel" variable. The Python script consists mostly of just a while loop that counts down from 10. However, I need the loop to check for the "cancel" variable to change more than

FirebaseListAdapter<> Not Working [duplicate]

自古美人都是妖i 提交于 2020-01-11 13:04:08
问题 This question already has an answer here : Firebase List Adapter Constructor error (1 answer) Closed 2 years ago . I am following this tutorial to create a chat app. This is my displayChatMessages() method: ListView listOfMessages = (ListView)findViewById(R.id.list_of_messages); adapter = new FirebaseListAdapter<ChatMessages>(this, ChatMessages.class, R.layout.message, FirebaseDatabase.getInstance().getReference()) { @Override protected void populateView(View v, ChatMessages model, int

Firebase query methods do not work

帅比萌擦擦* 提交于 2020-01-11 12:52:09
问题 Here is my data tree: "look-twopointo": { "0" { "comment": "Hi" "Text1": "Hello" "Text2": "Bonsoir" "type": "Bonjour" "version": "4.0.6" } } For some reason querying doesn't work. button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { mDatabase = FirebaseDatabase.getInstance().getReference().child("0");// pay attention to the this path reference // Read from the database Query query = mDatabase.child("version")/*.orderByChild("Text1")*/.equalTo("4.0.6")/*.startAt