@Test public void testGetAppVersion() throws Exception { final String version = AppHelper.getAppVersion(getTargetContext()); assertEquals(getProperty("versionName"), version); }
public static String getAppVersion(Context context) { String currVersionName = ""; try { PackageInfo pInfo = AppHelper.getPackageInfo(context); currVersionName = pInfo.versionName; } catch (NameNotFoundException e) { Dbg.printStackTrace(e); } return currVersionName; }
AppHelper { public static String getAppVersion(Context context) { String currVersionName = ""; try { PackageInfo pInfo = AppHelper.getPackageInfo(context); currVersionName = pInfo.versionName; } catch (NameNotFoundException e) { Dbg.printStackTrace(e); } return currVersionName; } }
AppHelper { public static String getAppVersion(Context context) { String currVersionName = ""; try { PackageInfo pInfo = AppHelper.getPackageInfo(context); currVersionName = pInfo.versionName; } catch (NameNotFoundException e) { Dbg.printStackTrace(e); } return currVersionName; } private  AppHelper(); }
AppHelper { public static String getAppVersion(Context context) { String currVersionName = ""; try { PackageInfo pInfo = AppHelper.getPackageInfo(context); currVersionName = pInfo.versionName; } catch (NameNotFoundException e) { Dbg.printStackTrace(e); } return currVersionName; } private  AppHelper(); static void debugPrintSignatures(Context context); static int getSignaturesHashCode(Context context); static String getAppLabel(Context context); static String getAppVersion(Context context); static int getAppVersionCode(Context context); static int getApkAppVersionCode(Context context, String apkFullPath); static PackageInfo getPackageInfo(Context context); static String getPackageNameFromApk(Context context, String fileName); static long getApkBuildDate(Context context); static boolean isAppInstalledToSDCard(Context context); static void removeApplication(Context context, String pkgName); static void installApplication(Context context, File file); static boolean isPackageExisted(Context context, String targetPackage); }
AppHelper { public static String getAppVersion(Context context) { String currVersionName = ""; try { PackageInfo pInfo = AppHelper.getPackageInfo(context); currVersionName = pInfo.versionName; } catch (NameNotFoundException e) { Dbg.printStackTrace(e); } return currVersionName; } private  AppHelper(); static void debugPrintSignatures(Context context); static int getSignaturesHashCode(Context context); static String getAppLabel(Context context); static String getAppVersion(Context context); static int getAppVersionCode(Context context); static int getApkAppVersionCode(Context context, String apkFullPath); static PackageInfo getPackageInfo(Context context); static String getPackageNameFromApk(Context context, String fileName); static long getApkBuildDate(Context context); static boolean isAppInstalledToSDCard(Context context); static void removeApplication(Context context, String pkgName); static void installApplication(Context context, File file); static boolean isPackageExisted(Context context, String targetPackage);  }