我的主要班级: -
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);
}
}
Run Code Online (Sandbox Code Playgroud)
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" />
Run Code Online (Sandbox Code Playgroud)
任何伙伴都可以告诉我如何更改我的版本....谢谢你.
您想要更改哪个版本?如果要更新商店中的应用程序,则必须增加android:versionCode="1".这对用户来说是不可见的.
如果您想向用户显示您增加了应用程序的版本,您可以增加android:versionName="1.0",只需记住增加版本代码是必需的,以便在商店中更新您的应用程序.
只需在清单文件中尝试更改..
<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 ..-->
Run Code Online (Sandbox Code Playgroud)
更新::导出项目..
(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.
Run Code Online (Sandbox Code Playgroud)
而已.你完成了你的工作.
在 android Studio 中添加/更改 versionCode 和 versionName :
versionCode 0
versionName "0.0.2"
Run Code Online (Sandbox Code Playgroud)
不仅在清单中,而且在模块的 build.gradle file:: defaultConfig{ } 中最重要:像这样:
build.gradle(模块: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'
}
Run Code Online (Sandbox Code Playgroud)
请记住,build.gradle 比清单“更强”。意思是如果你有这些行
versionCode 0
versionName "0.0.2"
Run Code Online (Sandbox Code Playgroud)
在 build.gradle 中,manifest 中的相同行将不会产生任何影响。如果您想从清单更新版本 - 则从 build.gradle 中删除此行。
| 归档时间: |
|
| 查看次数: |
18901 次 |
| 最近记录: |