M.Sc. Bui Tan Loc: Module 2: Getting Started With Android Development
M.Sc. Bui Tan Loc: Module 2: Getting Started With Android Development
Department of Software Engineering, Faculty of Information Technology, University of Science Ho Chi Minh City, Viet Nam
.
Objectives
corresponding different platforms About DDMS tools About how to debug an application About changing xml resource file by GUI or Text editor.
Contents
Getting to install the Android development environment Getting to know Android SDK tools Getting to know Android project structure Getting to know how to run with the default emulator Getting to know how to run with the specified emulator Getting to know DDMS tools Getting to know how to debug with the default emulator Getting to know how to change xml resource files
Supported OS:
JDK
Pre-requirement:
1. Installing Editor:
Note that you need to refer to the SDK directory (In Windows OS,
Installing JDK
http://www.oracle.com/technetwork/java/javase/downlo
ads/index.html Ex:
The installation directory is c:\Program Files\Java\ The JDK folders path is c:\Program Files\Java\jdk1.6.0_17
http://www.eclipse.org/downloads/ Ex: At
The installation directory is d:\Program Files\ The Eclipse folders path is d:\Program Files\eclipse\
Ex: The workspace folder is d:\Program Files\eclipse\workspace\ Ex: File > Switch workspace > Other
the first time launching Eclipse, you must select a workspace folder to store your projects.
http://developer.android.com/sdk/index.html Ex:
windows\
The installation directory is d:\Program Files\Android\ The SDK folders path is d:\Program Files\Android\android-sdk-
http://developer.android.com/sdk/eclipse
adt.html#installing
Start Eclipse, then select Help > Install New Software.... Click Add, in the top-right corner. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ Click OK Note: If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https"
(https is preferred for security reasons).
In the Available Software dialog, select the checkbox next to Developer Tools and click Next. In the next window, you'll see a list of the tools to be downloaded. Click Next. Read and accept the license agreements, then click Finish. Note: If you get a security warning saying that the authenticity or validity of the software can't be
established, click OK.
http://developer.android.com/sdk/eclipse-adt.html#installing
10
open the Preferences panel (Mac OS X: Eclipse > Preferences). Select Android from the left panel. You may see a dialog asking whether you want to send usage statistics to Google. If so, make your choice and click Proceed. You cannot continue with this procedure until you click Proceed. For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory. Click Apply, then OK.
11
12
SDK
AVD
Start Eclipse, then Select Android SDK Manager Or launch SDK Manager.exe in Android SDK folder
(Android Virtual Device) Manager is used for creating emulators corresponding to the selected platforms.
Start Eclipse, then Select AVD Manager Or launch AVD Manager.exe in Android SDK folder
13
14
15
If above things are be ready-towork. You will run the HelloWorld Application successfully. http://developer.android.com/res ources/tutorials/hello-world.html
16
Right
click the project root, then select Properties > Android > select the platform you want.
18
Run
19
20
21
control your Android Emulator. In Eclipse, click on the Open Perspective button and select DDMS or select Other/DDMS.
22
23
24
25
Insert breakpoint
26
Debug tools
27
Debug tools
28
Getting to know how to change xml resource file: main.xml, string.xml, and AndroidManifest.xml
29
30
31
Questions or Discussions
How to install a new Android platform How to create an Android emulator How to run an Android application
with different emulators corresponding different platforms How to emulate voice calls, SMS messages, and GPS functionalities How to debug an Android application with different emulator corresponding different platforms How to modify xml files in the Android project
32
Getting Started with Android Development: Managing AVDs with AVD Manager:
avds.html
android-development
http://developer.android.com/sdk/installing.html
http://developer.android.com/guide/developing/devices/emulator.h
. 33
Creating an Android Application using the Eclipse Plugin Adding an External Library (.jar) using Eclipse
ddexternallibrary
http://developer.android.com/resources/faq/commontasks.html#n
eweclipseandroidproject
http://developer.android.com/resources/faq/commontasks.html#a http://developer.android.com/resources/faq/commontasks.html#lo
calhostalias
34