Android examples for android.content.pm:Apk Install
get Installed Apk Package Info
import java.util.Iterator; import java.util.List; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; public class Main { public static PackageInfo getInstalledApkPackageInfo(Context context, String packageName) { PackageManager pm = context.getPackageManager(); List<PackageInfo> apps = pm.getInstalledPackages(PackageManager.GET_SIGNATURES); Iterator<PackageInfo> it = apps.iterator(); while (it.hasNext()) { PackageInfo packageinfo = it.next(); String thisName = packageinfo.packageName; if (thisName.equals(packageName)) { return packageinfo; }/*from w ww .j a v a 2 s .c o m*/ } return null; } }