Vous êtes sur la page 1sur 31

Presented in Open Source Series Workshop 2010

An emerging OS for mobile devices

Android

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Agenda

What is an android? (Part 1) Inside Android (Components) (Part 2) Writing code for android devices.(Part 3) Demonstration (Part 4)

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

What is an Android? (Part 1)

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

About Android (Cont)


The word android literally means a robot. Android is an OS for the mobile devices. Android is more than an OS ,its complete software stack. Mainly developed by Google Product of Open Handset Alliance Based on linux kernel Ranked 1st in sales of smart devices. 100,000 apps freely available for Android. Code written in Java language.
22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

About Android
We can create powerful java applications in android. Android phones are called smart mobile devices. Android has a potential market beyond mobile devices. Some of android code being written for non mobile applications. Android was made freely available under Apache open source license in Oct 2008. Estimated 3 billion users
22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

HTC G1

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Features
Connectivity: WIFI, Bluetooth and GPRS, EDGE,

and 3G

Hardware: Support for GPS, accelerometers and Cameras. Graphics: Built in 2D/3D support including OpenGL. Storage: SQLLite Browser: The web browser is based on Webkit Supports modern features like multi touch and multi tasking.

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Popular version

Version 1.5 1.6 2.0/2.1 2.2 2.3 3.0/2.4 3x/2x

Name Cupcake (Linux 2.6.27) Donut (Linux 2.6.29) clair (Linux 2.6.29) Froyo (Linux 2.6.32) Gingerbread (Linux 2.6.35.7) Honeycomb (2011) Ice Cream (2011)

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

OS trends
Android popularity is growing and will soon challenge Symbian in 2014 [Gartner.com]

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Inside Android Platform (Part 2)

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Application Architecture

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Inside Android Platform


Linux Kernel Native Libraries Android Runtime Application Framework

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Detailed components

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Android Manifest
Every application must provide a file named AndroidManifest.xml Contains the configuration information for correctly installing it. Contains three things 1. Class names 2. Events 3. Permissions
22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Developing Applications with Android (Part 3)

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Tools Needed
To develop android applications we need IDE: Officially Eclipse is used Android SDK Android Developer Tools plug-in for Eclipse

Java Coding in eclipse is very intitutive, provides rich java environment like context sensitive help and code suggestions
22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Android SDK
Provides tools and APIs to begin developing applications on the Android using JAVA. Used to build, compile, test and debug user applications Can be downloaded for Linux, Windows and MAC. We can add, delete and update components in android SDK. To begin development we need Eclipse IDE with ADT plug-in.

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Anatomy of an Android application


Creating and Deploying android application Activity Service Content Provider Processes and Tasks.

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Android applications have common structure


Activity is the presentation layer of your app: there will be one per screen, and the Views provide the UI to the activity Intents specify what specific action should be performed

Broadcast receivers can trigger intents that start an application Data storage provide data for your apps, and can be shared between apps database, file, and shared preferences (hash map) used by group of applications
22-24 December, 2010 ICOSST 2010 Bruce Scharlau, University of Aberdeen, 2010

Services run in the background and have no UI for the user they will update data, and trigger events

Android applications have common structure Views such as lists,


grids, text boxes, buttons, and even an embeddable web browser Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data An Activity Manager that manages the life cycle of applications and provides a common navigation backstack A Notification Manager that enables all apps to display custom alerts in the status bar A Resource Manager, providing access to noncode resources such as localized strings, graphics, and layout files
Bruce Scharlau, University of Aberdeen, 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

How it works
Write app in Java Compiled in Java

Transformed to Dalvik bytecode

Loaded into Dalvik VM

Linux OS

22-24 December, 2010 ICOSST 2010

Bruce Scharlau, University of Aberdeen, 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

HelloWorld Android
package com.google.android.helloactivity; import android.app.Activity; import android.os.Bundle; public class HelloActivity extends Activity { public HelloActivity() { } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.hello_activity); } }
22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Can assume that most have android 2.1 or 2.2

22-24 December, 2010 ICOSST 2010 http://developer.android.com/resources/dashboard/platform-versions.html

Bruce Scharlau, University of Aberdeen, 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Emulator
Applications can be run on the device or emulator.

22-24 December, 2010 ICOSST 2010

Bruce Scharlau, University of Aberdeen, 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

There is a common file structure for applications


code
files

Autogenerated resource list

images UI layouts

constants

22-24 December, 2010 ICOSST 2010

Bruce Scharlau, University of Aberdeen, 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

The AndroidManifest lists application details

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.my_domain.app.helloactivity"> <application android:label="@string/app_name"> <activity android:name=".HelloActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application>
Bruce Scharlau, University of Aberdeen, 2010

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Dalvik Virtual Machine


Responsible for running android Java programs. Optimized for low memory. Designed to allow multiple VM instances to run. Relies on OS for process isolation, memory management and threading. Executes Dalvik(DEX) files DEX files are zipped into android package (APK)

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Android vs IPhone
Android is open source but iOS is proprietary. iOS can only be used on apple machines like Iphone,Ipad,Ipod Android has a universe of diverse mobile devices manufactured by renowned OEMS.For e.g. HTC,Samsung,LG,Sony Ericsson,Dell e.g Iphone iOS development is restricted while Android is flexible. iOS uses objective C while Android uses wildly adopted Java language.

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

There are lots of sources of information


The sdk comes with the API references, sample applications and lots of docs Blog http://android-developers.blogspot.com/ which has lots of useful examples, details There is http://www.anddev.org

22-24 December, 2010 ICOSST 2010

Bruce Scharlau, University of Aberdeen, 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Demonstration

22-24 December, 2010 ICOSST 2010

Presented in Open Source Series Workshop 2010 ICOSST 2010 Android Presentation

Questions?

22-24 December, 2010 ICOSST 2010

Vous aimerez peut-être aussi