Android Apps for Absolute Beginners

28
Android Apps for Absolute Beginners Vaclav Hnizda [email protected]

description

This is a talk to give insight into how to approach programming for Android.

Transcript of Android Apps for Absolute Beginners

Page 1: Android Apps for Absolute Beginners

Android Apps for Absolute Beginners

Vaclav [email protected]

Page 2: Android Apps for Absolute Beginners

Who am I?Vaclav HnizdaBackground● BS in Music Education - 2005 ● MS in Software Engineering - 2014● First coded in ‘98 in QBasic! ● Currently focus in Java & Android● Attended Google IO - 2012

Met Vic GundotraSenior VP of Google Engineering

Contact● email: [email protected]● linkedin: www.linkedin.com/in/vaclavhnizda● twitter: @Vaclav_Moravak

Page 3: Android Apps for Absolute Beginners

Android Past● Dalvik VM on top of Linux-based OS

● designed with touch mobility in mind

● Initially developed by Android, Inc., backed by Google

● In 2005 purchased & publicly displayed in 2007

● Also in 2007 Open Handset Alliance created

● The first Android-powered phone was sold in October

2008.

Page 4: Android Apps for Absolute Beginners

Android Present● Cupcake: 1.5 (2009)● Donut: 1.6● Eclair: 2.0-1● Froyo: 2.2● Gingerbread: 2.3● Honeycomb: 3.0-2● Ice Cream Sandwich: 4.0● Jelly Bean: 4.1-3● KitKat: 4.4 (2013)

images from http://developer.android.com/

Page 5: Android Apps for Absolute Beginners

Why Android ?● Portability ● IDE Improvement

Page 6: Android Apps for Absolute Beginners

Android System Architecture

( source: http://developer.android.com/images/system-architecture.jpg )

Page 7: Android Apps for Absolute Beginners

Linux Kernel

( source: http://developer.android.com/images/system-architecture.jpg )

Linux device drivers● where all hardware is

managed

Android specific drivers: ● wake lock logger● logger● lowmemorykiller● Paranoid network-ing

Page 8: Android Apps for Absolute Beginners

The vast Libraries

( source: http://developer.android.com/images/system-architecture.jpg )

Custom Java● Library is a

custom made collection of classes optimized for the mobile platform

Page 9: Android Apps for Absolute Beginners

Android Runtime

( source: http://developer.android.com/images/system-architecture.jpg )

Dalvik● Just in time● optimized for

mobile devices● Just because it’s a

VM does not mean it runs slow, very efficient and fast

Page 10: Android Apps for Absolute Beginners

Application Framework

( source: http://developer.android.com/images/system-architecture.jpg )

The legos!● Building blocks● Many Features for

you to make use of rather than having to build it from scratch

Page 11: Android Apps for Absolute Beginners

Last but not least, Applications !

( source: http://developer.android.com/images/system-architecture.jpg )

<Your App Here>

● All things visible to you and any Android user are located on this layer

Page 12: Android Apps for Absolute Beginners

Application lifecycle - It’s alive?Resume(visible)

Started(visible)

Paused(partially visible)

CreatedStopped(hidden)

onResume()

onStart()

onResume()

onStart()

onRestart()

onStop()

onPause()

onDestroy()

Destroyed

onCreate()

Launched

Page 13: Android Apps for Absolute Beginners

Android? New problems to solve!● What happens when the user receives a phone call or

switches to another app from yours?● Does your app consume valuable system resources

when the user is not actively using it?● What happens to the user's progress if they leave your

app and return to it at a later time?● Will you allow screen rotation? If so, will your app

crash?● Many, many more!

Page 14: Android Apps for Absolute Beginners

Other questions to ask..

● Will the app be stand alone?● Will it need a dedicated network connection?● Will a Phone data plan be enough?● Will data be stored locally, somewhere else?● Do I need something to run in the

background?

Page 15: Android Apps for Absolute Beginners

Android make it easy to start now.

Page 16: Android Apps for Absolute Beginners

Want more Visual Power?

● Canvas and Drawables● Hardware Acceleration● OpenGL

Page 17: Android Apps for Absolute Beginners

Media? Got that too.

There are libraries already built in to:● play videos & music● capture an image from the camera● find your location with the GPS● manage what the volume rocker does● voice activation? ready for you!

Page 18: Android Apps for Absolute Beginners

Storage - so many options!

● Shared Preferences

● Internal Storage

● External Storage

● SQLite Databases

● Network Connection

Page 19: Android Apps for Absolute Beginners

Which Screen will you support?

Page 20: Android Apps for Absolute Beginners

Application lifecycle RevisitedResume(visible)

Started(visible)

Paused(partially visible)

CreatedStopped(hidden)

onResume()

onStart()

onResume()

onStart()

onRestart()

onStop()

onPause()

onDestroy()

Destroyed

onCreate()

Launched

Page 21: Android Apps for Absolute Beginners

Android Skeleton

Page 22: Android Apps for Absolute Beginners

Android Skeleton

Page 23: Android Apps for Absolute Beginners

Android Skeleton

Page 24: Android Apps for Absolute Beginners

Android Skeleton

Page 25: Android Apps for Absolute Beginners

Application lifecycle RevisitedResume(visible)

Started(visible)

Paused(partially visible)

CreatedStopped(hidden)

onResume()

onStart()

onResume()

onStart()

onRestart()

onStop()

onPause()

onDestroy()

Destroyed

onCreate()

Launched

Page 26: Android Apps for Absolute Beginners

Other considerations.. HTML5 ?HTML vs Java

Budget - All vs OneUser reach vs User Experience

Browser vs FullscreenOnline vs Offline

Alerts - Email vs local NotificationsOpenGL vs Even more

Page 27: Android Apps for Absolute Beginners

Future topics ● HTML5 apps vs native Android apps

● Building that first native app right

● Android framework basics

● How to get Android to work with you

● Exploring the Rich libraries of Android OS

● APIs and how they can supercharge your app

Page 28: Android Apps for Absolute Beginners

[email protected]

●www.linkedin.com/in/vaclavhnizda/

●@Vaclav_Moravak

QUESTIONS

Thanks for coming!

More talks to come!