Get actual app ID and version from Android library without Context

References: How to get package name from anywhere? Get Android application package without Context Source code for android.app.ActivityThread This addresses the scenario where you are writing an Android library/SDK and it’s used in an app. How to get the actual app ID (package name) and version from inside the SDK? BuildConfig.APPLICATION_ID and BuildConfig.VERSION_NAME would return …