firebase-realtime-database

firebaserecycleradapter sort/compare/reorder data before populate

五迷三道 提交于 2019-12-25 03:28:06
问题 In my firebase database I have a collection of lat and long for each uid. I use firebase recyler adapter data to list down my data to the recycler view. FirebaseRecyclerAdapter<Model, ViewHolder> firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<Model, ViewHolder>(Model.class, R.layout.row, ViewHolder.class, mRef) { @Override protected void populateViewHolder(final ViewHolder viewHolder, final Model model, int position) { Double dist = distance( myPosition.latitude, myPosition.longitude,

Firebase - Retrieving and storing data in array with callbacks

本秂侑毒 提交于 2019-12-25 03:21:58
问题 I'm want to use Firebase callbacks to retrieve data from my realtime database, store it in an array, then use that data for data visualization purposes. But when I log the console for the array, it returns empty. I referenced this post in an attempt to understand/fix my error, but I'm still having a lot of trouble. var genderData=[]; // Get counter values. function getData(){ var ref = firebase.database().ref().child('counters'); return ref.once('value').then((snapshot) => { snapshot.forEach(

Unable to connect to firebase DB from my android app

Deadly 提交于 2019-12-25 03:19:11
问题 I am unable to connect to my firebase DB. My code: DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference("error"); mDatabase.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { try { //getting value as dataSnapshot; } catch (Exception ignored) { } } @Override public void onCancelled(DatabaseError databaseError) { databaseError.getCode(); } }); OnDataChange() and onCancelled() are not getting triggered

Firebase Simultaneous connections in spark plan

巧了我就是萌 提交于 2019-12-25 03:14:08
问题 If Firebase Simultaneous connections in spark plan is more than 100 will my app work? i want to just read data from firebase not write, will my app work if offline capablities is enabled in my app and simultaneous connections more than 100. and can i buy flame plan just for one month ? 回答1: Once your database reaches its maximum number of concurrent connections, the database stops accepting new connections. Users that are already connected will continue to work. Once a user disconnects from

Polymer 1 and Firebase: How to deal with a large dataset with dom-repeat?

一曲冷凌霜 提交于 2019-12-25 02:47:16
问题 So, I am using firebase-query to read a dataset of about 9000 items. Then I am displaying the list of items with dom-repeat (with all sorts of filtering and sorting options). It all worked well when I tested it with 10 items or so, but now that I am reading the full dataset I have no idea how to manage it... the entire 9000 items are displayed, which obviously is not quite manageable. Here is a simplified version of what I have: <firebase-query path="/organisations" data="{{organisations}}"><

Database count of values

眉间皱痕 提交于 2019-12-25 02:47:16
问题 I my database structure userDatabase/userID/Customers I have two customers. For example path: usersDatabase g8voYf1yoChnpmhkoPgtmO4FQT62 - (uid) Customers Tom Smith (customer with custom ID) -LDFZw1tca8KOrnqyyWH - (auto id of customer child) Status of Service: "Open service" Ben Thomas (customer with custom ID) -LDFZw1tca8KOjgoenBN - (auto id of customer child) Status of Service: "Open service" Is possible to fetch count of value "Open service" form all customers in my database? Now I only

Add copy button for Every CardView in RecyclerView

感情迁移 提交于 2019-12-25 02:46:17
问题 How to Implement Coppy Button I want a copy button for every card in a RecyclerView. When the button is clicked a TextView will be copied, but I'm getting confused where to put the OnClick or how to get a string. import android.content.ClipData; import android.content.ClipboardManager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import

Create table in bigquery fails when the JSON key contains hyphen

十年热恋 提交于 2019-12-25 02:31:11
问题 I have a JSON data from Firebase Backup. Data generated is such that every key is preceded by a hyphen. Sample data is as follows: "-GuGCJDEprMKczAMDUj8":{"deviceId":"399a649c6cee6209","dow":"Thursday","downloadFlag":"N","event":"streamStart","halfHourFull":"18h1","liveFlag":"Y","localDate":"2009-01-01","localHalfHour":1,"minutesSinceMidnight":1080,"quarterHourFull":"18q1","stationName":"hit 105","streamListenMethod":"Headphones","timestampLocal":"2009-01-01T18:00:33.679+10:00","timestampUTC"

Can't return value from async function. Why? [duplicate]

无人久伴 提交于 2019-12-25 02:29:15
问题 This question already has answers here : How do I return the response from an asynchronous call? (36 answers) Closed last year . I want to return name from currentUserName() function, but I got ZoneAwarePromise. Here is my code: currentUserName() { var firebaseData = firebase.database().ref('users'); var userid = this.afAuth.auth.currentUser.uid; var promises = []; var name; var promise = firebaseData.orderByKey().once('value').then(function (snapshot) { snapshot.forEach(function

setValue() for Firebase data update causes other fields in updated object to return null in onChildAdded in childEventListener

吃可爱长大的小学妹 提交于 2019-12-25 02:27:16
问题 I have a list of Firebase message objects, each of which may be updated before an activity is opened, at which point a Firebase ChildEventListener() fires off (children are handled in onChildAdded() ). The update uses a setValue() on the status field: database.getReference("Messages").child(roomID).child(msgID).child("status").setValue("delivered"); The ChildEventListener() fires off fine for all children when the activity is opened. However, for those children (messages) that had their