firebase java,Firebase普通Java客户端

博客围绕Java桌面应用集成Firebase展开。提问者询问能否下载.jar文件及最新版本文档,IDE为Netbeans。解决方案是使用firebase - server - sdk - 3.0.1.jar,在Netbeans创建Maven项目并使用特定artifact,还给出SDK初始化代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

How can I integrate Firebase with a Java desktop application?

Is there a .jar file I could download?

I've seen plain Java docs on the old Firebase version but I'm unable to find any documentation on the latest version of Firebase.

My IDE is Netbeans.

Thanks.

解决方案

You can use firebase-server-sdk-3.0.1.jar (current version)

In Netbeans I would recommend to create Maven project and use artifact: GroupId - com.google.firebase, ArtifactId: firebase-server-sdk.

I works perfectly for me.

You can find some documentation here.

To initialize SDK just follow documentation: add service account (I use Owner role, I haven't tried weaker roles), download private key, and use this snippet:

FirebaseOptions options = new FirebaseOptions.Builder()

.setServiceAccount(new FileInputStream("path/to/downloaded private key.json"))

.setDatabaseUrl("https://your database name.firebaseio.com/")

.build();

FirebaseApp.initializeApp(options);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值