02.1 - getting started with android

36
02.1. Getting Started Android Oum Saokosal Master of Engineering in Information Systems, South Korea 855-12-252-752 [email protected]

Upload: oum-saokosal

Post on 13-Apr-2017

178 views

Category:

Education


0 download

TRANSCRIPT

02.1. Getting Started Android

Oum SaokosalMaster of Engineering in Information Systems, South Korea

[email protected]

System Requirements for Android

• System Supported:– Windows XP, Vista, 7, 8– Mac OS X 10.4.8 or later (x86 only)– Linux (tested on Linux Ubuntu Dapper Drake)

• Android Developer Tools*http://developer.android.com/sdk/index.html

• JDK 6 or later

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

Android Developer Tools

Android Developer Tools (Eclipse + Android SDK)

Android Developer Tools

Update New SDKTo update, go to menu:1. Window2. Android SDK Manager

Create HelloWorld Project

Create HelloWorld Project

File > New > Android Application Project

Understanding ADT

Structure of Android App

A controller contained java codes

In bin folder, there is the apk file.

Image folders

The layout is a user interface(UI)Menu is for a menu

Configuration file

Layout (activity_main.xml) - UI

Layout (activity_main.xml) - Code

MainActivity.java

Run a Project

Run a Project

• Before running a project, you need to add two important panels:1. Window -> Show View -> Console2. Window -> Show View -> Other -> LogcatThese panels help you to see the errors.

Configure Run

• Menu Run-> Run Configuration• Right click on Android Application -> New

-> Click Browse

-> Choose HelloWorld

-> Change Name to HelloWorld

-> Click Target tap-> Click Manager button

-> Click New Button

In case you want to create your own customized device:In case you want to create your own customized device:

Configure it like your device:

Please note that it takes some times to create the AVD.

So please be patient!

-> Click Run Button

After waiting…

Output apk from Android Device

apk = Android PackageAn apk is the only file needed to installon your real android device!

Run apk onto a Real Android Device

Run Directly on a Connect Device

1. On your android device, go to setting -> locate and tick on "USB Debugging " that mostly in Developer options

2. Connect your device to a computer, and might installed a correct driver

3. In Eclipse, configure run again:

4. Click Run to directly run on your real device.5. If it is not working, check step 1 again.

Install apk into Android Device

1. Copy your app, e.g. HelloWorld.apk, into your Android device.

2. On your device, go to Setting -> More-> Security-> Unknown Sources

3. Browse the app in your device, then click to install.

Go on to the next slide