For the market, you need to specify that the version of the program is not 1.0, but 1.1 how to do it? Tell me please.

1 answer 1

In the manifest, there are 2 attributes related to the version of android:versionCode and android:versionName .

  • android:versionCode - an integer from it is only required to increase from version to version. Used for updates. That is, when you put up a new version, if you specify versionCode more than the previous one, then the program will be updated otherwise there will be no.
  • android:versionName - android:versionName version. It is used only to display the program version in the program itself or in the market.

In the code, the version of the program can be obtained as follows (for example, to display the About / About program in the menu:

 String versionName=context.getPackageManager().getPackageInfo(getPackageName(), 0).versionName; 
  • who will do this, pay attention that when laying out the application, both values ​​must be changed - Gorets
  • I usually attach the application version to the version number given by Subversion / Git / CVS - very convenient - Barmaley