android app development 20150430

16
Android App Development 3 30 April, 2015

Upload: hideo-kadowaki

Post on 11-Aug-2015

164 views

Category:

Software


5 download

TRANSCRIPT

Android App Development 3

30 April, 2015

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

Last Workshop

Edit res/layout/activity_my.xml

Add a ButtonBuilding a Simple User Interface

Add <Button> element

Edit res/layout/activity_my.xml

Add a ButtonBuilding a Simple User Interface

activity_my.xml

strings.xml

go

go

Go

Go

Weight Attribute

Weight Attribute

A number that specifies the amount of remaining space each view should consume

weight = 2weight =

1

View A View B

fills 2/3 fills 1/3

Screen Width

Only one view has a weight attribute

Weight Attribute

weight = 1(weight = 0)

width = 10dp

View A View B

Screen Width

10dpScreen Width – 10dp

weight = 1

weight = 0width = wrap_content

Exercise 1

Application name: Exercise Minimum SDK: API8 Activity: Blank Activity Activity Name: MainActivity Layout

3 Buttons (SMALL, MEDIUM, LARGE)

2/9 3/9 4/9

Building a Simple User Interface Add a Button Weight Attribute

Exercise1

Next Workshop Starting Another Activity …

Wrap Up for Today

fin.