Does Android check dependent application during installation?

I want to publish my application (ABC). Its audiobook file (for example, for example.) Is wrapped as apk. When a user installs this application, they need to check whether another application (XYZ) is installed or not. If the user does not know that before installing ABC, it is necessary to install the XYZ application.

Thanks in advance

Rajesh

+6
source share
2 answers

If you know the package name of the application you are looking for, you can use the PackageManager to check for the availability of the application.

try{ ApplicationInfo info = getPackageManager() .getApplicationInfo("com.myproject", 0 ); //-- application exists } catch( PackageManager.NameNotFoundException e ){ //-- application doesn't exist } 
+18
source

In case XYZ is a shared library , you can configure the manifest of the android application to prevent users from installing ABC without XYZ. Please use the element inside AndroidManifest.xml ABC, specifying:

 <uses-library android:name="package name of XYZ" android:required="true" /> 

Hope this helps your problem.

+2
source

All Articles