You can use PackageManager getInstalledPackages() or getInstalledApplications() to simply check if the license package is installed.
Or, if you need something more complex, you can give the main application and apk license the same user ID in the manifest , This means that both applications can access your data (general settings, SQLite DB, etc.) . Then the licensed application just needs to be run once; it can store a value in shared data indicating that enhanced functionality should be enabled. The main application simply needs to check this flag and change its behavior accordingly.
The advantage of the second approach is that the license application can be deleted after launch, and the main application will continue to provide advanced features.
source share