阅读116 返回首页    go 阿里云 go 技术社区[云栖]


Android studio使用教程

Android Studio 是一个全新的 Android 开发环境,基于 IntelliJ IDEA. 类似 Eclipse ADT,Android Studio 提供了集成的 Android 开发工具用于开发和调试,在 IDEA 的基础上.

首先我们需要下载android studio

android studio下载

很显然的IntelliJ IDEA的样貌,下面是一些截图:

android studio使用教程

选择了“New Project”

android studio使用教程

给工程和包起个名字

android studio使用教程

创建自定义图标

android studio使用教程

选择工程类型

android studio使用教程

给工程定个名字

android studio使用教程

开始创建。

向导基本上和Eclipse差不多。不过这个创建过程可比Eclipse上长的多。主要是因为从gradle上下载。

工程的结构和Eclipse上的不同,src下分为java和res

android studio使用教程

可以直接选择ADT中配置好的Emulators

android studio使用教程

运行还是在已有的Emulator上。

下面是导入的界面:

选择一个工程

android studio使用教程

然后是询问从哪里导入

android studio使用教程

然后是设定名字和路径

android studio使用教程

选择库

android studio使用教程

选择工程模块

android studio使用教程

选择库

java的

android studio使用教程

android的

android studio使用教程

但是有两个jar文件没找到——前瞻版里没有这个文件,只好找以前安装的包里的同名文件

android studio使用教程

询问AndroidManifest.xml文件

android studio使用教程

询问是否加入Git

android studio使用教程

工程结构,和Eclipse上的一样。

android studio使用教程

模拟器半天没起来,用Eclipse启动了模拟器,Android Studio的DDMS又找不到设备,

然后重新尝试,又起来了。DDMS的样子,和Eclipse上的一样。

android studio使用教程

发布仍然不成功:下面是控制台Log。

Waiting for device.
"/Applications/Android Studio.app/sdk/tools/emulator" -avd Nexus -netspeed full -netdelay none

WARNING: Data partition already in use. Changes will not persist!
WARNING: SD Card image already in use: /Users/stephenwang/.android/avd/Nexus.avd/sdcard.img
WARNING: Cache partition already in use. Changes will not persist!
emulator: emulator window was out of view and was recentered

Device connected: emulator-5556
Device is online: emulator-5556
Target device: emulator-5556 (Nexus)
Uploading file
local path: /development/workspace/KingOfAir/out/production/KingOfAir/KingOfAir.apk
remote path: /data/local/tmp/com.octrois.koa
Installing com.octrois.koa
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.octrois.koa"
Device is not ready. Waiting for 20 sec.
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.octrois.koa"
Device is not ready. Waiting for 20 sec.

终于起来了,就是一个字:慢!

android studio使用教程



最后更新:2017-04-03 12:56:20

  上一篇:go Subqueries are not allowed in this context. Only scalar expressions are allowed.
  下一篇:go Android开发小白日记2 (20 Apr) 关于Fragment