com.vodafone360.people.utils
Class VersionUtils

java.lang.Object
  extended by com.vodafone360.people.utils.VersionUtils

public class VersionUtils
extends java.lang.Object


Field Summary
private static int ANDROID16_VERSION
          Mapping version value directly from Android Documentation.
private static int PLATFORM_VERSION_CODE
          Static Platform Version Code field.
 
Constructor Summary
VersionUtils()
           
 
Method Summary
static int getPackageVersionCode(Context context)
          Returns the version code from the AndroidManifest.xml file
static java.lang.String getPackageVersionName(Context context)
          Returns the version name from the AndroidManifest.xml file.
static int getPlatformVersionCode()
          Returns the Platform Version Code.
static boolean is2XPlatform()
          Checks if the device platform Version is in the 2.X version range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLATFORM_VERSION_CODE

private static final int PLATFORM_VERSION_CODE
Static Platform Version Code field. Build.VERSION.SDK has existed since the first version of Android. Even though its deprecated it should still be good to use


ANDROID16_VERSION

private static final int ANDROID16_VERSION
Mapping version value directly from Android Documentation. This is done because platforms with versions below wont have the constant defined.

See Also:
Constant Field Values
Constructor Detail

VersionUtils

public VersionUtils()
Method Detail

getPlatformVersionCode

public static int getPlatformVersionCode()
Returns the Platform Version Code.

Returns:
Platform Version Code

is2XPlatform

public static boolean is2XPlatform()
Checks if the device platform Version is in the 2.X version range.

Returns:
true if running on a 2.X Platform, false if not

getPackageVersionName

public static java.lang.String getPackageVersionName(Context context)
Returns the version name from the AndroidManifest.xml file.

Parameters:
context - Android context.
Returns:
Version name as an integer, or "" if name not found.

getPackageVersionCode

public static int getPackageVersionCode(Context context)
Returns the version code from the AndroidManifest.xml file

Parameters:
context - Android context.
Returns:
Version code as an integer, or "" if name not found.


JavaDoc