Это метод, который я использую для проверки версий и был ли установлен определенный пакет:
/**
* Returns the version number we are currently in
* @param appPackageName - full name of the package of an app, 'com.dcg.meneame' for example.
*/
public static int getAppVersionCode(Context context, String appPackageName) {
if ( context!= null )
{
try {
return context.getPackageManager().getPackageInfo(appPackageName, 0).versionCode;
} catch (NameNotFoundException e) {
// App not installed!
}
}
return -1;
}