Android 101: Super Duper Crash Course FTW
Android 101: Super Duper Crash Course FTW
Prerequisites
Android Studio
https://developer.android.com/sdk/install
ing/studio.html
Java JDK
http://www.oracle.com/technetwork/jav
a/javase/downloads/jdk7-downloads-188
0260.
htm
Disclaimer
I am not a Java geek
I am an Android and open source
geek
I do Java because of Angry Birds
And stickers
The Basics
Based on Linux
Android stack
Linux kernel
Libraries & runtime (dalvik, libstreaming,
libc)
Application framework (location
services, battery services, resource
manager)
Applications
// TODO
Activities
Services
Intents
Layouts
Models
ArrayAdapters
Listeners
Debugging
Activities
The activity displays the layout and
provides the user interface
Services
Services run in the background, and
do not have a user interface
Example services
Location
Notifications
Downloads
Updates
Intents
An intent launches an activity
Can be launched from the Android
Manifest when app starts, OR from
within the app
Layouts
XML
The layout holds the UI components
Models
Class that represents an object
Has its own variables and
getter/setter functions
Example
Restaurant
id
name
address
ArrayAdapter<Restaurant>
Takes <Restaurant> data, and
adapts it to a ListView
See RestaurantAdapter in the example
Key components
getView
holder
Listeners
Used to notify the application of
specific events
Examples
onClick
onTouch
onLongClick
onKey
Debugging
Lab
Goal:
Create a new activity and layout with a ListView
Make new activity the default activity on launch
(hint: Constants.java)