firebase-realtime-database

Firebase queries not working on Android even though the reference retrieves data

谁都会走 提交于 2020-07-11 06:51:02
问题 I am trying to filter my Firebase data, my dataset is complex but here is a sample. I am able to retrieve data just fine but I am unable to filter that data any further using the Firebase queries. Here is a sample dataset: Here is my query: private double locStart; private double locEnd; Firebase mRef; Firebase mRef1; mRef = new Firebase("https://test.firebaseio.com/"); mRef1 = mRef.child("test"); final Intent intent = getIntent(); final Inputs inputs = (Inputs) intent.getSerializableExtra(

Firebase Swift check user if exists not working properly

♀尐吖头ヾ 提交于 2020-07-11 06:02:34
问题 I'm trying to check if a user exists in my database but it always says "Success" no matter if the user exists or not. I don't really understand FireBase docs, they are pretty poor, can anyone help me and tell me why I get success everytime? if nickTextField.text != "" { let db = Database.database().reference() var userExistsSwitch = false db.child("Usernames").observe(.value, with: { (snapshot) in if snapshot.hasChild("\(self.nickTextField.text!)") { userExistsSwitch = true print("Username

after successful google authentication, app crashes while using real time database

爱⌒轻易说出口 提交于 2020-07-10 10:36:46
问题 In my app, after a successful login with Google, it crashes when you get an instance of a firebase realtime database. In my code, the Google sign works fine after that and there are parameters to get user info and a button on which I have set an onClickListener to upload user data in a realtime database. onCreate method I have company_name = (EditText) findViewById(R.id.ip_company_name); mdatabase = FirebaseDatabase.getInstance().getReference(); val_btn = (Button) findViewById(R.id.btn

after successful google authentication, app crashes while using real time database

不打扰是莪最后的温柔 提交于 2020-07-10 10:35:27
问题 In my app, after a successful login with Google, it crashes when you get an instance of a firebase realtime database. In my code, the Google sign works fine after that and there are parameters to get user info and a button on which I have set an onClickListener to upload user data in a realtime database. onCreate method I have company_name = (EditText) findViewById(R.id.ip_company_name); mdatabase = FirebaseDatabase.getInstance().getReference(); val_btn = (Button) findViewById(R.id.btn

addListenerForSingleValueEvent does not execute the code inside onDataChange()

我是研究僧i 提交于 2020-07-10 10:25:26
问题 I am just trying to do a simple program (in Android Studio). I have used addListenerForSingleValueEvent(). But the code inside onDataChange() does not execute at all. dbref.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot snapshot) { Log.d("TAG", "message"); } public void onCancelled(DatabaseError error) { Log.d("TAG", error.toString()); } }); Nothing is displayed in Log. 来源: https://stackoverflow.com/questions/62774908

Retrieving data using FirebaseRecyclerOptions [duplicate]

岁酱吖の 提交于 2020-07-10 09:57:24
问题 This question already has answers here : FirebaseListAdapter not pushing individual items for chat app - Firebase-Ui 3.1 (2 answers) Closed last year . I need help in retrieving data using firebase recycleview adapter. I have tried many ways but I am unable to retrieve data. My main class fragment goes thus. public class AllUsers extends AppCompatActivity { RecyclerView recyclerView; Query databaseReference; FirebaseRecyclerOptions<Users> options; FirebaseRecyclerAdapter<Users,

For some reason cant deserialize object from Firebase response

烂漫一生 提交于 2020-07-10 08:37:06
问题 Everything looks good. Need help in finding a mistake in code. By the logs that is the snapshot from firebase DataSnapshot { key = SecondGame, value = {background=https://firebasestorage.googleapis.com/v0/b/fantasygameapp11.appspot.com/o/background_black.jpg?alt=media&token=b3ec1477-6b52-48b4-9296-f57f63f26837, description=SecondGameDescription, tag=https://firebasestorage.googleapis.com/v0/b/fantasygameapp11.appspot.com/o/hot_icon.png?alt=media&token=65516b45-1aca-4cac-9a39-3eddefffe499,

How to convert Firebase Old Adapter method to New Adapter method?

妖精的绣舞 提交于 2020-07-10 07:30:31
问题 In the main Screen of my app I was trying to build a Search View with Edit Text. I have made a recycler view below the search view. My app is a music app. So I want to build a function like when user search any song from firebase then the song name and song artist should be displayed in the recycler view. So i have read a code for do this particular work. But I am facing a problem like In my code there was a FirebaseRecyclerAdapter method which was used to get values from firebase from my

How to convert Firebase Old Adapter method to New Adapter method?

不打扰是莪最后的温柔 提交于 2020-07-10 07:30:08
问题 In the main Screen of my app I was trying to build a Search View with Edit Text. I have made a recycler view below the search view. My app is a music app. So I want to build a function like when user search any song from firebase then the song name and song artist should be displayed in the recycler view. So i have read a code for do this particular work. But I am facing a problem like In my code there was a FirebaseRecyclerAdapter method which was used to get values from firebase from my

Firebase realtime database .info/connected False when it should be True

我只是一个虾纸丫 提交于 2020-07-09 08:37:05
问题 I have an Android service that calls this at onCreate : FirebaseDatabase database = FirebaseDatabase.getInstance(); database.getReference(".info/connected").addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { Log.d(TAG, "connected: " + snapshot.getValue(Boolean.class)); } @Override public void onCancelled(@NonNull DatabaseError error) { Log.w(TAG, "Failed to read value.", error.toException()); } }); I've noticed that when I do