閱讀116 返回首頁    go 微軟 go windows


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