Hey Sibi,
Unfortunately, we do not have a great story for desktop Java applications. We only have a
client SDK for Android and an
Admin Java SDK for the JVM. We do not currently have a version of the client SDK which works with Java desktop apps.
That being said, you have three workarounds (although admittedly none of them are that great):
- Use the client Node.js SDK instead. We have a version of the client SDK which runs on Node.js and is perfect for desktop applications built using Electron.
- Pros: This is the best supported way to build desktop apps with Firebase.
- Cons: You want to use Java, not JavaScript.
- Move all of the Firebase logic to a custom server which running the Admin Java SDK. To interact with Firebase, you'd send REST requests to your custom server, which essentially acts a proxy to Firebase.
- Pros: Allows you to actually use Firebase to build a desktop app in Java.
- Cons: One of the major benefits of using Firebase is that you don't need a custom server. This route requires a server and means you lose all the realtime aspects of using Firebase from the client.
- Use the Firebase Realtime Database REST API instead of the Firebase SDK itself.
- Pros: No custom server required and you can still get realtime updates through the REST API.
- Cons: Authenticating to the REST API as an end-user is non-trivial. Still may require a custom server. See this thread from more details.
We realize Java desktop apps are an important thing for many developers and hope to improve our story around them in the future. However, at the moment, there are no plans for this in the near future.
Hope that helps, and sorry I don't have better news for you.
Cheers,
Jacob