25
Induction Into the Android Army Tom Opgenorth | [email protected]

Induction into the Android Army

Embed Size (px)

Citation preview

Page 1: Induction into the Android Army

Induction Into the Android Army

Tom Opgenorth | [email protected]

Page 2: Induction into the Android Army

A Word From Our Sponsors

Page 3: Induction into the Android Army

1. Getting Started 2. Android Architecture 3. Parts of an Android Application 4. Look at Code!

Things We’ll Talk About

Page 4: Induction into the Android Army

What Involved

Getting Started

Page 5: Induction into the Android Army

1. Download the Android SDK & Java 2. Get an IDE 3. Emulators & Devices 4. Google Developer Account

Writing Android Apps

Page 6: Induction into the Android Army

❖ Only an approximation ❖ Emulators don’t replace devices ❖ Google’s emulator sucks

A Word About Emulators

❖ Genymotion is a “better” emulator

Page 7: Induction into the Android Army

So What Kind of Device?❖ So Many To Choose From ❖ Try to get one you can “root” ❖ Prefer Nexus devices from Google ❖ Make sure you enable “Developer

Mode”

Page 8: Induction into the Android Army

What does Android Look like under the Hood?

The Android Operating System

Page 9: Induction into the Android Army
Page 10: Induction into the Android Army

❖ Distinct components with specific roles

❖ Adaptable to many different forms and purposes

Android App Architecture

Page 11: Induction into the Android Army

❖ Activity.Equals(Screen) ❖ Displays all UI Elements for an app ❖ XML for layout files ❖ UI can be decomposed into

Fragments

Activities

Page 12: Induction into the Android Army

Activities & Fragments

Page 13: Induction into the Android Army

❖ A component that performs long running operations in the background

❖ No User Interface ❖ Can be “bound” to other applications

Services

Page 14: Induction into the Android Army

Intents

Pick  Photo

Call  Mom

Edit  

Contact

View  Web  Page

Get  GPS  

Loca>on

Play  Song

Send  Email

Start  App

Send  TweetView  

Map

View  

Video

Browse  Market

Capture

 

Video

Capture

 

Photo

Edit  Calendar

Page 15: Induction into the Android Army

❖ Listens for messages ❖ Tells Android what to to in response

to message

Broadcast Receiver

Page 16: Induction into the Android Army

Content Provider❖ One structured way to share data

between applications. ❖ Not just databases: files, photos,

contacts, and more ❖ Uses an Android URI to reference

content

Page 17: Induction into the Android Army

❖ A - Identifies this is for content ❖ B - Authority (who owns this data) ❖ C - A “query” to help identify where to find the content ❖ D - an ID that identifies a particular piece of content

Content Provider

Page 18: Induction into the Android Army

The Manifest File

AndroidManifest.xml

Broadcast Receivers Content Providers

Intents Activities

App meta-data

Page 19: Induction into the Android Army

❖ Non-code files and static content that your app uses.

❖ Different resources for different devices

❖ Android decides what to use ❖ Default vs Alternate Resources

Resources

Page 20: Induction into the Android Army
Page 21: Induction into the Android Army
Page 22: Induction into the Android Army

Building an APK - Simplified

Page 23: Induction into the Android Army

Show Me The Code!

Page 24: Induction into the Android Army

❖ Android - http://developer.android.com ❖ Genymotion - http://www.genymotion.com

Links / References

Page 25: Induction into the Android Army

Thank You!Questions?