32
Mobile Application Mobile Application Development Development with ANDROID with ANDROID

Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Embed Size (px)

Citation preview

Page 1: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Mobile Application Mobile Application DevelopmentDevelopment

with ANDROID with ANDROID

Page 2: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Agenda

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

Page 3: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Few reasons to go MAD…

• Smart Phones– Internet access anywhere– Social networking

• Millions of mobile users

• Open standards

Page 4: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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

Page 5: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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.

Page 6: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

History of Android

Page 7: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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

→ It's a consortium of several companies

Google Android

Page 8: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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

Page 9: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Introduction to AndroidLicense

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

Google Android

Page 10: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building
Page 11: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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).

Page 12: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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.

Page 13: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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.

Page 14: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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…

Page 15: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Application Framework

• API interface

• Activity manager – manages application life cycle.

Page 16: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Applications

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

• Can replace built in apps

Page 17: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Agenda

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

Page 18: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Application Building Blocks

• Activity

• IntentReceiver

• Service

• ContentProvider

Page 19: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Activities

• Typically correspond to one UI screen

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

Page 20: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

IntentReceivers

• Components that respond to broadcast ‘Intents’

• Way to respond to external notification or alarms

• Apps can invent and broadcast their own Intent

Page 21: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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

Page 22: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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

Page 23: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Services

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

Page 24: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

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

Page 25: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Agenda

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

Page 26: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Development Tools

• Eclipse

• Android SDKdeveloper.android.com

Page 27: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

The Emulator

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

device

• Limitations:– No Camera support

Page 28: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Devices

Page 29: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Hello World

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

AbsoluteLayout

Page 30: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

SAM Demo

Page 31: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

Interesting things to do

• Android is open source

• Opportunities for researchers

• Get the source, compile and update the device image

Page 32: Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building

References

• http://developer.android.com

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