3

Background

I was recently tasked to work on an SDK that Android developers could use via simple dependency (got this working for Jitpack&Github, here).

One of the tasks I was given is to use Firebase for remote-config and Analytics (and maybe Crashlytics too), to be able to gather statistics and have some control of it using the cloud.

The problem

All tutorials, articles and documentations (example here) that I see of Firebase are for Android apps, and so the preparation itself requires a package-name of the app to be set.

This is impossible for an Android library that is supposed to be used as an SDK, as it's meant for many apps, each has its own package name.

What I've tried

I tried to ask Firebase support about this, but they told me they can only talk about Android apps, and gave me a Github link (here), probably hoping I could get something out of it.

I also tried to ask on reddit (here), but nobody knew the answer to this.

Looking at the list of available, official SDKs (here), I think such a thing might be possible if I register as if it's a website (or web-application), and then in code I would reach it as a website (using REST API on Retrofit), but not sure if there is a better way, whether it will work, and whether it's even according to the rules of using Firebase (I think should be ok).

There might be a way to use the C++ library that Firebase offers, too, but this would probably require a lot of adjustments.

Seeing that this might not be offered natively, I even made a request about it., here.

The questions

  1. Is it possible to use Firebase inside Android libraries? As an SDK? Is it according to the rules of Firebase?
  2. How do I do it? Is there perhaps a library for this? Maybe a general Java library ? I guess I should also be able to make it focus on my SDK's classes and functions, and ignore what's on the app itself.
  3. If there is no library, where can I find the various functions that are available for the various services, so that I would implement them?
android developer
  • 114,585
  • 152
  • 739
  • 1,270

0 Answers0