firebase-realtime-database

Assignments done inside ValueEventListeners of Firebase database is not being reflected

拥有回忆 提交于 2021-01-28 08:07:33
问题 I have some global variables whose values need to be updated dynamically as per the database contains. So I tried using ValueEventListener() I can successfully read the intended value and show that in the Log. But unfortunately when I try to store that value in the previously declared some global variable it dose not work m though it dose not show any error, but it dose fail to store the intended value(I am giving the code where , you can find a Log message to show the size of the list after

What is the best way to show reports with firebase?

穿精又带淫゛_ 提交于 2021-01-28 07:54:06
问题 I am currently using Cloud Functions to do aggregation in Firebase so that whenever a certain type of data entry occurs, I aggregate it accordingly and store it to show our reports. There are following concerns with this approach:- Adding new reports would mean going over all the existing data and that could be expensive with firebase realtime database Making any changes to existing reports is also non-trivial I was considering a solution like Cloud Dataflow. However, one issue is that it is

How to Retrieve Count of Child Under Root Node in Firebase

老子叫甜甜 提交于 2021-01-28 07:37:41
问题 prev.child("ViewLikes").child(postId).push().setValue("viewed"); How to count the number of childs under the the root(9999999977). I'm using Value event listener but still the I can't get the counts. Inside Value event listener below for loop is used. for(DatanSnapshot a:DatanSnapshot.getChildren()) long count=a.getChildrenCount(); 回答1: To get the number of childrens within the 9999999977 node, please use the following code: DatabaseReference rootRef = FirebaseDatabase.getInstance()

Auto Sync google sheets to firebase without button

夙愿已清 提交于 2021-01-28 07:32:33
问题 I used a tutorial to help me sync my sheets to firebase with the use of a SYNC button that activates the script. The SYNC button currently sits just in the middle of the spreadsheet. I want to sync the data from sheets automatically to firebase when there are changes made. function getFirebaseUrl(jsonPath) { return ( 'https://no-excusas.firebaseio.com/' + jsonPath + '.json?auth=' + secret ) } function syncMasterSheet(sheetHeaders, sheetData) { /* We make a PUT (update) request, and send a

Firebase Rules Regex Birthday

我们两清 提交于 2021-01-28 07:25:31
问题 I am trying to validate birthdays using the following regex: ^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$ This regex works when tested in an online regex tester, but when I try to use this regex inside my firebase

Auto Sync google sheets to firebase without button

拜拜、爱过 提交于 2021-01-28 07:21:04
问题 I used a tutorial to help me sync my sheets to firebase with the use of a SYNC button that activates the script. The SYNC button currently sits just in the middle of the spreadsheet. I want to sync the data from sheets automatically to firebase when there are changes made. function getFirebaseUrl(jsonPath) { return ( 'https://no-excusas.firebaseio.com/' + jsonPath + '.json?auth=' + secret ) } function syncMasterSheet(sheetHeaders, sheetData) { /* We make a PUT (update) request, and send a

How to block reading specific field in child in the firebase [closed]

瘦欲@ 提交于 2021-01-28 07:03:40
问题 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 1 year ago . Improve this question I have User which has a username, UID, email so I want the email field and UID cant reached because some users don't want to spam their email by reading its email child and in my app register to search Users is not required How can work with this problem? I thought to make a

Retreiving data from firebase

别等时光非礼了梦想. 提交于 2021-01-28 07:02:30
问题 Here is my android code for retrieving data from firebase real-time database: package com.example.firebaseapp; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import`enter code here` android.view.View; import android.widget.Button; import android.widget.TextView; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import

Firebase error when trying to get a file download url from firebase

。_饼干妹妹 提交于 2021-01-28 06:01:16
问题 I'm trying to upload an image file and get the image download URL using this code private void UploadImage() { String storageFileName = System.currentTimeMillis() + ".jpg"; // Time is used to ensure unique file name FireBase_File = FireBase_Storage.child(storageFileName); FireBase_File.putFile(UriBitmap).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() { @Override public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) { if(task.isSuccessful()) { FireBase

Cast arraylist in recyclerview firebase

橙三吉。 提交于 2021-01-28 05:51:44
问题 I have an array of data which I am retrieving from firebase. I am using a recyclerview to display the data but my adapter is not working correctly.I tried adding the arraylist in the adapter but this is not working. It is saying the adapter is not attached and I am having a blank activity. Any help on this ? Here are my details. Modal Class public class Order { private String ProductId; private String ProductName; private String Quantity; public Order() { } public String getProductId() {