Anda di halaman 1dari 14

HNG DN TI V CI T ANDROID DEVELOPMENT

Gii Thiu
y l bi Hng Dn CI T MI TRNG V CNG C LP TRNH ANDROID

bao gm 8 Phn:

PHN A : Ci t JDK
PHN B: Ci t ECLIPSE
PHN C: Ci t ANDROID SDK
PHN D: Ci t ADT
PHN E: Bt Cu Cho ECLIPSE V ANDROID
PHN F: Ci Cc Phin Bn ANDROID Lp Trnh
PHN G: Ci AVD
PHN H: Chy V Test Th My o ANDROID

Lu : Cc version ca cc hnh nh bn di c th khng ng do version


c cp nht lin tc, bn nn chn version mi nht ca website

1 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


PHN A: Ci t JDK
JDK (Java Development Kit) bao gm JRE (Java Runtime Environment) n l nn ta c th
lp trnh java.

Bc 1: download JDK truy cp a ch:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Bc 2 : Click vo hnh ca mc Java Platform (JDK) nh hnh di:

2 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


Bc 3: Trang tip theo hin ra, cun xung mt cht, Click vo radiobutton Accept
License Agreement. Chn vo file.exe ca mc Windows x86 (32-bit). (Hoc cc mc
khc ty theo my ca bn).
Xem hnh:

Bc 5: Sau khi download xong, click jdk-8u40-windown-x64.exe ci t.

3 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


PHN B: Ci t Eclipse.
L cng c son tho vi giao din thn thin gip chng ta bin dch v xy dng chng
trnh trn mi trng java

Bc 1: download, truy cp t a ch:


https://eclipse.org/downloads/

Bc 2: Trn trang web ta chn bn Eclipse IDE for Java Developer (155M), (bn 32-
bit hay 64-bit , ty theo my ca bn) nh hnh di.

Bc 3: Sau khi download xong ta gii nn file mi ti (vd: eclips-java-luna-SR2-


win32.zip) thnh th mc Eclipse. Chp th mc vo ni bn mun.

Bc 4: Chy chng trnh Eclipse bng cch nhp p file eclipse.exe trong th
mc va gii nn. (Eclipse khng cn ci t)

Xong bc 1 v bc 2 ta c mi trng lp trnh Java v tool vit l Eclipse. Tip


theo ta ci Android

4 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


PHN C : Ci t ANDROID SDK
Android SDK (Androi Software Development Kit) l nn lp trnh Android.

Truy cp a ch:

http://developer.android.com/sdk/index.html

V download bn installer mi nht (xem hnh) ri tin hnh ci t:

Sau khi ci xong s c th mc C:\Program Files\Android.

5 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


PHN D: Ci t ADT
Android Development Tools (ADT) l plugin ca Eclipse IDE c thit k nhm cung cp
cho lp trnh vin mi trng tch hp mnh m xy dng cc chng trnh Android trn
Eclipse.

Bc 1: Ti ADT v y :
http://developer.android.com/sdk/installing/installing-adt.html

Bc 2: M Eclipse chn Help -> Install new software.

Bc 3: Chn nt Add m Hp thoi Add Repository.

6 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


Bc 4: Trong hp thoi va m, mc name nhp vo mt ci tn. Vd: myADT. Mc
Location nhp vo ng dn ADT ti v ri chn OK

Bc 4: Quay v chn Select All sau next ti finish

7 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


8 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B
PHN E : Bt Cu Cho ECLIPSE V ANDROID

Bc 1: M Eclipse Chn Window -> Preferences -> Android


Bc 2: Trong th mc SDK Location dn ng dn ti th mc Android PHN C

9 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


PHN F : Ci Cc Phin Bn ANDROID Lp Trnh
Android c nhiu phin bn nh Android 1.6, 2.2, 3.2, 4.0khi vit chng trnh ta phi chn s
pht trin trn version no ca Android, v ta phi ci phin bn vo mi lp trnh c

Trong Eclipse chn Window -> Android SDK Manager

Trong hp thoi check cc phin bn mun ci ri chn Install packages

10 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


PHN G : Ci AVD
Android Virtual Device (AVD) l cc my o Android. Cho php ta chy mt my gi lp Android
trn PC phc v cho vic kim tra ng dng ta ang vit.

Bc 1: Trong Eclipse chn Windown - > AVD Manager.

Bc 2: Chn nt Creat to mt my o mi

Bc 3: Trong ca s to mi AVD. Mc name nhp vo tn ty . Mc


Target Chn version cho my o (version ny ci Phn F).
Mc SD chn g 1024 v mc Skin chn mt trong s cc skin m Eclipse c, y ti
chn QVGA. Sau khi chn xong nhn nt OK

11 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B


12 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B
PHN H (Phn cui cng): Chy V Test Th My o ANDROID

Bc 1 : Trn Eclipse chn Window -> AVD Manager

Bc 2: Trn hp thoi Android Virtual Manager chn vo my o ri chn Start

Bc 3: Hp thoi Launcher m ra, chn nt launcher chy my o


13 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B
Lu :

Thi gian chy my o hi lu. Sau khi ln c nh hnh, tc l my o chy


xong. Lc ny ta c th chy chng trnh.Ta khng cn tt my o sau mi ln
chng trnh chy xong . C vic chn biu tng Run my o s t chy chng
trnh

14 Trung Tm o To Tin Hc Khoa Phm | Lu Hnh Ni B