List of utility methods to do Device Version Check
int | GetVersionCode(final Context con) Get Version Code int version = 1; PackageManager packageManager = con.getPackageManager(); try { PackageInfo packageInfo = packageManager.getPackageInfo( con.getPackageName(), 0); version = packageInfo.versionCode; } catch (Exception e) { e.printStackTrace(); ... |
String | GetVersionName(final Context context) Get Version Name String versionName = "1.0.0"; PackageManager packageManager = context.getPackageManager(); try { PackageInfo packageInfo = packageManager.getPackageInfo( context.getPackageName(), 0); versionName = packageInfo.versionName; } catch (Exception e) { e.printStackTrace(); ... |
String | getDefaultVendor() Gets the default vendor for this build. return Build.BRAND;
|
String | getPhoneVersion() get Phone Version return Build.VERSION.RELEASE;
|
boolean | isJellybeanOrLater() is Jellybean Or Later return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
|
boolean | isJellybeanOrLater() is Jellybean Or Later return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
|
boolean | checkIncVersion(String fingerprinter, String product) check Inc Version return (Build.FINGERPRINT.equals(fingerprinter) && (Build.DEVICE
.equals(product) || Build.PRODUCT.equals(product)));
|
boolean | checkVersion(long newVersion, String product) check Version return (Build.TIME <= newVersion * 1000 && (Build.DEVICE
.equals(product) || Build.PRODUCT.equals(product)));
|
float | getAndroidVersion() get Android Version if (sAndroidVersion == 0.0f) { String androidVersion = Build.VERSION.RELEASE.trim(); try { int firstDotPosition = androidVersion.indexOf('.'), secondDotPosition = androidVersion .indexOf('.', firstDotPosition + 1); sAndroidVersion = Float .parseFloat(androidVersion .substring( ... |
boolean | isGingerbread() I guess this should really be named "isGingerbreadOrAbove()" but I suck at function naming. return Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD;
|