Android Development - Part 1
Android Development - Part 1
Introduction to
Android Development
Part 1
So, you wanna build an app?
Konrad Grski
JLC Gdask
fb.com/konradgrski
twitter.com/konrad_gorski
JLC Gdask
Co-creator of Split It!
Introduction
The System
The Tools
The Apps
Why Android?
Popularity
Availability
Community support
Introduction
The System
The Tools
The Apps
What is Android?
An OS
A framework
Linux kernel
Runtime
Android ecosystem:
Google Services
(Dalvik VM + libraries:
WebKit, Media, SQLite etc.)
End-user apps
What is Android?
E
V
!
CPU architectures
LI
A
Vendor add-ons
Screen sizes
IT
Platform versions
Fragmentation
API 16-18
API 19
API 14-15
http://developer.android.com/about/dashboards/index.html
API 9-10
Introduction
The System
The Tools
The Apps
Getting started
Google android sdk
developer.android.com/sdk/
Download & unpack the ADT Bundle
Run eclipse
Whats inside?
Eclipse - the IDE
Android SDK
System image (for emulator)
Emulator instance
Running my app
Physical device
Fast, compatible
Hardware features
Emulator
Different screen sizes
Host GPU / HAXM / GenyMotion if too sluggish
Logcat
Useful debugging tool:
Log.d(MyActivity, App launched!);
Quick question #1
You used an API method from API14. You run
the app on an API10-device. What happens?
A. nothing
B. app crashes
C. it wouldnt even compile
Quick question #1
You used an API method from API14. You run
the app on an API10-device. What happens?
A. nothing
B. app crashes
C. it wouldnt even compile
LINT error
Introduction
The System
The Tools
The Apps
General considerations
Mobile app?
Always ready to wrap up
Part of the environment
Highly context-dependent
General considerations
Mobile app?
Always ready to wrap up
Part of the environment
Highly context-dependent
General considerations
Mobile app?
Always ready to wrap up
Part of the environment
Highly context-dependent
First project
First project
Warning: Scumbag Wizard
image: quickmeme.com
Whats inside?
src
source (.java)
res
libs
assets
XML resources
Layouts
layout/my_super_layout.xml
layout-land/my_super_layout.xml
Translations
values/strings.xml
values-es/strings.xml
Drawables
Dimensions
Animations
Parts of an app
Activity
View
Activity
View
View
UI
Intent
Non-UI
Fragment
Broadcast
Intent
Service
BroadcastReceiver
ContentProvider
Fancy a break?
Back in 10 minutes!
io
ns
t
s
e
s
o
P
u
q
t
if
u
o
y
v
a
h
y
an
Activity
Activity
The lifecycle
Whole-screen UI
controller
Views organized in
layouts
Manages Fragments
onCreate
Peculiar lifecycle
onStart
onResume
onPause
onStop
onDestroy
View
UI control
Inflated from XML or created in Java
Can be nested (tree)
ListView
Button
img: developer.android.
RelativeLayout
FrameLayout
Quick question #2
Q: Can an app have no UI at all?
Quick question #2
Q: Can an app have no UI at all?
A: Yes!
Our app
Network status
change
System
broadcast
BroadcastReceiver
Service
Intents:
Explicit: Intent(this,
MyNextActivity.class);
Implicit: Intent(Intent.ACTION_VIEW);
Extras
Summary
Android development - more than coding
Activities and fragments host UI behavior
Think of layouts in functional terms
Intents express where you want to go
Question time!