Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to...

Preview:

Citation preview

Mobile Application Mobile Application DevelopmentDevelopment

with ANDROID with ANDROID

Agenda

• Mobile Application Development (MAD)• Intro to Android platform• Platform architecture• Application building blocks• Development tools• Hello Android• SAM• Resources

Few reasons to go MAD…

• Smart Phones– Internet access anywhere– Social networking

• Millions of mobile users

• Open standards

Introduction to Android

• Open software platform for mobile development

• A complete stack – OS, Middleware, Applications

• An Open Handset Alliance (OHA) project

• Powered by Linux operating system

• Fast application development in Java

• Open source under the Apache 2 license

History of Android• Google acquired the startup company Android Inc. in 2005 to

start the development of the Android Platform. The key players at Android Inc. included Andy Rubin, Rich Miner, Nick Sears, and Chris White.

• In late 2007, a group of industry leaders came together around the Android Platform to form the Open Handset Alliance (http://www.openhandsetalliance.com).

• The Android SDK was first issued as an “early look” release in November 2007.

• In September 2008 T-Mobile announced the availability of the T-Mobile G1, the first smartphone based on the Android Platform.

• A few days after that, Google announced the availability of Android SDK Release Candidate 1.0.

• In October 2008, Google made the source code of the Android Platform available under Apache’s open source license.

History of Android

Introduction to Android What is the Open Handset Alliance (OHA)?

→ It's a consortium of several companies

Google Android

Introduction to AndroidWhat is the Open Handset Alliance (OHA)?

• Devoted to advancing open standards for mobile devices

• Develop technologies that will significantly lower the cost of developing and distributing mobile devices and services

• An open standard is a standard that is publicly available and has various rights to use associated with it, and may also have various properties of how it was designed (e.g. open process). There is no single definition and interpretations do vary with usage.

Google Android

Introduction to AndroidLicense

Android is under version 2 of the Apache Software License (ASL)

Google Android

Linux Kernel

• At the core of the Android Platform is Linux kernel version 2.6, responsible for device drivers, resource access, power management, and other OS duties. The supplied device drivers include Display, Camera, Keypad, WiFi, Flash Memory, Audio, and IPC (interprocess communication).

Libraries

• The next level up contains the Android native libraries. They are all written in C/C++ internally, but you’ll be calling them through Java interfaces. In this layer you can find a number libraries such as OpenGL, WebKit, FreeType, Secure Sockets Layer (SSL), the C runtime library (libc), SQLite and Media.

Libraries

• The media libraries are based on PacketVideo’s (http://www.packetvideo.com/) OpenCORE. These libraries are responsible for recording and playback of audio and video formats. A library called Surface Manager controls access to the display system and supports 2D and 3D.

• The WebKit library is responsible for browser support; it is the same library that supports Google Chrome and Apple Inc.’s Safari. The FreeType library is responsible for font support. SQLite (http://www.sqlite.org/) is a relational database that is available on the device itself. SQLite is also an independent open source effort for relational databases and not directly tied to Android. You can acquire and use tools meant for SQLite for Android databases as well.

Android Runtime

• Dalvik VM– Dex files– Compact and efficient than class files– Limited memory and battery power

• Core Libraries– Java 5 Std edition– Collections, I/O etc…

Application Framework

• API interface

• Activity manager – manages application life cycle.

Applications

• Built in and user apps such as Home, Contacts, Phone, Browser, and so on

• Can replace built in apps

Agenda

• Mobile Application Development (MAD)• Intro to Android platform• Platform architecture• Application building blocks• Development tools• Hello Android• SAM• Resources

Application Building Blocks

• Activity

• IntentReceiver

• Service

• ContentProvider

Activities

• Typically correspond to one UI screen

• But, they can:– Be faceless– Be in a floating window– Return a value

IntentReceivers

• Components that respond to broadcast ‘Intents’

• Way to respond to external notification or alarms

• Apps can invent and broadcast their own Intent

Intents

• Think of Intents as a verb and object; a description of what you want done– E.g. VIEW, CALL, PLAY etc..

• System matches Intent with Activity that can best provide the service

• Activities and IntentReceivers describe what Intents they can service

Intents

GMail

Contacts

Home

Blogger

Chat

Client component makes a request for a specific action

“Pick photo”

Picasa

System picks best component for that actionNew components can use existing functionalityBlogger

Photo Gallery

Services

• Faceless components that run in the background– E.g. music player, network download etc…

ContentProviders

• Enables sharing of data across applications– E.g. address book, photo gallery

• Provides uniform APIs for:– querying– delete, update and insert.

• Content is represented by URI and MIME type

Agenda

• Mobile Application Development (MAD)• Intro to Android platform• Platform architecture• Application building blocks• Development tools• Hello Android• SAM• Resources

Development Tools

• Eclipse

• Android SDKdeveloper.android.com

The Emulator

• QEMU-based ARM emulator• Runs the same image as the

device

• Limitations:– No Camera support

Devices

Hello World

• Generating UIs– Views – building blocks– E.g. TextView, EditText, Button– Placed into Layouts– E.g. LinearLayout, TableLayout,

AbsoluteLayout

SAM Demo

Interesting things to do

• Android is open source

• Opportunities for researchers

• Get the source, compile and update the device image

References

• http://developer.android.com

• http://sites.google.com/site/io

Recommended