【java-从firebase检索返回NULL的数据】教程文章相关的互联网学习教程文章

android – 无法获取资源’http://…firebase-measurement-connector-impl-17.0.5-javadoc.jar【代码】

将库com.google.firebase:firebase-core:16.0.6更新到版本16.0.7后,我收到此错误.Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-measurement-connector-impl/17.0.5/firebase-measurement-connector-impl-17.0.5-javadoc.jar'.无论如何它都会编译.谁知道怎么解决这个问题? 这里的堆栈:org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.goog...

java – 有没有办法在我从Firebase对象转换的类中存储Key?【代码】

这是我的数据库:[x] database -- > [+] students -----> [+] -KuGacomJymBwkcc7zlU (pushKey) -----------> Name - Jon -----------> Age - 21我有Student.class:String name; String age;public Student(String Name, String Age) { this.name=Name; this.age=Age; }我从firebase datasnapshot中读取信息,如下所示:Student newStudent = DataSnapshot.getValue(Student.class);当我这样做时,我得到了名称和年龄,但我的问题是,是...

java – Manifest合并失败:属性应用程序@ appComponentFactory更新Firebase库【代码】

我正在尝试在我的项目中添加firebase,但是当我实现’com.google.firebase:firebase-messaging:19.0.0’和’com.google.firebase:firebase-core:17.0.0’时. build.gradle(这是错误)apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services'android {compileSdkVersion 28defaultConfig {applicationId "com.example.user.mikripoli"minSdkVersion 15targetSdkVersion 28multiDexEnabled truev...

Firebase DatabaseException:无法将java.lang.Long类型的值转换为String【代码】

com.google.firebase.database.DatabaseException: Failed to convertvalue of type java.lang.Long to String是在尝试将数据检索到对象以供使用时遵循文档时遇到的错误. 这是我的对象模型public class User {private String tour_director_key;private String last_name;private String location_latitude;private String tour_id;private String photo;private String tour_director_name;private String middle_name;private St...

我可以使用Java API将图像文件存储在firebase中【代码】

有没有办法使用Java API在firebase中存储图像文件?解决方法:尝试使用此代码段:Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.chicken);//your image ByteArrayOutputStream bYtE = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.PNG, 100, bYtE); bmp.recycle(); byte[] byteArray = bYtE.toByteArray(); String imageFile = Base64.encodeToString(byteArray, Base64.DEFAULT); ...

java – Firebase云消息传递API弹簧【代码】

我必须在Spring Java中创建一个Rest API用于多层arch,其中需要为Firebase云消息传递(FCM)构建DAO,Controller,Service Manager以向Android应用程序发送推送通知消息,但我无法配置Java中的服务器,用于向设备发送通知.我怎么能?解决方法:以下是您可以实现此目的的方法: 第1步: 在firebase上创建项目并生成服务器密钥. 第2步:为fcm服务器生成json对象.这里的消息可能包含数据对象和通知对象.它还必须有接收器fcm id.样本json就像...

java – Firebase没有在类上找到的序列化属性【代码】

我开始创建一个Firebase数据库. 我正在尝试为一个班级建模.一个非常简单的课程:package com.glups.model;import com.google.firebase.database.IgnoreExtraProperties;@IgnoreExtraProperties public class AlumnoFB {private String nombre;private String apellidos;private String telefono;private String email;private Boolean tieneWhatsapp;private Boolean tieneTelegram;private Boolean tieneHangouts;private Long fo...

java – Firebase Firestore上的ServerTimestamp始终为null【代码】

我正在尝试使用Firebase Firestore在Android客户端中添加时间戳字段. 根据documentation:Annotation used to mark a Date field to be populated with a servertimestamp. If a POJO being written contains null for a@ServerTimestamp-annotated field, it will be replaced with aserver-generated timestamp.但是当我尝试时:@ServerTimestamp Date serverTime = null; // I tried both java.util.Date and java.sql.Date//.....

java – 在ListView中显示Firebase数据【代码】

好的,所以我让它运行显示用户ID但没有得分.然后我开始做一些改变,忘了我改变了什么,现在我又回到了null null.我觉得我可能删除了一些东西或拼写错误的东西.dbref.addValueEventListener(new com.google.firebase.database.ValueEventListener() {@Overridepublic void onDataChange(DataSnapshot dataSnapshot) {ArrayList<String> list = new ArrayList<>();list.clear();for(DataSnapshot ds :dataSnapshot.getChildren()) {Scor...

android – 更新到新firebase后获取异常java.lang.NoClassDefFoundError:com.google.firebase.FirebaseOptions【代码】

我已经使用this将我的应用程序更新到新的firebase,现在当我编译我的项目时,我得到以下异常. 这是我的logcat:11:57:54.533 27844-27844/com.example.dayshift_2.traveyy E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.dayshift_2.traveyy, PID: 27844 java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.pro...

java – 在Firebase侦听器中设置Singleton属性值【代码】

我目前正在测试Firebase以及我打算在整个应用程序的生命周期中使用的Singleton模型.我现在已经陷入了一些似乎非常微不足道的事情,但我无法理解我的生活.我有一个我使用的模型示例:firebase中的书签.public class BookSingleton {private static BookSingleton model;private ArrayList<BookMark> bookmarks = new ArrayList<BookMark>();public static BookSingleton getModel() {if (model == null){throw new IllegalStateExcep...

java – Firebase云功能更改超时【代码】

我在Android上使用Firebase Cloud Functions库,并使用getHttpsCallable调用云功能. 问题是该函数需要10-15秒才能将结果返回给客户端,因此客户端抛出异常java.net.SocketTimeoutException:timeout. 码// Create the arguments to the callable function.Map<String, Object> data = new HashMap<>();data.put("info", info);mFunctions.getHttpsCallable(function).call(data).continueWith(new Continuation<HttpsCallableResult,...

java – 从firebase获取特定类别的数据【代码】

我想在Firebase实时数据库中对数据进行分类,然后按类别选择它们以显示在我的android视图的不同部分,但我不知道从哪里开始.我是Firebase的新手,我所知道的是如何提取数据,推送到Firebase数据库并显示所有获取的数据. 我的问题是:这是否可能,如果是,我该如何解决?谢谢解决方法:如果你有这个数据库:AnimalsrandomIdname: dogcategory: mammalrandomIdname: snakecategory: reptilerandomIdname: elephantscategory: mammal然后您可...

java – Firebase访问Hackernews【代码】

所以我想查看Firebase并尝试连接到Hackernews Firebase数据库.我正在使用com.google.firebase:firebase-server-sdk:3.0.3 sdk. 但我不知道为什么我被迫进入服务帐户.@Bean fun firebase(): DatabaseReference {val options = FirebaseOptions.Builder().setDatabaseUrl("https://hacker-news.firebaseio.com/").setServiceAccount(this.javaClass.getResourceAsStream("/account.json")).build()val app = FirebaseApp.initializ...

java – 使用google的Firebase UI身份验证失败并显示消息(代码:10消息:10)

我制作了一个使用Firebase功能实时数据库的聊天应用.我遇到了谷歌身份验证的问题.当我从Play商店下载应用程序时,问题就出现了,当我在调试模式下运行应用程序时,身份验证工作正常.当用户尝试登录时,他们会收到一个Toast消息代码:10消息:10. 我想在此注意:我添加了SHA1指纹.我怎么解决这个问题? *不确定这是否有用,但我已按照步骤tutorial进行操作解决方法:您需要三个键才能使其工作: >调试密钥.信息here.>释放键.信息here.> Go...