0

my main class :-

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class Splash extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
    }

}

manifeast:-

package="aaa.amit.com"
    android:versionCode="1"//that i have change android:versionCode="2"
    android:versionName="1.0" >//android:versionName="1.0.1"

    <uses-sdk
        android:minSdkVersion="8"

        android:targetSdkVersion="18" />

Can anyone tell me how I can change my version?

Nicolas Gervais
  • 33,817
  • 13
  • 115
  • 143
Amitsharma
  • 1,577
  • 1
  • 17
  • 29

7 Answers7

9

Which version do you want to change? If it's to update your app on the store, you must increment the android:versionCode="1". Which will not be visible for users.

If you want to show users that you incremented your app's version, you can increment aswell the android:versionName="1.0", just keep in mind that increment the versionCode is mandatory to update your app on the store.

Damien R.
  • 3,383
  • 1
  • 21
  • 32
  • 1
    i have change that kind of activity before that i know i should change the things which u have tell me ...........but i want to know the think there are any need of fingerprints "MD5" or "SHA1" – Amitsharma Dec 20 '13 at 13:17
6

Just try changing .. in your manifest file

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="info.androidhacker.googlemapsv2"
    android:versionCode="2" <!-- 1 / 2 / 3 etc for version code @Thanks laalto ..-->
    android:versionName="1.1" > <!-- 1.1 / 1.2 etc for version name ..-->

Update:: Exporting project ..

(1) Right click on project.
(2) Select Export.
(3) Now check option for android -> Export Android Application.
(4) Check your project name and click next.
(5)Now select option "Use existing keystore" and browse where you need to keep .apk file. Put password which was used for creating first built. click next and fallow other.

Now you can find your new .apk file at place where you located at point-5. 

That's it. you are done with your work.

AndroidHacker
  • 3,596
  • 1
  • 25
  • 45
  • I have change the version code="2"?????what should there?????????> android:version="1.0.1" ???? what should be there ???????> so there what is the need of certificate fingerprints.....can there need of finger prints or not....... – Amitsharma Dec 20 '13 at 13:10
  • 1
    I hope you are updating your app on Google play. so each time you require to create .apk file from scratch means you need to export whole project again. Let me know if any concerns – AndroidHacker Dec 20 '13 at 13:11
  • 1
    yes i have need to open my project i have finger prints in other places now i want to update my apk that particular file ....so can u tell me – Amitsharma Dec 20 '13 at 13:14
  • heeee thank androidHacker this is very great satisfaction answer for me thank u D – Amitsharma Dec 20 '13 at 13:47
  • this is Currect Answer for any Fresher Developer – Amitsharma Dec 20 '13 at 13:48
  • [update]anyone change or update this question : Version change option/edit not in `Manifest file` . Now it is in `build.gradle(Module:myApp)` – AG-Developer Oct 09 '20 at 20:14
5

In android Studio add/change versionCode and versionName :

       versionCode 0
       versionName "0.0.2"

not just in manifest but most importnant inside build.gradle file:: defaultConfig{ } of your module: Like that:

build.gradle(Module:myApp)

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.xyz.mypackage"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 0
        versionName "0.0.1"
     }
     buildTypes {
         release {
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
        }
     }

  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:23.1.1'
   }

Bear in mind that build.gradle is "stronger" then the manifest. Meaning if you have these lines

       versionCode 0
       versionName "0.0.2"

inside build.gradle then the same lines in manifest will have no influence . If you want to update the version from manifest - then remove this lines from the build.gradle.

Udi Reshef
  • 1,083
  • 1
  • 11
  • 14
1

android:versionCodeAn integer value that represents the version of the application code, relative to other versions.

The value is an integer so that other applications can programmatically evaluate it, for example to check an upgrade or downgrade relationship. You can set the value to any integer you want, however you should make sure that each successive release of your application uses a greater value. The system does not enforce this behavior, but increasing the value with successive releases is normative.

Typically, you would release the first version of your application with versionCode set to 1, then monotonically increase the value with each release, regardless whether the release constitutes a major or minor release. This means that the android:versionCode value does not necessarily have a strong resemblance to the application release version that is visible to the user (see android:versionName, below). Applications and publishing services should not display this version value to users.

android:versionNameA string value that represents the release version of the application code, as it should be shown to users.

The value is a string so that you can describe the application version as a .. string, or as any other type of absolute or relative version identifier.

As with android:versionCode, the system does not use this value for any internal purpose, other than to enable applications to display it to users. Publishing services may also extract the android:versionName value for display to users.

Blo
  • 11,903
  • 5
  • 45
  • 99
M D
  • 47,665
  • 9
  • 93
  • 114
1

correct answer is already given in Question

package="aaa.amit.com"
android:versionCode="2"

//that i have change android:versionCode="2" it is depends on user

android:versionName="1.0.2" >

//this is for android version of apk 2 which will make updated apk if in future you want to upgrade apk then just have need to increment this number of version like 2 to 3 if user want to change version then "1.0.2" to "1.0.3" version change

<uses-sdk
    android:minSdkVersion="8"

    android:targetSdkVersion="18" />
Amitsharma
  • 1,577
  • 1
  • 17
  • 29
0

You need to change the following:

android:versionCode="1"
android:versionName="1.0" >

versionCode is used by the Google Play to verifiy which version of your app is newer. versionName is the name which is displayed in the application manager on the device.

XorOrNor
  • 8,868
  • 12
  • 48
  • 81
0

Just press ctrl+shift+alt+S to open the Property structure dialog. click 'app' and click the 'Flavors' tab. enter the version code and and number

This automatically changes the the version code in gradle.build file hope this helps someone.

ILY
  • 1
  • 1