public static boolean isPackageInstalled ( Context context , String packageName ) { try { context . getPackageManager ( ) . getApplicationInfo ( packageName , 0 ) ; return true ; } catch ( Exception e ) { return false ; } }
Checks if a package is installed .