你能改变分钟吗?Eclipse 中 Android 应用程序的 API 级别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3268055/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 09:23:18  来源:igfitidea点击:

Can you change min. API level for your Android app in Eclipse?

androideclipseapi

提问by Darius

I selected API minimum level 1.5 for my android app and I'm just about to integrate gestures in to it which came in 1.6. Is there a way in Eclipse to change the minimum level from 1.5 to 1.6 halfway through building an app?

我为我的 android 应用程序选择了 API 最低级别 1.5,我正准备将 1.6 中的手势集成到其中。在 Eclipse 中,有没有办法在构建应用程序的中途将最低级别从 1.5 更改为 1.6?

Many thanks

非常感谢

回答by Aurora

If you go into your Manifest file and set

如果你进入你的清单文件并设置

    <uses-sdk android:minSdkVersion="3" />

to

    <uses-sdk android:minSdkVersion="4" />

Then you will have changed your entire project from running 1.5 as a minimum to 1.6.

然后,您将整个项目从最低运行 1.5 更改为 1.6。

While you are still building your app, you can change the minimum API level at any time.

在您仍在构建应用程序时,您可以随时更改最低 API 级别。

回答by user3366032

Using Android Studio, you would find minSdkVersionin the build.gradlefile under appdirectory.

使用 Android Studio,您会在目录下minSdkVersionbuild.gradle文件中找到app

回答by David Ljung Madison Stellar

The answers regarding uses-sdk are no longer true in Intellij.

Intellij 中有关 uses-sdk 的答案不再正确。

Now <uses-sdk>is ignored in the AndroidManifest.xml, it is automatically added to the built manifest file. To change the version, go to the 'build.gradle' file and look at the minSdkVersion.

现在<uses-sdk>在 AndroidManifest.xml 中被忽略,它会自动添加到构建的清单文件中。要更改版本,请转到“build.gradle”文件并查看 minSdkVersion。

回答by Andy Zhang

Yes, go to your manifest and change <uses-sdk android:minSdkVersion="3" />to <uses-sdk android:minSdkVersion="4" />. Then go to Project > Properties > Android and change the Project Build Target to 1.6 to recognize new API code introduced in 1.6.

是的,转到您的清单并更改<uses-sdk android:minSdkVersion="3" /><uses-sdk android:minSdkVersion="4" />. 然后转到 Project > Properties > Android 并将 Project Build Target 更改为 1.6 以识别 1.6 中引入的新 API 代码。

回答by Balibrera

Change the following line in your AndroidManifest.xmlfile

更改AndroidManifest.xml文件中的以下行

    <uses-sdk android:minSdkVersion="8" />

Just think of minSdkVersion as your targeted API number.

只需将 minSdkVersion 视为您的目标 API 编号。

Keep in mind that this could cause some older devices not run your application.

请记住,这可能会导致某些较旧的设备无法运行您的应用程序。

回答by Ammar Andiko

In Intellij version of Android Studio, you can just go to Gradle Scripts>build.gradle(Module:app) then changing this line

在 Intellij 版本的 Android Studio 中,您只需转到 Gradle Scripts>build.gradle(Module:app) 然后更改这一行

minSdkVersion 12

minSdk 版本 12

to the number of version you desire.

到您想要的版本数。

回答by Vontonnie Fanadez

In Android Studio you will find the minSdkVersion/targetSdkVersion in the build.gradle (module:app)file under the Gradle Scripts Directory. Edit the build version here and then open the Manifest file to Synch the changes made.

在 Android Studio 中,您将在 Gradle 脚本目录下的 build.gradle (module:app) 文件中找到 minSdkVersion/targetSdkVersion。在此处编辑构建版本,然后打开清单文件以同步所做的更改。