Skip to content

Instantly share code, notes, and snippets.

@yenliangl
Created August 31, 2010 15:54
Show Gist options
  • Save yenliangl/559243 to your computer and use it in GitHub Desktop.
Save yenliangl/559243 to your computer and use it in GitHub Desktop.
How to check if an application is installed in Android system
// If no resource for the given package exists, this package is not installed in the phone
try {
mGenieResources = getPackageManager().getResourcesForApplication(GENIE_PACKAGE_ID);
} catch (PackageManager.NameNotFoundException e) {
// no weather info available
Log.w(LOG_TAG, "Can't find "+GENIE_PACKAGE_ID+". Weather forecast will not be available.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment