HOW TO GET AND SET VERSION NAME IN ANDRIOD

Royce Roy

Total Post:149

Points:1043
Posted by  Royce Roy
 896  View(s)
Ratings:
Rate this:
How to get and set version name in Andriod?
  1. ben reitman

    Post:96

    Points:676
    Re: How to get and set version name in Andriod

    Get Version Name

    // Package Info keep your project information

                PackageInfo pInfo = getPackageManager().getPackageInfo(

                          getPackageName(), 0);

    // return version Name in String

                 String version = pInfo.versionName;


    Set Version Name

    1. 1. Expand your Project.
    2. 2. Open Manifest file




    Before

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"

        package="com.mindstick.demoapplication"

        android:versionCode="1"

        android:versionName="1.0" >


    After

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"

        package="com.mindstick.demoapplication"

        android:versionCode="2"

        android:versionName="1.2" >

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!