firebase-realtime-database

Firebase Read getter setter

回眸只為那壹抹淺笑 提交于 2019-12-25 02:16:17
问题 I was trying to get some data from my firebase realtime-database as followed generally, but couldn't figure out where in the code the problem was haunting me.The following Toast statement returns with only the name but it dont print bmdc !Couldn't figure out where the problem was. Can anybody point it out? Anything would be appreciated! The code is attached down below- package com.example.abed.smit; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android

Firebase Listener Skip

瘦欲@ 提交于 2019-12-25 01:54:17
问题 I have converted to Firebase for my Android development as I want to utilise the many features of Firebase (Notifications, Messaging, Storage etc), however, I am having difficulty receiving data from Firebase and cannot find detailed information online. Yes, I have tried the documentation but it does not explain the events I am experiencing. I want to retrieve all the data that I have an insert it into an arraylist of objects. Here is a static example: users[i] = new User("James" + (i*2.5),

Is there a way to listen for firebase database changes in python?

荒凉一梦 提交于 2019-12-25 01:49:02
问题 I have a python application that listens for put(add) events in my firebase database using Pyrebase but the stream feature of pyrebase is deprecated and stops listening after 30 minutes. The library is not supported anymore. I figured out that firebase has a library for python called firebase-admin, however this does not have a streaming/listener capability for python, only for java. Is there any other way to do this? # get database instance conn_instance = Database() db = conn_instance.get

How can i get the user in firebase database, to write from a component with vuejs?

大兔子大兔子 提交于 2019-12-25 01:48:19
问题 hope can some one help me, i´m beguinner on this. I´m using vuejs, firebase, for to write in the database from a vue component. I already had the auth working and the writting; but i want that each user write in his own component, and not all users in the same component. this is my code: users login in this component(login.vue): <template> <div> <h2> auth </h2> <div class="container"> <div class="row"> <div class="col s12 m8 offset-m2"> <div class="login card-panel green white-text center">

How to implement Firebase Recycler Adapter in newer version of Android 3.1 and higher?

心不动则不痛 提交于 2019-12-25 01:48:12
问题 Basically, what I am trying to do is use a FirebaseRecyclerAdapter and populate the RecyclerView with my custom designed CardView . The code for newer versions has been changed and therefore, I tried implementing it but didn't work. This is the code I use to write a year ago, which worked fine and populated my RecyclerView : FirebaseRecyclerAdapter<DataClass,DataViewHolder> FBRA= new FirebaseRecyclerAdapter<DataClass, DataViewHolder>( DataClass, R.layout.myCardView, DataViewHolder.class,

Why I get the Notification just opening the Activity?

感情迁移 提交于 2019-12-25 01:47:00
问题 Edit : DO anyone have a solution for this on STACKOVERFLOW ? I am using Firebase Database and wanted to show notification as soon as new child is added. I am using "ChildEventListener" to acquire it. Here is my code: dbProducts.addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) { // Toast.makeText(ShowNotifActivity.this, "Child Added ", Toast.LENGTH_SHORT).show(); Intent intent = new Intent

Get the data from all children in firebase using swift

旧街凉风 提交于 2019-12-25 01:38:34
问题 I have a firebase realtime database. It looks like this: Here is my code: ref.child("2").observeSingleEvent(of: .value, with: { snapshot in guard let dict = snapshot.value as? [String:Any] else { print("Error") return } let latitude = dict["Latitude"] as Any let longtitude = dict["Longtitude"] as Any print(longtitude) print(latitude) }) My problem is that my code retrieves the data from only the child called 2 . How can I make it retrieve the data from all the children? If you have any

How to implement ProgressBar in FireBaseHandler

时光毁灭记忆、已成空白 提交于 2019-12-25 01:33:36
问题 I have the problem, Fragment has content and I want to add simple ProgressBar while of Firebase loading content. How can I do this and where ? (I try to add in onDataChange but it dosn't work, code below) public void onDataChange(DataSnapshot dataSnapshot) { progressBar.setVisibility(View.VISIBLE); mContentLayout.setVisibility(LinearLayout.GONE); for (final DataSnapshot snapshot : dataSnapshot.getChildren()) { item = snapshot.getValue(Item.class); if(item.isSales()) { arrayOfItemProduct.add

How to retrieve my data inside the random key?

自闭症网瘾萝莉.ら 提交于 2019-12-25 01:27:32
问题 I want to get the data inside the random key, as shown here: I am using Firebase and I have tried a lot of things, but I cannot solve this. public class MainActivity extends AppCompatActivity { public RecyclerView recyclerView , recyclerView1 ; public DatabaseReference ref; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); { ref = FirebaseDatabase.getInstance().getReference().child("Requests");

How to get the position of an item in the realtime database

谁说胖子不能爱 提交于 2019-12-25 01:25:00
问题 I want to get the position of an item in the database, along with the data. .ref("users") .orderByChild("email") .equalTo(myEmail) .once("value", snapshot => { console.log("Database Position", ???? ) } Is there a value in the snapshot that I could use that indicates the position in the database (after ordering by email)? I don't want to do this on the client side since I have >1k users 回答1: The Firebase Realtime Database does not track the position of nodes in their parents, nor does it