LA - Android - Unit I ONE
LA - Android - Unit I ONE
Mobile Applications
What are they?
Any application that runs on a mobile device
Types
Web apps: run in a web browser
HTML, JavaScript, Flash, server-side components,
etc.
Native: compiled binaries for the device
Often make use of web services
Mobile Devices: Advantages
Always with the user
Typically have Internet access
Typically GPS enabled
Most have cameras & microphones
Many apps are free or low-cost
Mobile Devices: Disadvantages
Limited screen size
Limited battery life
Limited processor speed
Limited and sometimes slow network access
Limited input: phone keypad, touch screen,
stylus etc
Limited web browser functionality
Range of platforms & configurations across
devices
Why Mobile App Development?
Why Android?
Transferring app to phone is trivial
Can distribute by putting it on the web
Android Market (now Google Play) for wider
distribution
What is Google Android?
A software stack for mobile devices that includes
An operating system
Middleware
Key Applications
DVM (and
4.4 KitKat October 31, 2013 19 14.5%
ART 1.6.0)
4.3 July 24, 2013 18 DVM 1.0%
November 13,
4.2 Jelly Bean 17 DVM 3.3%
2012
4.1 July 9, 2012 16 DVM 2.3%
Ice Cream
4.0 October 19, 2011 15 DVM 0.6%
Sandwich
2.3 Gingerbread February 9, 2011 10 DVM 1.4.0 0.6%
Android Apps
Built using Java and new SDK libraries
No support for some Java libraries like Swing &
AWT
Java code compiled into Dalvik byte code
(.dex)
Optimized for mobile devices (better memory
management, battery utilization, etc.)
Dalvik VM runs .dex files
Applications
Written in Java (it’s possible to write
native code)
Good separation (and corresponding
security) from other applications:
Each application runs in its own process
Each process has its own separate VM
Each application is assigned a unique Linux
user ID – by default files of that application are
only visible to that application
Android Architecture
Activity Manager – Life Cycle / Navigation
within and among applications
Views
UI elements that are drawn on-screen including buttons,
lists forms etc.
Layouts
View hierarchies that control screen format and
appearance of the views.
Intents
Messages wiring components together.
Resources
External elements, such as strings, constants and
drawable pictures.
Manifest
Configuration file for the application.
Java
This contains the .java source files for your project. By default, it includes
an MainActivity.java source file having an activity class
res/drawable-hdpi
This is a directory for drawable objects that are designed for high-
density screens
res/layout
This is a directory for files that define your app's user interface
res/values
This is a directory for other various XML files that contain a collection of
resources, such as strings and colours definitions.
AndroidManifest.xml
This is the manifest file which describes the fundamental
characteristics of the app and defines each of its components.
MyProject/
app/
manifest/
AndroidManifest.xml
java/
MyActivity.java
res/
drawable/
icon.png
layout/
activity_main.xml
info.xml
values/
strings.xml