java - 我可以在 Firebase 数据库中存储 Int 值吗

标签 java android firebase firebase-realtime-database int

我已将资源值存储在变量中,现在我想将此变量存储在 Firebase 数据库中,但数据类型是 Integer (int),我不知道我们是否可以在 Firebase 中存储整数。

我想在 Firebase 数据库中存储以下两个整数类型的变量:

int textColor = ResourcesCompat.getColor(getResources(),R.color.black, null);
int textSize = (int) (getResources().getDimension(R.dimen.text10sp));

最佳答案

Can I store Int value inside Firebase database?

当然可以,在 Long 类型的属性中,它是 supported data-typeint 值始终适合 Long

关于java - 我可以在 Firebase 数据库中存储 Int 值吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61203403/

相关文章:

java - Eclipse编辑器插件: isSaveAsAllowed

java - Netbeans 中服务器库和类库的区别?

android - 如何使用 ListView 选择来确定 Android 中另一个 ListView 中的列表?

android - Select All 导致 abc_ic_menu_selectall_material.xml Resources NotFoundException

ios - 如何使用 Firebase 创建公共(public)/私有(private)用户配置文件?

android - java.io.IOException : AUTHENTICATION_FAILED in Android Firebase (and SERVICE_NOT_AVAILABLE)

java - Spring MVC : Receive XML data and Send String message back

java - 从开发到生产集成 Java Web 应用程序

android - 带有 parcelable 的 EXTRA 结果为 NULL 但没有罚款

ios - Firebase Messenger 发送通知,但 iOS 设备未收到任何消息