Skip to content Skip to sidebar Skip to footer

How Do I Determine The Revision Number Of An Android Build?

I know how to get the API level, android.os.Build.VERSION.SDK_INT, but there are also several revisions of each level release, e.g. for 2.1 there's rev 1 and 2. How do I determine

Solution 1:

I'm not sure which revision you're reffering to, but the revision you set in your manifest file you can get with the following code:

paramContext is your Context object

PackageManagerlocalPackageManager= paramContext.getPackageManager();
    PackageInfolocalPackageInfo= localPackageManager.getPackageInfo(paramContext.getPackageName(), 0);
    Stringversion= localPackageInfo.versionName;

If you want to extract the build version, use this code:

Stringversion= Build.VERSION.RELEASE;

Post a Comment for "How Do I Determine The Revision Number Of An Android Build?"