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
Open up Android Studio
Tools Android SDK Manager
Android SDK Build Tools 19.1 and 20
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
Apps written using Java and XML
// 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
Importing Your Project
VCS Checkout from Version Control
https://github.com/shortstack/CrashCourse.
git
Lab
Goal:
Create a new activity and layout with a ListView
Make new activity the default activity on launch
(hint: Android Manifest)
Add another API endpoint
(hint: Constants.java)
Create a model from new endpoint data
Add a service to get data from new endpoint
Using provided API helper classes, display list of
new endpoint data in ListView
http://shortstack.github.io/crashcourse/