I’ve a pretty weird question/requirement! I’m bui...
# android
s
I’ve a pretty weird question/requirement! I’m building an android SDK/library. In the library I want to know whether app is either • running on simulator • physical device • whether it’s in beta testing on google play • or it’s product build Based on my knowledge, I can only detect
simulator
vs
physical
based on some checks on
Build
class values But there is no way for SDK to know about
beta testing
vs
production
unless the developer of the app using the SDK provides that information via a
public API
Could someone confirm this ? OR if there is a way to do this then provide some insights.
Reason is to route API calls and data to a particular endpoint so various data doesn’t end up skewing production data.
I can do that via different API Keys for all for cases, but that’s off the limits right now.
f
If you're already routing endpoints why not do it based on build variant itself in your gradle?
assuming you do have separate end points on your server for these variants.
s
@Faraz Library is always
release
variant when shipped. there can’t be a debug version of library shared with dev/client
👍 1
r
@shaktiman_droid you can check
flavors
https://developer.android.com/studio/build/build-variants#product-flavors They are different from
build variants
s
@Raul Tunduc You’re thinking about app, but I’m talking about library. I don’t want to ship different variants of the entire library. That’s too much overload, and probably no one ever does that