I want to know that the specific Application as App1 is Installed or Not on my App.
Here I don’t know the actual package name of that App1(App1 is only name).
Then How to find that application is currently installed or not?
I have tried this ,
private static final String PACKAGE_NAME = "App1";
/**
* Returns true if "App1" is installed.
*/
public static boolean isApp1Installed( Context context )
{
boolean output = false;
PackageManager pm = context.getPackageManager();
try {
PackageInfo pi = pm.getPackageInfo( PACKAGE_NAME, 0 );
if( pi != null )
{
output = true;
}
} catch (PackageManager.NameNotFoundException e) {}
return output;
}
Please Help Me..
You can use PackageManager to get a list of all installed packages by using the:
or a list of activities by
for an intent with
CATEGORY_LAUNCHERBy name you can find whether the app is installed or not:
You may also follow the below link for more help:
http://www.androidsnippets.com/get-installed-applications-with-name-package-name-version-and-icon
Hope it solves your problem.