mobile application development with android · 7/1/2018 · • symbian – acquired by nokia 2008...
TRANSCRIPT
Mobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application Development
with with with with with with with with ANDROIDANDROIDANDROIDANDROIDANDROIDANDROIDANDROIDANDROID
ByByByByByByByBy
S.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMV
Mobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application DevelopmentMobile Application Development
ANDROIDANDROIDANDROIDANDROIDANDROIDANDROIDANDROIDANDROID
ByByByByByByByBy
S.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMVS.Gokulakrishnan AP/CSE SCSVMV
The Players
• Android – Open source mobile OSdeveloped
Google. Based on Linux 2.6 kernel
• iOS – Apple’s proprietary mobile OS,iPhone
X, veryUNIX likeX, veryUNIX like
• Symbian – acquired by Nokia 2008
• Windows Phone 7 – Microsoft – Kin,discontinued
• Blackberry OS – RIM (Research inMotion),
The Players
developedny the Open Handset Alliance led by
iPhone, iPod Touch, iPad. Derived from OS
discontinued6 weeks after initial launch
Motion), proprietary OS
The Smartphone Platform
• With the iPhone being thefirstthe configuration of theSmartphone– 3G/4G connectivity
– WiFi connectivity– WiFi connectivity
– Bluetooth connectivity
– accelerometer w/compass
– ambient light sensor
– proximity sensor
– GPS
– gyroscope
The Smartphone Platform
first to the marketplace it setsSmartphonePlatform
What is Android
• Android is an open sourceoperatingspecifically for use on mobiledevices
• Linux based (2.6 kernel)
• Can be programmed in C/C++Java(Javaaccessto C LibrariesJava(Javaaccessto C Libraries
• Supports Bluetooth, Wi-Fi, and3
What is Android
operating system, created by Googledevices(cell phones and tablets)
but most app development is done invia JNI (JavaNativeInterface))via JNI (JavaNativeInterface))
3G and 4G networking
What is iOS
• Apple’s mobile OS for phones ((iPod),
• based on BSD Unix
• Application programming done in Objective C• Application programming done in Objective C
• Supports Bluetooth, Wi-Fi, and 3G and 4G networking
What is iOS
Apple’s mobile OS for phones (iPhone), tablets (iPad), handhelds
Application programming done in Objective CApplication programming done in Objective C
Fi, and 3G and 4G networking
Bluetooth
• Open wireless technology
– Developed by Ericsson (1994)
– Originally supposed to replace wired RS
– Short distance via low power, short distance radio
– Allows creation of personal area networks– Allows creation of personal area networks
• Mostly to connect wireless peripheral devices to a host computer (mice, headsets, microphones, keyboards…)
– Can also be used to communicate between two host computers wirelessly (replace serial cables)
Bluetooth
Originally supposed to replace wired RS-232
Short distance via low power, short distance radio
Allows creation of personal area networksAllows creation of personal area networks
Mostly to connect wireless peripheral devices to a host computer (mice, headsets, microphones, keyboards…)
Can also be used to communicate between two host computers wirelessly
Wi
• Used to brand certified products that belong to a class of wireless local area network based on IEEE Standard 802.11
• Currently there are 3 versions of 802.11 in common use:
– B, about 150 feet indoors, 300 ft outdoors
– G, 54 Mbits about 150 feet indoors, 300 ft outdoors– G, 54 Mbits about 150 feet indoors, 300 ft outdoors
– N, 600 Mbits, about 1.5 miles in open air, uses MIMO (multiple input and output antennas)
Wi-Fi
Used to brand certified products that belong to a class of wireless local area network based on IEEE Standard 802.11
Currently there are 3 versions of 802.11 in common use:
B, about 150 feet indoors, 300 ft outdoors
about 150 feet indoors, 300 ft outdoorsabout 150 feet indoors, 300 ft outdoors
, about 1.5 miles in open air, uses MIMO (multiple input and
3G ( 3rd Generation Network)
• Must allow simultaneous use of speech and data
rate of 200 kbits/sec
Generation Network)
Must allow simultaneous use of speech and data services and provide peak data
4G
• Provides a comprehensive and secure
ultra broadband internet, gamingservices
• Peak data rate of 100 Mbit forhigh
mobility devices.mobility devices.
4G
IP based solution for IP based telephony,
servicesand streamed multimedia.
high mobility devices and 1 Gbit for low
Commonly Used Packages
• User interface controls and widgets
• User interface layout
• Secure networking and web browsing
• Structured storage and relationaldatabases
• 2D and 3D Graphics SGL andOpenGL
• Audio and visual media support
• Access to optional hardware (GPS)
Commonly Used Packages
databases(SQLite RDBMS)
OpenGL
The Android Software StackThe Android Software Stack
Android Application Development
Eclipse
IDE
Android
Emulator
Android Application Development
Android
SDK
Android
Mobile
Device
iOS Application Development
XCODE
IDE
iOS
Simulator
iOS Application Development
iOS
SDK
iOS
Mobile
Device
Android development
Android
Manifest
Java
Source
Manifest
Resource
XML
Generated
Class
Android
Libraries
Android development
Java
Compiler
.dex
FileDalvik
VM
iOS development
Objective
C Source Xcode
.xib file Objective
Compiler
Foundation
Framework
Cocoa
Libraries
Interface
Builder
iOS development
Objective
C
Compiler
. Simulator
or Device
History of Android• Google acquired the startupcompany
development of the Android Platform.Andy Rubin, Rich Miner, Nick Sears,and
• In late 2007, a group of industryleadersPlatform to form the(http://www.openhandsetalliance.com)
• The Android SDK was first issuedas2007.2007.
• In September 2008 T-Mobileannouncedthe first smartphone based on theAndroid
• A few days after that, GoogleannouncedRelease Candidate 1.0.
• In October 2008, Google made theavailable under Apache’s open source
History of Androidcompany Android Inc. in 2005 to start the
The key players at Android Inc. includedandChris White.
leaderscame together around the AndroidOpen Handset Alliance
).
as an “early look” release in November
announcedthe availability of the T-Mobile G1,AndroidPlatform.
announcedthe availability of Android SDK
source code of the Android Platformlicense.
History of AndroidHistory of Android
What is Open Handset Alliance?
• Quoting fromwww.OpenHandsetAlliance
• “… Open Handset Alliance™, agroup
have come together to accelerateinnovation
richer,lessexpensive,andbettermobilericher,lessexpensive,andbettermobile
• Together we have developedAndroid™,
mobile platform.
• We are committed to commercially
Android Platform. “
What is Open Handset Alliance?
OpenHandsetAlliance.com page
groupof 47 technology and mobile companies
innovationin mobile and offer consumers a
mobileexperience.mobileexperience.
Android™, the first complete, open, and free
deploy handsets and services using the
Introduction
What is the Open Handset Alliance (OHA)?
→ It's a consortium of several companies
What is the Open Handset Alliance (OHA)?
It's a consortium of several companies
Google Android
Open Handset Alliance MembersOpen Handset Alliance Members
Phones
HTC G1,HTC G1,Droid,Tattoo
Suno S880 Samsung Galaxy
Phones
21
Motorola Droid (X)
Samsung Galaxy Sony Ericsson
Tablets
Velocity Micro Cruz Gome FlyTouchVelocity Micro Cruz Gome FlyTouch
Dawa D7
Toshiba Android SmartBook
Tablets
Gome FlyTouch Acer beTouch
22
Gome FlyTouch Acer beTouch
Toshiba Android SmartBook
Cisco Android Tablet
Hardware
Android is not a single piece of hardware; it's a complete, end
that can be adapted to work on any number of hardware configurations. Everything is
there, from the boot loader all the way up to the applications.
Platform
there, from the boot loader all the way up to the applications.
Android is not a single piece of hardware; it's a complete, end-to-end software platform
that can be adapted to work on any number of hardware configurations. Everything is
all the way up to the applications.all the way up to the applications.
Google Android
Android’s Context: Mobile Market Player$Stakeholders
•
•
•
Android’s Context: Mobile Market Player$Stakeholders:
• Mobile network operators want to lockdown their networks, controlling andmetering traffic.
• Device manufacturers want to differentiatethemselves with features, reliability, andprice points.
• Software vendors want complete access tothe hardware to deliver cutting-edgeapplications.
The Maturing Mobile Experience
• Tomorrow?
The Maturing Mobile Experience
The Maturing Mobile ExperienceThe Maturing Mobile Experience
Android vs. CompetitorsAndroid vs. Competitors
Platform - The Android Software StackThe Android Software Stack
28
Android S/W Stack
• Android provides a set of core applications:� Email Client� Email Client
� SMS Program
� Calendar
� Maps
� Browser
� Contacts
� Etc
• All applications are written using the Java language.
Android S/W Stack - Application
Android provides a set of core applications:
29
All applications are written using the Java language.
Android S/W Stack
• Most of the application framework accesses these core libraries through the Dalvik VM, the core libraries through the Dalvik VM, the gateway to the Android Platform
Android S/W Stack – App Framework
Most of the application framework accesses these core libraries through the Dalvik VM, the
30
core libraries through the Dalvik VM, the gateway to the Android Platform
Android S/W Stack App Framework (Cont)
Feature
View System
Used to build an application, including lists, grids, textboxes, buttons, and embedded web browser
Content Provider
Enabling applications to access data from other applications or to share their own data
Resource Manager
Providing access to non, graphics, and layout files)
Notification Manager
Enabling all applications to display customer alerts in the status bar
Activity Manager
Managing the lifecycle of applications and providing a common navigation
Android S/W Stack –App Framework (Cont)
Role
Used to build an application, including lists, grids, textboxes, buttons, and embedded web browser
Enabling applications to access data from other applications or to share their own data
31
Providing access to non-code resources (localized string, graphics, and layout files)
Enabling all applications to display customer alerts in the
Managing the lifecycle of applications and providing a common navigation backstack
Location ManagerLocation Manager
Notification ManagerNotification Manager
Notification Manager• How background app interact with users
• Consistent notification presentation
Notification ManagerHow background app interact with users
Consistent notification presentation
View SystemView System
View SystemView System
Android S/W Stack
• Including a set of C/C++ libraries used by components of the Android system
• Exposed to developers through the Android application framework
Android S/W Stack - Libraries
37
Including a set of C/C++ libraries used by components
Exposed to developers through the Android application
Android S/W Stack • The media libraries are
(http://www.packetvideo.com/) OpenCOREresponsible for recording andplaybackA library called Surface Managerand supports 2D and 3D.
• The WebKit library isresponsiblelibrary that supports GoogleChromeThe FreeType library isresponsibleSQLite (http://www.sqlite.org/) ison the device itself. SQLite isalsofor relational databases and notacquire and use tools meant forSQLite
Android S/W Stack - Librariesare based on PacketVideo’s
OpenCORE. These libraries areplaybackof audio and video formats.
controls access to the display system
responsiblefor browser support; it is the sameChromeand Apple Inc.’s Safari.
responsiblefor font support.a relational database that is available
also an independent open source effortdirectly tied to Android. You can
SQLitefor Android databases as well.
Android S/W Stack
• Core Libraries�Providing most of the functionality available in the �Providing most of the functionality available in the
core libraries of the Java language
�APIs�Data Structures
�Utilities
�File Access
�Network Access
�Graphics
�Etc
Android S/W Stack - Runtime
Providing most of the functionality available in the
39
Providing most of the functionality available in the core libraries of the Java language
The Dalvik runtime is optimised for mobile applications
Run multiple VMs efficiently
Each app has its own VM
Minimal memory footprint
The Dalvik runtime is optimised for mobile applications
Run multiple VMs efficiently
Each app has its own VM
Minimal memory footprint
Android S/W Stack
• Dalvik Virtual Machine (Cont)�Executing the Dalvik Executable (.dex) format
�.dex format is optimized for minimal memory footprint.
�Compilation
�Relying on the Linux Kernel for:�Threading
�Low-level memory management
Android S/W Stack – Runtime (Cont)
Dalvik Virtual Machine (Cont)Executing the Dalvik Executable (.dex) format
.dex format is optimized for minimal memory footprint.
41
Relying on the Linux Kernel for:
level memory management
Android applications are compiled to Dalvik bytecode
Write app in Java
Compiled in Java
Transformed to Dalvik bytecodeTransformed to Dalvik bytecode
Android applications are compiled to Dalvik bytecode
Compiled in Java
Transformed to Dalvik bytecodeTransformed to Dalvik bytecode
Linux OSLoaded into Dalvik VM
Android S/W Stack
� Relying on Linux Kernel 2.6 for core system services
� Memory and Process Management
� Network Stack
� Driver Model
� Security
• The supplied device drivers include Display, Camera, Keypad, WiFi, Flash Memory, Audio, and IPC (interprocess communication).
� Providing an abstraction layer between the H/W and the rest of the
S/W stack
Android S/W Stack – Linux Kernel
Relying on Linux Kernel 2.6 for core system services
43
Memory and Process Management
The supplied device drivers include Display, Camera, Keypad, WiFi, Flash Memory, Audio, and IPC (interprocess communication).
Providing an abstraction layer between the H/W and the rest of the
Network Connectivity
It supports wireless communications using:
� GSM mobile-phone technology
� 3G
� Edge
Platform
� 802.11 Wi-Fi networks
It supports wireless communications using:
phone technology
Google Android
Development requirements
• Java
• Android SDK
Software development
Google Android
IDE and Tools
Android SDK• Class Library• Developer Tools • Emulator and System Images • Documentation and Sample Code
Eclipse IDE + ADT (Android Development Tools)• Reduces Development and Testing Time
Software development
• Reduces Development and Testing Time• Makes User Interface-Creation easier• Makes Application Description Easier
Eclipse IDE + ADT (Android Development Tools)Reduces Development and Testing TimeReduces Development and Testing Time
Creation easierMakes Application Description Easier
Google Android
Here are a few other advantages Android offers you as a developer:
• The Android SDK is available for Windows, Mac and Linux, so you don’t need to pay for new hardware to start writing applications.• An SDK built on Java. If you’re familiar with the Java programming language, you’re already halfway there.• By distributing your application on Android Market, it’s available to hundreds of thousands of users instantly. You’re not just limited to one store, because there are alternatives, too. For instance, you can release your application on your own blog.
Advantages
alternatives, too. For instance, you can release your application on your own blog. Amazon have recently been rumoured to be preparing their own Android app store also.• As well as the technical SDK documentation, new resources are being published for Android developers as the platform gains popularity among both users and developers.
Here are a few other advantages Android offers you as a developer:
The Android SDK is available for Windows, Mac and Linux, so you don’t need to pay for new hardware to start writing applications.
An SDK built on Java. If you’re familiar with the Java programming language,
By distributing your application on Android Market, it’s available to hundreds of thousands of users instantly. You’re not just limited to one store, because there are alternatives, too. For instance, you can release your application on your own blog. alternatives, too. For instance, you can release your application on your own blog. Amazon have recently been rumoured to be preparing their own Android app store
As well as the technical SDK documentation, new resources are being published for Android developers as the platform gains popularity among both
Google Android
Application Building Blocks
• Activity
• IntentReceiver
• Service• Service
• ContentProvider
Application Building Blocks
Activities
• Typically correspond to one UI screen
• But, they can:– Be faceless
– Be in a floating window– Be in a floating window
– Return a value
Activities
Typically correspond to one UI screen
IntentReceivers
• Components that respond to broadcast ‘Intents’
• Way to respond to external notification or alarms
• Apps can invent and broadcast their own Intent• Apps can invent and broadcast their own Intent
IntentReceivers
Components that respond to broadcast ‘Intents’
Way to respond to external notification or alarms
Apps can invent and broadcast their own IntentApps 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
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
Activities and IntentReceivers describe what
Intents
Contacts
Home
“Pick photo”GMail
Blogger
Chat
“Pick photo”
Blogger
Intents
Picasa
Photo Gallery
Services
• Faceless components that run in the background– E.g. music player, network download etc…
Services
Faceless components that run in the backgroundE.g. music player, network download etc…
ContentProviders
• Enables sharing of data across applications– E.g. address book, photo gallery
• Provides uniform APIs for:• Provides uniform APIs for:– querying
– delete, update and insert.
• Content is represented by URI and MIME type
ContentProviders
Enables sharing of data across applicationsE.g. address book, photo gallery
Provides uniform APIs for:Provides uniform APIs for:
delete, update and insert.
Content is represented by URI and MIME type