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..