public static boolean isInstalledOnSDCard ( Application app ) { try { String packageName = app . getPackageName ( ) ; PackageInfo info = app . getPackageManager ( ) . getPackageInfo ( packageName , 0 ) ; String dir = info . applicationInfo . sourceDir ; for ( String path : INTERNAL_PATH ) { if ( path . equals ( dir . substring ( 0 , path . length ( ) ) ) ) return false ; } } catch ( PackageManager . NameNotFoundException exp ) { throw new IllegalArgumentException ( exp ) ; } return true ; }
Checks if the application is installed on external storage in most case on the SD card .