我花了一天的时间试图将所有部分放在一起,在数百个站点和教程中,但它们都跳过了微不足道的步骤.
I've spent a day on trying to put all the pieces together, been in hundreds of sites and tutorials, but they all skip trivial steps.
这里是完整指南:
- 下载并安装 Java JDK(选择Java平台)
- 下载并安装 Android SDK(推荐安装程序)
- android SD安装完成后,在Android SDK Tools下打开SDK Manager(有时需要在管理员权限下打开)
- 选择所有内容并标记全部接受并安装.
- 下载并安装 IntelliJ IDEA(社区版是免费的)
- 等待所有下载和安装完成.
- Download and install Java JDK (Choose the Java platform)
- Download and install Android SDK (Installer is recommended)
- After android SD finishes installing, open SDK Manager under Android SDK Tools (sometimes needs to be opened under admin's privileges)
- Choose everything and mark Accept All and install.
- Download and install IntelliJ IDEA (The community edition is free)
- Wait for all downloads and installations and stuff to finish.
新项目:
- 运行 IntelliJ
- 创建一个新项目(这里有一个教程)
- 输入名称,选择Android类型.
- 教程中遗漏了一个步骤,当您被要求选择 JDK(在选择 SDK 之前)时,您需要选择您已安装的 Java JDK早些时候.应该在
C:Program FilesJavajdk{version}
下- 选择一个新平台(如果没有选择),SDK 平台是
C:Program FilesAndroidandroid-sdk-windows
中的 android 平台.
- 选择安卓版本.
- 现在您可以编写程序了.
- Run IntelliJ
- Create a new project (there's a tutorial here)
- Enter the name, choose Android type.
- There's a step missing in the tutorial, when you are asked to choose the JDK (before choosing the SDK) you need to choose the Java JDK you've installed earlier. Should be under
C:Program FilesJavajdk{version}
- Choose a New platform ( if there's not one selected ) , the SDK platform is the android platform at
C:Program FilesAndroidandroid-sdk-windows
.
- Choose the android version.
- Now you can write your program.
编译:
- 在您需要选择下拉列表的运行按钮附近,选择编辑配置
- 在首选 Android 虚拟设备中选择...按钮
- 单击创建,为其命名,然后按确定.
- 双击新设备以选择它.
- 按确定.
- 您已准备好运行该程序.
- Near the Run button you need to select the drop-down-list, choose Edit Configurations
- In the Prefer Android Virtual device select the ... button
- Click on create, give it a name, press OK.
- Double click the new device to choose it.
- Press OK.
- You're ready to run the program.