24
Mobile App Development using Android SDK Josh Clemm October 27, 2010

Mobile app development using Android SDK

Embed Size (px)

DESCRIPTION

My first Android talk way back in 2010. Covering the foundation of the Android OS and SDK, this talk aimed at giving the audience a starting point to begin developing Android apps.

Citation preview

Page 1: Mobile app development using Android SDK

Mobile App Development using Android

SDK

Josh ClemmOctober 27, 2010

Page 2: Mobile app development using Android SDK

Agenda● Overview of Android

● Overview of Android App framework

● Application Development walkthrough

● Demos!

Page 3: Mobile app development using Android SDK

What is Android?

● Complete software stack for mobile devices● Operating system based

on Linux● Middleware● Mobile applications

● Developed by Google

● The Android SDK● Provides tools and APIs to develop apps in

Java

Page 4: Mobile app development using Android SDK

LINUX KERNEL

LIBRARIES ANDROID RUNTIME

APPLICATION FRAMEWORK

APPLICATIONS

Home Contacts Phone Browser …

Activity Manager

Window Manager

Content Providers View System

Package Manager

Telephony Manager

Resource Manager

Location Manager

Notification Manager

Surface Manager

Media Framework SQLite

OpenGL | ES FreeType WebKit

libcSSLSGL

Core Libraries

Dalvik Virtual Machine

DisplayDriver

CameraDriver

Flash MemoryDriver

Binder (IPC)Driver

KeypadDriver

WifiDriver

AudioDrivers

PowerManagement

Page 5: Mobile app development using Android SDK

Linux Kernel

● Android relies on core Linux 2.6 services● Security● Memory management● Process management● Network stack● Driver model

LINUX KERNELDisplayDriver

CameraDriver

Flash MemoryDriver

Binder (IPC)Driver

KeypadDriver

WifiDriver

AudioDrivers

PowerManagement

Page 6: Mobile app development using Android SDK

Android libraries● C library (Bionic)

● Media libraries

● LibWebCore – web browser engine

● SGL – 2G graphics engine

● 3D libraries – based on OpenGL ES 1.0

● FreeType – bitmap/vector rendering

● SQLite relational database

LIBRARIESSurface

ManagerMedia

Framework SQLite OpenGL | ES

FreeType WebKit libc SSL

Page 7: Mobile app development using Android SDK

Android Runtime

● Provides most of the functionality of Java’s libraries

● Apps run in its own process within its own Dalvik VM● Optimized for minimal memory● Register-based vs. stack-based ● JIT compilation

ANDROID RUNTIME

Core Libraries

Dalvik Virtual Machine

Java Source Code

Java Byte Code

Dalvik Byte Code

Dalvik ExecutableDalvik VM

Page 8: Mobile app development using Android SDK

APPLICATION FRAMEWORK

Application Framework

● Open/consistent development platform

● Activity Manager controls lifecycle of app

● Access location information

● Run background services, add

notifications to the status bar, and more…

Activity Manager

Window Manager

Content Providers View System

Package Manager

Telephony Manager

Resource Manager

Location Manager

Notification Manager

Page 9: Mobile app development using Android SDK

Android Applications

● Let’s walkthrough…

● Installing what you need

● Writing your app● Layouts, Logic, and Images

● Testing and debugging with emulator/device

● Publishing to App Market

Page 10: Mobile app development using Android SDK

Android Applications

● How to get started● Install Java 5 or 6

● Download Android SDK

● (Optional) Install Eclipse IDE

● (Optional) Install Android Eclipse Plugin (ADT)● The ADT plugin can manage installs of various

Android versions. ● It’s easy to get the latest releases

Page 11: Mobile app development using Android SDK

App Development

● Come up with an idea

● Determine the layout of the screens

● Code logic

● Customize look and feel

Page 12: Mobile app development using Android SDK

App Development - Layouts

Page 13: Mobile app development using Android SDK

App Development - Logic

● An activity can represent one screen● There’s an activity lifecycle: onCreate(),

onStart(), onResume(), onPause(), onStop(), onDestroy()

● An activity can have multiple views● Tabs, lists, a map

Page 14: Mobile app development using Android SDK

App Development – running

● Use built-in emulator● Mimic any target

device● Slow and can’t do

everything

● Run on Device● Fast, debuggable

Page 15: Mobile app development using Android SDK

Demos

● Cool things like

● Embedded map views

● Embedded web views

● Using location

● Using accelerometer

Page 16: Mobile app development using Android SDK

Questions?

Page 18: Mobile app development using Android SDK

Backup Slides

Page 19: Mobile app development using Android SDK

Publishing and beyond

● Before publishing remember…

● Create an icon

● Be able to support multiple screen sizes

● Be able to support multiple OS versions

● You might want to support multiple

languages

Page 20: Mobile app development using Android SDK

Publishing and beyond

● Sign your apps

● Add your App to Android Market● Also possible to use third-party app

markets

● Register as an Android developer ($25)

● Upload and watch the downloads fly!

Page 21: Mobile app development using Android SDK

Security And Permissions

● No App has permission to do anything that would impact another app

● Apps run in its own process● It’s a secure sandbox

● Permissions required are declared before a user installs the app

Page 22: Mobile app development using Android SDK

Filesystem and Database

● Each app has its own unique file system on the phone’s internal memory● App preferences, databases, flat files

reside there

● The SD card is a better resource for storing larger files (like for a game)

Page 23: Mobile app development using Android SDK

Android Resources/res folder R.java

Android package

Your code

ADT generates

ReferenceConstants

Runtime

Page 24: Mobile app development using Android SDK

App Components

● Reusable components

● Views – GUI widgets like lists, grids, text

boxes, embedded web browser

● Content providers – access data from other

apps (Contacts)

● Resource manager – access to non-code

resources (graphics, layouts, strings)

● Activity manager – lifecycle of apps