Introduction to Mobile Application Development, Android Overview
Transcript of Introduction to Mobile Application Development, Android Overview
Introduction to Mobile Application
Development, Android Overview
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 1
(Authors: Dr Caspar Ryan, Dr Ermyas Abebe)
Mobile Application Development
• Lecturer/Course Leader: Dr Caspar Ryan
• Room: 14.11.32
• Phone: 9925-9775
• Email: [email protected]
• Pre-requisites:
– COSC2391/2401 Software Architecture: Design and
Implementation OR COSC1295 Advanced Programming
(formerly Java for Programmers) OR former Programming 2
– COSC 1285/2123 Algorithms & Analysis (this pre-requisite
may be waived if you achieved a DI or above in your Java
programming course)
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 2
Course Objectives
• Understand the capabilities and limitations of a range of mobile
computing devices and environments
• Understand the components of a mobile development framework
and learn how and when to apply the different components to
develop a working system
• Understand different types of application models/architectures
used to develop mobile software applications
• Understand and apply software patterns for the development of
the application models described above
* Design, implement and deploy mobile applications using an
appropriate software development environment (Android)
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 3
Value Propositions
• ‘Cool’ technology is not enough to guarantee uptake
– dot-com bust
• Technology uptake requires:
– reduced cost of service delivery/work output
– saved time e.g. push technology (stock market updates,
RSS)
– customer satisfaction
• Opportunities in:
– Business to consumer (B2C)
– Business to business (B2B)
– Business to employee (B2E)
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 4
Mobile Application Domains
• Enterprise Mobility– finance (e.g. Stock Market)
– sales (finalise sales/orders in the field)
– logistics (e.g. FedEx)
– supply chain management (warehousing, inventory etc.)*
– service technicians (online schematics etc.)
• Social and Entertainment– Instant messaging (WhatsApp etc.)
– Communication (Skype etc.)
– Microblogging (Twitter etc.)
– Social Media and Networking (Facebook, Foursquare etc.)
– Gaming (single player, online (e.g. MMO), peer to peer)
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 5
Mobile Application Domains (contd.)
• Groupware and productivity– email/tasks/calendar etc.
– shared document editing
– meeting scheduler (e.g. gps based)
– Communities of practice (e.g. LinkedIn)
• The Internet of “Things”– pervasive connectivity
– appliances
– sensors
– mobile and fixed computers
– big data, real time/continuous queries
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 6
Mobile Application Domains (contd.)
• Community Based
– Emergency service co-ordination (police, fire, ambulance, SES)
– Health care (tele-medicine, assisted living, medical records etc.)
– Virtual community/social networking
• Military/Counter Terrorism
– Intelligence gathering
– Field co-ordination
• Educational
– Highly interactive lectures
– Campus wide connectivity
– eBooks, podcasting, streaming etc.
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 7
Mobile Device Characteristics
• Form Factors
– PDA (iPod touch, Palm etc.)
– Smartphone (with or without physical keyboard)
– Tablet (e.g. iPad, Android Tablets (Galaxy etc.))
– Netbook (and hybrid tablet e.g. ASUS
Transformer)
– Hybrid/Tablet PC (keyboard and digitiser/stylus)
– Laptop/Notebook/Desktop Replacement
– Wearable devices, glasses, watches etc. (more
coming soon!)
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 8
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 9
Pervasive/Wearable Computing
● Implications?
o New computing paradigms
o Distributed data and computation
o Crowdsourcing/Virtual or Community Clouds
o Privacy/Monopoly?
o Social awkwardness/distraction (only 1 in 10 would wear
glass)*
* http://www.nydailynews.com/life-style/1-10-wear-google-glass-article-1.1344844
Semester 2, 2014 COSC2309/2347 Mobile Application Development
Mobile Device Characteristics
• Input Styles
– touch/gesture input (e.g. iPhone/iPad, Android)
– stylus/pen input (e.g. Microsoft Surface, Galaxy Note,
Tablet PC, PDA)
– integrated miniature keyboard (keypad or QWERTY) e.g.
Blackberry
– integrated full keyboard e.g. Tablet PC, hybrid tablet
– add-on keyboards e.g. Surface Typecover, iPad dock,
Bluetooth keyboards available for most devices
– voice e.g. in-car navigation, Apple Siri, Android Majel
– motion input e.g. accelerometer/gyroscope (Microsoft
Kinect style coming soon?)
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 11
Mobile Device Characteristics
• Display/Output
– line based LCD (early generation smartphone)
– graphical display
• sizes, orientations
• resolutions and colour depths
• Technologies e.g. LCD, LED, OLED, eInk etc.
– audio including speech e.g. in car navigation,
personal assistant
– haptic feedback e.g. vibration
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 12
Mobile Device Characteristics
• Connectivity (may be limited or non-existent)– Serial/USB (charging, data transfer)
– Infrared (e.g. programmable consumer remote)
– Bluetooth/LE (I/O devices e.g. headset, joystick, fitness,
medical)
– Wi-Fi IEEE 802.11 (when available)
– GPRS, 3G, 4G (wide coverage networking)
– NFC (mobile payment, social apps)
– ZigBee IEEE 802.15.4 (personal area networks PAN, e.g.
home automation, body area networks)
• Limited battery life (critical!)
– Must moderate power usage
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 13
Mobile Operating Systems
• Android
– Wide range of devices
– Open Source OS and Tools
– Java based development (and native option for performance)
• Apple iOS
– Proprietary OS and devices
– Objective C
– Mac only development platform
• Microsoft Windows Phone (successor to Windows Mobile)
– Strict Smartphone Specifications for version 7 (screen, memory)
– C++ Native, .NET CF, SilverLight, HTML 5
– Windows Phone 8 shares APIs with desktop windows (and
Windows NT kernel instead of Windows CE)
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 14
Mobile Operating Systems (contd.)
• Linux
– PDA/Smartphone
– Java/C++ Native
– Ubuntu distributions, Samsung etc.
• HTML 5
– cross platform
– may be embedded in native apps
• Others
– WebOS
– Blackberry
– Symbian
– Palm etc.
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 15
What is Android?
• Software stack for mobile devices including OS,
middleware and set of applications
• From Google and the Open Handset Alliance (a
consortium of mobile operators, software companies
and handset manufacturers)
• OS is based on Linux Kernel 2.6
• Software Stack Consists of Java Applications executing
on a Dalvik Virtual Machine (VM Optimized for mobile
devices)
• Currently over 1.3 Million* apps (Android Market and
third-party sites) with high percentage free (approx. 2
thirds)
• Features: Multitouch, Multitasking, Connectivity (NFC,
3G, Wi-Fi, Bluetooth etc.), Tethering**, GPS, Gyroscope,
Magnetometer, Accelerometer etc.
• Latest Version: 4.0+ (Ice Cream Sandwich) integrates
Tablet and phone functionality.
* http://www.appbrain.com/stats/number-of-android-apps ** Prior to 2.2 required third-party apps
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 16
Why Android?
• Free and Open Source under the Apache
License (more permissive than GPL)
• Free to Develop (no developer license
required or certification fees)
• Partnership with 84 firms including Software
Companies, Handset manufacturers, Mobile
Operators, through the Open Handset
Alliance
• Secure Operating System (is based on Linux
Kernel 2.6) and Robust software framework
• Leverages the power and popularity of Java
• Powerful SDK and plug-in for popular open
source IDE (Eclipse )
• Targets a range of devices, Feature phones,
Smartphones and Tablet Devices
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 17
Android Versions (2014)
Most Popular Version is Android 4.1.x (Jelly Bean, API level 10)
with 27.8% of Devices*
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 18
* https://developer.android.com/about/dashboards/index.html
Android Versions (2013)
Most Popular Version is Android 2.3.3 (Gingerbread, API level 10)
with 45.4% of Devices*
* Data collected during a 14-day period ending on February 4, 2013
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 19
Version Codename API Distribu
tion
1.6 Donut 4 0.2%
2.1 Eclair 7 2.2%
2.2 Froyo 8 8.1%
2.3 -
2.3.2
Gingerbread 9 0.2%
2.3.3 -
2.3.7
10 45.4%
3.1 Honeycomb 12 0.3%
3.2 13 1.0%
4.0.3 -
4.0.4
Ice Cream
Sandwich
15 29.0%
4.1 Jelly Bean 16 12.2%
4.2 17 1.4%
Android Versions (2012)
Most Popular Version in 2012 was Android 2.3.3 (Gingerbread, API
level 10) with 54.9% of Devices*
* Data collected during a 14-day period ending on January 3, 2012
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 20
Android Architecture
• OS is based on Linux Kernel 2.6
(security, memory
management, network,
process management etc.)
• multi-user system where each
application has a unique user
id and a separate process
• Provides abstraction of
underlying hardware
Libraries:
C/C++ libraries which are exposed to
developers through the Application
framework.
Includes display subsystem (2D and 3D
graphics layers), audio and video formats,
database engine etc.
1
2
1
2 3
4
5
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 21
Android Architecture (Dalvik)
Android Runtime: Includes MOST of the
Core Libraries of the Java Programming
language (SE JDK 1.5). See slide 18
Dalvik Virtual Machine: Register-based VM,
Optimized for mobile devices
Includes Just-In-Time Compilation (since
Froyo, 2.2)
Runs java classes which have been
transformed into Dalvik Executable files
(.dex)
.dex file could include more than one java
.class file
Each Application Runs its own instance of
the Dalvik VM
3
1
2 3
4
5
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 22
Android Architecture (Application)
Application Framework: Set of Java
services and systems which expose
system libraries to developers
run on the Dalvik VM to allow
development of applications
4
Applications: Core Pre-installed
applications such as Phone, Email,
Map, Browser, Contacts etc. All written
in Java
5
1
2 3
4
5
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 23
Android APIs == Java SE?
• Android includes most of Java SE 5.0
library specification, but not all (check
Android API docs for specifics)
• Libraries are based on Apache
Harmony which provides a clean-
room implementation of Java SE
• Android UI Framework is neither
Swing nor AWT
• No JVM support in android
• Oracle Vs. Google lawsuit, copyright
and patent infringements
included from Java SE 5.0:
excluded:
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 24
Developing for Android
25
Android SDK Includes: Tools and APIs for Developing in the Java Programming Language including Emulator (see below)
Android Developer Toolkit Plug-in for Eclipse (ADT) or standalone bundle including eclipse
Emulator (Virtual Device) for development and testing (slow startup but only need to start once, snapshots available), also Direct USB debugging on real device
Optional C/C++ native development kit (Android NDK)
Semester 2, 2014 COSC2309/2347 Mobile Application Development
Emulator Functions
- Simulates real device environment (runs ARM bytecode using qemu emulator or x86 using hardware acceleration HAX)- Fully configurable (e.g. screen sizes and resolutions, underlying hardware configurations, SD card size, RAM size etc.)- Provides easy access to the default system settings common to all Android-based devices (e.g. Wireless controls, Sound and Display, Security etc.)- Can emulate calling and SMS messaging between two emulator instances- Can simulate location based services (using “dummy” GPS coordinates)
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 26
27
Emulator Limitations
- Limited ability to determine device state (e.g. network state, battery charge etc.)
- Limited performance (real devices usually perform better than the emulator)
- Limited support for manufacturer or operator-specific device characteristics
- No in-built sensor management/support. Can integrate additional tools such as OpenIntents’ SensorSimulator that lets you simulate sensor data with the mouse in real time (covering accelerometer, compass, and temperature sensors)
- No USB or Bluetooth support- The Genymotion emulator running on VirtualBox VM
alleviates some of these limitations (https://cloud.genymotion.com)
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 27
References
• http://developer.android.com/guide/index.html
• Joseph Annuzzi Jr., Lauren Darcey, Shane Conder, Introduction to Android
Application Development: Android Essentials (4th edition), Addison-Wesley,
2013 ISBN: 9780321940261
• Lauren Darcey, Shane Conder, Android Wireless Application Development
Volume II: Advanced Topics (3rd Edition), Addison-Wesley, 2012 ISBN:
9780321813848
• Carmen Delessio, Lauren Darcey and Shane Conder, SAMS Teach Yourself
Android App Development in 24 Hours (3rd Ed.), SAMS, 2013
• Ed Burnette, Hello, Android: Introducing Google's Mobile Development
Platform (Pragmatic Programmers)
• http://www.androlib.com/appstats.aspx
• http://www.informationweek.com/news/personal-tech/smart-
phones/229401700
• http://edwinhm.blogspot.com/2008/04/android-comparisons-with-j2me.html
• http://bit.ly/jBVclE
Semester 2, 2014 COSC2309/2347 Mobile Application Development Topic 1, Slide 28