Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5...

22
Android App Development Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore

Transcript of Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5...

Page 1: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Android App Development

Muhammad Sharjeel

COMSATS Institute of Information Technology, Lahore

Page 2: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Welcome to Mobile App Development

Mobile devices (e.g., smartphone, tablet PCs, etc.) are increasingly

becoming an essential part of human life as the most effective and

convenient communication tools not bounded by time and place.

Page 3: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Course Contents

• Overview of android development

• How to use the power of java to build the applications for the

android platform

• Adding various UI controls, custom layout, themes, styles

• Adding audio/video to your apps

• Making them location aware by incorporating GPS and maps

Page 4: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

What you should know

• OOP programming concepts

• Some experience with java

• Experience with Eclipse environment (helpful)

• Knowledge of Android capabilities (helpful)

• An Android smart phone to test your Apps

Page 5: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Why Android

• A simple and powerful SDK

• No licensing, distribution, or development fees

• Development over many platform

Linux, Mac OS, Windows

• Excellent documentation

• Thriving developer community

Page 6: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

What is Android?

• Android is a software stack for mobile devices that includes an

operating system, middleware and key applications

Page 7: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Introduction to Android

• Software platform from Google and the Open Handset Alliance

• July 2005, Google acquired Android, Inc.

• November 2007, Open Handset Alliance formed to develop open

standards for mobile devices

• October 2008, Android available as open source

• December 2008, 14 new members joined Android project

Page 8: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Android versions

• Android 1.5 Cupcake (API level 3)

• Android 1.6 Donut (API level 4)

• Android 2.0/2.1 Eclair (API level 6/7)

• Android 2.2 Froyo (API level 8)

• Android 2.3 Gingerbread (API level 9)

• Android 3.0 Honeycomb (targeted at tablet devices) (API level 11)

• Android 4.0 Ice Cream Sandwich (API level 14)

Combination of Gingerbread and Honeycomb

• The most recent major Android update was Jelly Bean 4.2 (API level 17), which

was released on commercial devices in November 2012

• As of 2013, over 500 million active devices use the Android OS worldwide

• Android 5.0 Key Lime Pie (Under development)

Page 9: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Android Architecture

• Runs on top of Linux 2.6

• Dalvik virtual machine optimized for mobile devices

• Integrated browser on the WebKit engine

• Optimized graphics with OpenGL ES

• SQLite database for structured data storage

Page 10: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Android Architecture

Page 11: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Linux Kernel

• Works as a HAL

• Device drivers

• Memory management

• Process management

• Networking

Page 12: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Libraries

• C/C++ libraries

• Interface through Java

• Surface manager – Handling UI Windows

• 2D and 3D graphics

• Media codecs, SQLite, Browser engine

Page 13: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

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 14: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Application Framework

• API interface

• Activity manager – manages application life cycle

Page 15: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Applications

• Built in and user apps

• Can replace built in apps

Page 16: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Application Fundamentals

• Application are written in Java programming language

• Compiled into an Android package file (.apk)

• Each application runs in its own sandbox and Linux process

• Application consists of components, a manifest file and resources

• Components:

1) Activities

2) Services

3) Content providers

4) Broadcast receivers

Page 17: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Activities

• An activity represents a single screen with a user interface

• Most applications contain multiple activities

• When a new activity starts, it is pushed onto the back stack

• User interface can be built with XML or in Java

• Monitor lifespan through callback methods like onStart(),

onPause(), etc.

Page 18: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Services

• Services perform long-running operations in the background

• Does not contain a user interface

• Useful for things like network operations, playing music, etc.

• Runs independently of the component that created it

• Can be bound to by other application components, if allowed

Page 19: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Content providers

• Used to store and retrieve data and make it accessible to all

application

• Are the only way to share data across applications

• Exposes a public URI that uniquely identifies its data set

• Data is exposed as a simple table on a database model

• Android contains many provider for things like contacts, media, etc.

Page 20: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Broadcast receivers

• A components that responds to system-wide broadcast

announcements

• Examples include when the screen turns off, the battery is low, etc.

• Applications can also initiate their own broadcasts

• Broadcast receivers contain no user interface

• They can create status bar notification to alert the user

Page 21: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

Android Manifest file

• Applications must have an AdroidManifest.xml file in its root

directory

• Presents information about the application to the Android system

• Describes the components used in the application

• Declares the permission required to run the application

• Declares the minimum Android API level that the application

requires

Page 22: Android App Development - bcssp10.files.wordpress.com€¦ · Android versions • Android 1.5 Cupcake (API level 3) • Android 1.6 Donut (API level 4) • Android 2.0/2.1 Eclair

THANKS