How to choose target API level when creating a new project in Android Studio?

这一生的挚爱 提交于 2019-12-25 14:13:31

问题


I am new to android development and Android Studio. I also have a physical device which runs android version 5.0.1. When I try to debug an app from Android Studio on my device I don't get the behavior as in the emulator.

My project's target API level (when I create it) is always 23 (Android 6.0 Marshmallow). Although the minimum API level is 17 (Android 4.2 Jelly Bean) I want to know how to set the target API level on project creation. Is this possible with the current version of Android Studio (1.4.1)?


回答1:


There is no way to choose the target API level using the New Project wizard in Android Studio currently (1.4.1). It should always be the latest version available anyway.

From http://developer.android.com/intl/es/training/basics/supporting-devices/platforms.html#sdk-versions:

To allow your app to take advantage of these changes and ensure that your app fits the style of each user's device, you should set the targetSdkVersion value to match the latest Android version available.

To modify it after project creation just edit the targetSdkVersion value in your build.gradle file.



来源:https://stackoverflow.com/questions/33517184/how-to-choose-target-api-level-when-creating-a-new-project-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!