Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Unit IV
Android Overview
WHAT IS ANDROID?
A Software platform and operating system for
mobile.
Based on the Linux kernel.
An open source
Android was found way back in 2003.
It was developed in Palo Alto, California.
Android was developed by the Andy Rubin, Rich
Miner, Nick Sears and Chris White.
Android was purchased by the GOOGLE in
AUGUST,2005 for 50 million $.
What’s Android
It’s a software stack for mobile devices that includes an
operating system, middleware and key applications
Android is based on JAVA and all its applications are
developed in JAVA
The JAVA VM, known as Dalvik, is highly customized
and optimized for mobile devices
Android SDK offers rich tools for android application
development and many useful APIs。
It’s not 1984
3
OHA and Android
OHA(Open Handset Alliance) is a group of 71 technology and
mobile companies, including Google, Intel, Dell, HTC and
China Mobile…
OHA’s aim:
accelerate innovation in mobile phones
offer consumers a richer, less expensive, and better mobile
experience
OHA developed Android, the first complete, open and free
mobile platform
OHA was initially called up by Google, and Google is the
‘captain’
Reason for Nokia not to develop Android Mobiles is
Nokia is not part of OHA.
4
Android Features
A software stack for mobile devices that includes
An operating system
Middleware
Key Applications
Application framework enabling reuse and replacement of
components
Optimized Java virtual machine: Dalvik
Rich development environment, including an emulator,
debugging tools, memory probe tools, log tools and
powerful eclipse plugins.
Uses Linux to provide core system services
Security
Memory management
Process management
Power management
Hardware drivers
5
Feature
Description
Android Features
Beautiful UI
Android OS basic screen provides a beautiful and intuitive user
interface.
Connectivity
GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi,
LTE, NFC and WiMAX.
Storage
SQLite, a lightweight relational database, is used for data storage
purposes.
Media support
H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC, HE-AAC, AAC
5.1, MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, and BMP
Messaging
SMS and MMS
Web browser
Based on the open-source WebKit layout engine, coupled with
Chrome's V8 JavaScript engine supporting HTML5 and CSS3.
Multi-touch
Android has native support for multi-touch which was initially made
available in handsets such as the HTC Hero.
6
Feature
Multi-tasking
Description
Android Features
User can jump from one task to another and same time various
application can run simultaneously.
Resizable widgets Widgets are resizable, so users can expand them to show more
content or shrink them to save space
Multi-Language
Supports single direction and bi-directional text.
GCM
Google Cloud Messaging (GCM) is a service that lets developers
send short message data to their users on Android devices, without
needing a proprietary sync solution.
Wi-Fi Direct
A technology that lets apps discover and pair directly, over a highbandwidth peer-to-peer connection.
Android Beam
A popular NFC-based technology that lets users instantly share,
just by touching two NFC-enabled phones together.
7
FEATURE
Ease of use
Voice to text
Gaming
Customizable
Music Player
Notification system
Google voice
ANDROID
iOS
Android Astro 1.0
First full version of android and Released in November 2007
Commercial Version released on September 23, 2008.
Wi-Fi and Bluetooth support.
Quite slow in operating.
copy and paste feature in the web browser is not present
Android Beta
First Version of Android.
Released in November 2007
The focus of Android beta is testing incorporating usability.
Android beta will generally have many more problems on speed and
performance.
Android Cupcake 1.5
Released on April 30, 2009.
Added auto-rotation option.
Copy and Paste feature added in the web browser.
Increased speed and performance but not upto required level.
Android Donut 1.6
Released on September 15, 2009.
Voice search and Search box were added.
Faster OS boot times and fast web browsing experience.
Typing is quite slower.
Android Éclair 2.0/2.1
Released on October 26, 2009.
Bluetooth 2.1 support.
no Adobe flash media support.
Improved typing speed on virtual keyboard, with smarter dictionary.
Android Froyo 2.2
Released on May 20, 2010.
Support for Adobe Flash 10.1
Improved Application launcher with better browser
No internet calling.
Android Gingerbread 2.3
Released on December 6, 2010.
Updated User Interface with high efficiency and speed
One touch word selection and copy/paste, Internet calling
New keyboard for faster word input.
More successful version of Android than previous versions.
not supports multi-core processors.
Android Honeycomb 3.0
Released on February 22, 2011.
Support for multi-core processors
Ability to encrypt all user data.
This version of android is only available for tablets.
Android IceCreamSandwich(ICS) 4.0
Released on November 14, 2011.
Virtual button in the UI.
A new typeface family for the UI, Roboto.
Ability to shut down apps that are using data in the background.
Android JellyBean 4.1
Released on June 27, 2012.
Smoother user interface.
Android Kitkat 4.4
Released on September 3, 2013
Initially under the "Key Lime Pie" ("KLP") codename
Wireless printing capability
(Android Runtime (ART) introduced as a new experimental application runtime environment, not
enabled by default, as a replacement for the Dalvik virtual machine.)
Android Lolipop 5.1
Unveiled on June 25, 2014
Latest version of Android.
A do-not-disturb feature
(Dalvik virtual machine was officially replaced by Android Runtime (ART),
which is a new runtime environment that was introduced as a technology preview
in KitKat.)
Android Marshmallow 6.0
officially released in October 2015
focuses on improving the overall user experience of
Lollipop
a new power management system that reduces
background activity when a device is not being
physically handled
native support for fingerprint recognition and USB TypeC connectors
the ability to migrate data to a microSD card and use it as
primary storage, as well as other internal changes.
Architecture
16
Linux Kernel
Android based on a Linux kernel not a Linux OS
Supplies
Security,
Memory
management,
Process
management, Network stack and Driver model
Acts as an abstraction layer between the hardware and the rest
of the software stack
17
Libraries
Run in system background
Using C/C++ Language
4 types of Libraries
Bionic Libc, system C libraries
Function Libraries, supporting multimedia, web browser,
SQLite...
Native Servers
Hardware Abstraction Libraries
18
Core Libraries
System C library, the standard C system library, tuned for
embedded Linux-based devices
Media Libraries, support playback and recording of many
popular audio and video formats, as well as image files,
including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
Surface Manager, manages access to the display subsystem
and seamlessly composites 2D and 3D graphic layers from
multiple applications
WebKit, a modern web browser engine which powers both the
Android browser and an embeddable web view
SGL, the underlying 2D graphics engine
3D libraries, an implementation based on OpenGL ES 1.0 APIs
FreeType , bitmap and vector font rendering
SQLite , a powerful and lightweight relational database engine
19
Android Runtime
The core of Android platform
Dalvik Virtual Machine
Java core Libraries
Register-based
Executes files in the Dalvik Executable (.dex) format
Provides most of the functionality of the Java programming language.
The functions of Java core libraries rely on the Dalvik VM
and the underlying Linux kernel
Multiple Dalvik VMs may run at the same time
Every Android application runs in its own process, with its
own instance of the Dalvik virtual machine
The "dx" tool in Android SDK can transform compiled JAVA class
into the .dex format
20
Dalvik Virtual Machine
Android custom implementation virtual machine
Provides application portability and runtime consistency
Runs optimized file format (.dex) and Dalvik bytecode
Java .class / .jar files converted to .dex at build time
Designed for embedded environment
Supports multiple virtual machine processes per device
Highly CPU-optimized bytecode interpreter
Efficiently Using runtime memory
Core Libraries
Core APIs for Java language provide a powerful, yet
simple and familiar development platform
21
Android development
Android
Manifest
Resource
XML
Java Source
Generated
Class
Android
Libraries
Java
Compiler
.dex
File
Dalvik
VM
DVM vs. JVM
DVM
Google
Dalvik executable
Only supports a subset of standard Java Library
JVM
Sun
Java bytecode
Some worries that Java world may be divided into
different communities, each has its own Java standard
23
Application Framework
Simplify the reuse of components
Applications can publish their capabilities and any
other application may then make use of those
capabilities
Applications is a set of services and systems, include
Views system, content providers, resources manager
and so on
24
Application Framework (cont.)
Activity Manager, manages the lifecycle of applications
and provides a common navigation backstack
Notification Manager, enables all applications to display
custom alerts in the status bar
Resource Manager, providing access to non-code
resources such as localized strings, graphics, and layout
files
Content Providers, access data from other applications
(such as Contacts), or to share their own data
Views, used to build an application, including lists, grids,
text boxes, buttons, and even an embeddable web browser
25
Applications
A set of core applications shipped with Android platform
an email client, SMS program, calendar, maps,
browser, contacts, and others
All written in Java
Our applications are in the same level as these
applications
26
Mobile Devices: Advantages (as
compared to fixed devices)
Always with the user
Typically have Internet access
Typically GPS enabled
Typically have accelerometer & compass
Most have cameras & microphones
Many apps are free or low-cost
Mobile Devices: Disadvantages
Limited screen size, battery life, processor speed
Limited and sometimes slow network access
Limited web browser functionality
Range of platforms & configurations across devices
Making source code available to everyone inevitably
invites the attention of hackers.
Android operating system uses more amount of battery
as compared to normal mobile phones.
As there are so many user sometimes it becomes difficult
to connect all the users.
As we call Android is world of applications we
continuously need to connected with the internet which is
not possible for all the users.
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
Online Resources
developer.android.com
code.google.com/p/apps-for-android/
stackoverflow.com
videos from Google I/O conferences
“Hello, Android”
Creating Your First Android App
1.
Set up your development environment
2.
Create a new Android project in Eclipse
3.
Run it in the emulator
1. Set Up Your Android
Environment
http://developer.android.com/sdk
Install Eclipse
Install Android SDK (Android libraries)
Install ADT plugin (Android development tools)
Create AVD (Android virtual device)
2. Create an Android Project in
Eclipse
File → New → Project
Select “Android Project”
Fill in Project details...
Directory
name
Android
version
Name that appears
on device
Class to
automatically
create
Java package
3. Run the Android Application
Run → Run (or click the “Run” button)
Select “Android Application”
The emulator may take a few minutes to start, so
be patient!
You don't need to restart the emulator when you
have a new version of your application
Source
code
Auto-generated
code
String
constants
UI
layout
Configuration
HelloAndroid.java
1
2
3
4
5
6
7
8
9
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
main.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout
3
xmlns:android="http://schemas.android.com/apk/res/android"
4
android:orientation="vertical"
5
android:layout_width="fill_parent"
6
android:layout_height="fill_parent"
7 >
8
<TextView
9
android:layout_width="fill_parent"
10
android:layout_height="wrap_content"
11
android:text="@string/hello "
12
/>
13 </LinearLayout>
strings.xml
1
2
3
4
5
6
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, HelloAndroid!
</string>
<string name="app_name">Hello, Android</string>
</resources>
AndroidManifest.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest
3
xmlns:android="http://schemas.android.com/apk/res/android"
4
package="edu.upenn.cis542"
5
android:versionCode="1"
6
android:versionName="1.0">
7
<application android:icon="@drawable/icon"
8
android:label="@string/app_name">
9
<activity android:name=".HelloAndroid"
10
android:label="@string/app_name">
11
<intent-filter>
12
<action
13
android:name="android.intent.action.MAIN" />
14
<category
15
android:name="android.intent.category.LAUNCHER"/>
16
</intent-filter>
17
</activity>
18
</application>
19 </manifest>