In you (module: application) gradle specify the version name and version code
defaultConfig { applicationId "com.sing.smart" minSdkVersion 16 targetSdkVersion 23 versionCode 1 versionName "1.1.0" }
Versioncode
VersionCode is an integer value used to easily distinguish between application versions.
Application developers should increase this value when releasing updates to their applications on the Android Market, so it can determine if users are using the old version of the application and offer them to update it.
versionName
VersionName is a string containing the usual "release version", as shown in other desktop applications, such as "1.4.5" or "3.7".
VersionName is simply a "human readable" version code.
PackageInfo pinfo = getPackageManager().getPackageInfo(getPackageName(), 0); int versionNumber = pinfo.versionCode; String versionName = pinfo.versionName;
Bajrang Hudda Jun 28 '16 at 5:20 2016-06-28 05:20
source share