我是Firebase和Kotlin的新手,我正在尝试用它做一个应用程序。我有一个名为公告的数据类,并且我已经在Firestore中保存了用于公告的数据。然而,当我想要从Firestore中检索数据时,它总是给我以下错误:
2019-10-09 03:14:13.016 14552-14552/com.example.finalyearproject W/Firestore: (21.1.1) [CustomClassMapper]: No setter/field for Content found on class com.example.finalyearproject.Announcem
在Firestore中作为单个批处理执行多个保存操作后,如何读取文档列表的结果?
发送到Firestore后,我需要接收文档数据来删除SQLite中的注册。我的应用程序需要脱机工作,当我连接到互联网时,需要一次发送所有文档。
我以这种方式发送(下面的代码),但发送所有数据需要很长时间
List<Record> notUpdate = recordService.getNotUpdate();
for (Record record : notUpdate) {
Map<String, Object> field = new HashMa
我有一个简单的加密货币应用程序,它使用API来获取价格。我使用Firestore来存储我的API密钥,我的应用程序在启动时从Firestore中检索我的API密钥。我的API键是我在Firestore中拥有的唯一数据。由于我的应用程序不允许用户创建配置文件/帐户,所以我的规则中不包括用户身份验证。我对Firestore的安全规则是:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /Data/{Data} {
allo
我正在用Kotlin编写一个android应用程序,但在添加到Cloud Firestore的文档时遇到了麻烦。当在android studio AVD Emulator中测试应用程序时,它运行正常并按预期保存,但当我在手机上测试时,该应用程序从Google Play Store安装在beta模式下,它将地图的字段名称更改为字母。 我在kotlin中创建了一个hashMap,如下所示: val mapeamento: HashMap<String, Any?> = hashMapOf(
"user_id"
我在将Kotlin数据类对象写入云Firestore上的文档时遇到了一个问题。在我假设这是某种bug之前,我想问一下这是否是故意的行为。 我有一个数据类,比如 data class Notification(
val createdAt: Timestamp?,
val isDismissed: Boolean?,
val text: String?
) 我将其直接添加到Firestore中,如下所示: docRef?.add(notification) 但是写入Firestore控制台的文档是: createdAt: month number, 2020 a
我试图从Firestore中的第一个文档中读取一个字段,但是我得到了以下错误:
无法反序列化对象。未能将java.util.HashMap类型的值转换为日期
我有一个Firestore数据库,如下所示:
“用户路由”集合包含以每个用户的ID命名的documents。在这些文档中有多个“路由”集合。
每个“路由”集合包含--多个文档--存储一个带有3个字段的用户位置对象。最后,我希望根据指定的日期(使用时间戳字段)筛选路由,并能够使用所有geo_point字段构建一个Polyline:
这是UserLocation对象(仅与时间戳相关的代码):
public class U
我在用
implementation 'com.google.firebase:firebase-firestore:21.3.1'
用于在1.3.50版本中用Kotlin测试。
对于读/写测试,我创建了一个简单的数据类:
data class Location(
val uuid: String? = null,
val name: String? = null
)
它运行得很好很顺利,就像预期的那样。
但是,深入一点用Kotlin的密封类扩展数据类会导致序列化中的问题:
data class Location(
val uuid: String? =
我正在尝试在Kotlin中表示一个列表中的HashMap。该列表的结构如下: daysOfWeekHashMapOptions = listOf(
hashMapOf("key" to 0, "label" to "Monday"),
hashMapOf("key" to 1, "label" to "Tuesday"),
hashMapOf("key" to 2, "label" to "Wednesday"),
h
我在从Firestore检索散列映射值时遇到了问题。我在上传这些值时没有问题,但在检索它们时却遇到了困难。
下面是我的构造函数:
public class OrderItems {
private String uid;
private String product;
private int qty;
private int price;
private int totalPrice;
public OrderItems(){
}
public OrderItems(String uid, String product
我一直在尝试用Android Studio构建一个简单的应用程序,它有一个Firestore实现。当我将以下行添加到build.gradle文件中时
implementation 'com.google.firebase:firebase-firestore:21.3.0'
该应用程序甚至没有构建,并抛出以下错误:
cannot fit request class in a single dex file
我已经查找了这个问题,找到了,它建议将MultiDex添加到应用程序中。这允许应用程序进行构建,但当我尝试在模拟器中运行它时,它会崩溃。我已经检查了日志文件,但它们不包含任何