android app development 20150409

15
Android App Development 2 9 April, 2015

Upload: hideo-kadowaki

Post on 09-Aug-2015

147 views

Category:

Software


0 download

TRANSCRIPT

Android App Development 2

9 April, 2015

Set Up Development Environment

Creating an Android Project Running your app

Run on a Real Device

Last Workshop

1. Run on a Real Device2. Run on the Emulator*

Running Your App

← Today

* hardware or software that enables one computer system to behave like another computer system

Create an AVD (Android Virtual Device) *1. Select Tools > Android > AVD

Manager or click2. Click Create Virtual Device3. Select Nexus 6 and click Next4. Select the desired system version for the

AVD and click Next5. Verify the configuration settings, then

click Finish

Run on the EmulatorRunning Your App

* a device configuration for the Android emulator

Run the app from Android Studio1. Click Run2. Choose Launch emulator3. Select the emulator you created

from the pull-down menu, and click OK

Run on the EmulatorRunning Your App

Building a Simple User Interface

View / ViewGroup

View ContainerDefine how the child views are laid out

UI widgetButton, Text Field etc.

Building a Simple User Interface

ViewGroup LinearLayout

Lay out child views in eithera vertical or horizontal orientation

View Text Field Button

Layout

LinearLayout

ButtonText Field

Building a Simple User Interface

Edit res/layout/activity_my.xml

Create a Linear LayoutBuilding a Simple User Interface

“vertical” or “horizontal”

Edit res/layout/activity_my.xml Add the following between

<LinearLayout …> and </LinearLayout>

Add a Text FieldBuilding a Simple User Interface

The view should be only as big as needed to fit the contents of the view.A default string to display

when the text field is empty.

Edit res/values/strings.xml

Add String ResourcesBuilding a Simple User Interface

activity_my.xml

strings.xml

Running your app Run on the Emulator

Building a Simple User Interface View / ViewGroup Create a Linear Layout Add a Text Field Add String Resources

Next Workshop Add a Button …

Wrap Up for Today

Follow the link and read the articles Real Device vs Emulator

http://www.guru99.com/real-device-vs-emulator-testing-ultimate-showdown.html

Android Layouts http://www.androidhive.info/2011/07/android-

layouts-linear-layout-relative-layout-and-table-layout/

Assignment

fin.