Top Banner
Android App Development 3 30 April, 2015
16
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Android App Development 20150430

Android App Development 3

30 April, 2015

Page 2: Android App Development 20150430

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

Page 3: Android App Development 20150430

Edit res/layout/activity_my.xml

Add a ButtonBuilding a Simple User Interface

Add <Button> element

Page 4: Android App Development 20150430

Edit res/layout/activity_my.xml

Add a ButtonBuilding a Simple User Interface

Page 5: Android App Development 20150430
Page 6: Android App Development 20150430

activity_my.xml

strings.xml

go

go

Go

Go

Page 7: Android App Development 20150430
Page 8: Android App Development 20150430
Page 9: Android App Development 20150430

Weight Attribute

Page 10: Android App Development 20150430

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

Page 11: Android App Development 20150430

Only one view has a weight attribute

Weight Attribute

weight = 1(weight = 0)

width = 10dp

View A View B

Screen Width

10dpScreen Width – 10dp

Page 12: Android App Development 20150430
Page 13: Android App Development 20150430

weight = 1

weight = 0width = wrap_content

Page 14: Android App Development 20150430

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

Page 15: Android App Development 20150430

Building a Simple User Interface Add a Button Weight Attribute

Exercise1

Next Workshop Starting Another Activity …

Wrap Up for Today

Page 16: Android App Development 20150430

fin.