Escolar Documentos
Profissional Documentos
Cultura Documentos
1
Mobile Eco-System
Content Providers
(Music/Video/Books)
Ad Networks App.
Distribution
Platform
Billing
2 R. Vasa, 2011
Android Eco-System
Content Providers
(Music/Video/Books) Google, Amazon
App.
Ad Networks ** Distribution
Google, Amazon
3 R. Vasa, 2011
Focus of this talk...
Content Providers
(Music/Video/Books) Google, Amazon
App.
Ad Networks ** Distribution
Platform Billing
Google, Amazon
4 R. Vasa, 2011
Talk Overview
• Devices
• What is Android?
• Development Tools
• What is Android?
6 R. Vasa, 2011
Android Device User Interaction
Back Home
7 R. Vasa, 2011
Vendors can add additional buttons
8 R. Vasa, 2011
There are variations in physical form
Home
10 R. Vasa, 2011
Back Button
• This will take you back to the previous screen
Personal Opinion:
Back iPhone / iPad should
borrow this button
11 R. Vasa, 2011
Menu Button
• Shows a contextual menu (if one is available)
• Low Discoverability
12 R. Vasa, 2011
Android for tablets is slightly different...
Action Bar
Back, Home
(Buttons need not be physical in Android)
13 R. Vasa, 2011
Tablet Menu Icon Visibility is contextual
Menu
• What is Android?
• Development Tools
Applications
Frameworks
Android
API
Operating System
(Customised Linux Kernel)
16 R. Vasa, 2011
Android
Programming languages: Java, C/C++
≠
Android Java is not 100% Sun Java
19 R. Vasa, 2011
Android Java is different (in many ways)
No RMI
No Bytecode
No AWT / Swing UI
20 R. Vasa, 2011
Roadmap - Where are we?
• Devices
• What is Android?
• Development Tools
• Powerful debugger
• Visual UI Builder
• Ant (Build System)
22 R. Vasa, 2011
Eclipse IDE
23 R. Vasa, 2011
Eclipse IDE - Graphical UI Editor
24 R. Vasa, 2011
Android Emulator
25 R. Vasa, 2011
Emulator is nice .. but phone is better
• The emulator runs the Android O/S (you can
run any version: 1.6 to 3.0)
• Itevents
however offers ways to simulate these
26 R. Vasa, 2011
Emulators Vs Simulator
• iOS offers a simulator
27 R. Vasa, 2011
If your Java is rusty
28 R. Vasa, 2011
Roadmap - Where are we?
• Devices
• What is Android?
• Development Tools
Convention
Configuration
31 R. Vasa, 2011
Needs Resources @Multiple Resolutions
Convention
High
Low
Medium
32 R. Vasa, 2011
Roadmap - Where are we?
• Devices
• What is Android?
• Development Tools
34 R. Vasa, 2011
What is involved?
• Place UI controls (Text and Image)
• Centre text
• Make text large font
• Display Image to take up all space
35 R. Vasa, 2011
Each Screen is an Activity
• Android app. is made up of Activities
Activity
36 R. Vasa, 2011
Views are Android’s Key UI Building Block
• We need two views on the Activity
TextView
ImageView
37 R. Vasa, 2011
Views are Placed inside a View Group
• Different types of pre-defined layouts
a.k.a Layout
38 R. Vasa, 2011
Android App. - Building Blocks
39 R. Vasa, 2011
Separation of Concerns in Android
Presentation Functionality
40 R. Vasa, 2011
UI (Layout) Definition
• Layout definition is generally in an XML file
41 R. Vasa, 2011
Android Offers a number of UI Controls
• Offers all standard controls and lot more...
Progress
These are
a small
subset of
available
controls
42 R. Vasa, 2011
View Groups and Layouts
• Android offers the following View Groups,
• Relative Layout ( )
Position relative to other Views
• Conventions
• Layout Defined in /layout/main.xml
• Resources Placed in /res/drawable-*
• String values defined in/values/strings.xml
44 R. Vasa, 2011
Resources
Resources in “res”
Convention
45 R. Vasa, 2011
Resources are given a unique ID
A unique reference id
to resources is
generated by the
Android SDK tools
Convention
46 R. Vasa, 2011
Resources and Generated IDs
Generated Code
47 R. Vasa, 2011
A Reference to Layout also Generated
48 R. Vasa, 2011
Identifiers are used to access resources
This is the Activity Class
View Group
(Layout)
Layout Definition
(main.xml)
50 R. Vasa, 2011
Who writes the Activity code?
51 R. Vasa, 2011
Activity Creation
52 R. Vasa, 2011
Activity Creation - Layout Rendering
54 R. Vasa, 2011
Application Manifest File
Application Icon Reference
String constant
58 R. Vasa, 2011
Using Graphical Resources
• How did the Australia image get into layout?
@drawable/australia
@drawable/bots
60 R. Vasa, 2011
@ Tag and Multiple Screen Resolutions
• Dealing with multiple screen resolutions
@drawable/icon
62 R. Vasa, 2011
Roadmap - Where are we?
• Devices
• What is Android?
• Development Tools
64 R. Vasa, 2011
Views
TextView
EditText
Button
TextView
main.xml
(Layout)
66 R. Vasa, 2011
View Identifiers
• We need a way to identify components that
we created in the layout
67 R. Vasa, 2011
UI Interaction Handling Pattern
• Component.setOn......Listener ( handler )
• E.g. button.setOnClickListener
• Handler is an anonymous inner class
68 R. Vasa, 2011
UI Interaction Handling Pattern
The View identifiers
are defined in XML
69 R. Vasa, 2011
Roadmap - Where are we?
• Devices
• What is Android?
• Development Tools
Select
Back
71 R. Vasa, 2011
Activities are Stacked in Android
• All current activities are placed on a Stack
• Newly started activities come into foreground
Foreground/Active
Contact Details
Back button will
Background/
pop top most starts
Paused
activity from stack Contact List
72 R. Vasa, 2011
Activities are like mini-processes
• Android activities have their own life cycle
• Asynchronous Messaging
Communication between Activities is done by
message
Contact List Contact Details
73 R. Vasa, 2011
Async. messaging called “Intents”
intent
Contact List Contact Details
74 R. Vasa, 2011
Async. messaging called “Intents”
• What is Android?
• Development Tools
Application
Activities have a
parent application
Activity-A
Activity-B
Activity-C
Activity has Life Cycle
Application is NOT managed
directly by the O/S
Life Cycle is Managed by Android Framework
77 R. Vasa, 2011
Android Activity Life Cycle
78 R. Vasa, 2011
Security -- Android Devices
has
User UID (User ID)
also has determines
79 R. Vasa, 2011
A Short Plug!!!
80 R. Vasa, 2011
Mobile Development @ Swinburne
• HIT8328 - Software Development for
Mobile Devices
• Android focused
• HIT8329 - Creating Data Driven Mobile
Applications
We Offer
• iOS focused Options to Study
• Portfolio Based Assessments Just One Subject
• We do not just cover API -- there is a strong
conceptual foundation (prepare you to learn)
•Applications
HIT8329 - Creating Data Driven Mobile
82 R. Vasa, 2011