Android Tutorial Handout

Post on 21-Apr-2015

54 views 0 download

Transcript of Android Tutorial Handout

9/21/10

1

9/21/10

2

9/21/10

3

Example  taken  from  Dan  Borenstein’s  2008  GoogleIO  presentation:  http://sites.google.com/site/io/dalvik-­‐vm-­‐internals  

9/21/10

4

9/21/10

5

9/21/10

6

User  presses  button  in  one  app,  and  it  causes  an  activity  defined  by  another  app  to  run!    

The  invoking  app  is  put  on  the  “stack”  and  when  the  user  hits  the  “back”  button,  it  is  restored.    

Activity  #1  

Activity  X  

Activity  Y  

Activity  Z  

Step  1:  An  activity  signals  an  intent.   Step  2:  Android  determines  

which  available  activity  is  most  appropriate  for  handling  that  intent.  

9/21/10

7

JDK v6 Eclipse 3.5

Android SDK ADT Plugin

Required Components

Optional Components

9/21/10

8

See http://developer.android.com/sdk/index.html for details.

See http://developer.android.com/sdk/index.html for details.

a) Download the appropriate package for your computer.

b) Unpack archive contents on your hard disk.

c) Adjust your system’s PATH variable (details on next slide)

Details vary by platform:

See http://developer.android.com/sdk/index.html for details.

9/21/10

9

See http://developer.android.com/sdk/index.html for details.

See http://developer.android.com/sdk/index.html for details.

See http://developer.android.com/sdk/index.html for details.

9/21/10

10

DEMO

9/21/10

11

ViewGroup uses the Composite design pattern to enable grouping of multiple View objects into non-trivial user interfaces.

In order to render a “view tree” on the device’s screen an Activity must call the setContentView() method.

9/21/10

12

The normal way to create user interfaces in Android apps is to declaratively describe the UI in an XML layout file, though UI’s can also be created programmatically in code.

9/21/10

13

9/21/10

14

DEMO

9/21/10

15

9/21/10

16

DEMO

9/21/10

17

9/21/10

18

9/21/10

19

9/21/10

20

DEMO

9/21/10

21

IntroActivity.java 117-135 (commit c27e6)

9/21/10

22

[commit fa7e] [commit c27e]

9/21/10

23

DEMO

9/21/10

24