Chapter-01.
Android and its Tool 04 M
Introduction to Android
Android is an open source and Linux-based operating system for mobile devices such as
smart phones and tablet computers. Android was developed by the Open Handset
Alliance, led by Google, and other companies.
Android offers a unified approach to application development for mobile devices which
means developers need only develop for Android, and their applications should be able to
run on different devices powered by Android.
The first beta version of the Android Software Development Kit (SDK) was released by
Google in 2007 where as the first commercial version, Android 1.0, was released in
September 2008.
On June 27, 2012, at the Google I/O conference, Google announced the next Android
version, 4.1 Jelly Bean. Jelly Bean is an incremental update, with the primary aim of
improving the user interface, both in terms of functionality and performance.
The source code for Android is available under free and open source software licenses.
Google publishes most of the code under the Apache License version 2.0 and the rest,
Linux kernel changes, under the GNU General Public License version 2.
Why Android
OPEN HANDSET ALLIANCE
The Open Handset Alliance (OHA) is a consortium of 84 firms to
develop open standards for mobile devices. Member firms
include HTC, Sony, Dell, Intel, Motorola, Qualcomm, Texas
Instruments, Google, Samsung Electronics, LG Electronics, T-Mobile, Sprint
Corporation, Nvidia, and Wind River Systems.
The Open Handset Alliance (OHA) is a consortium whose goal is to develop
open standards for mobile devices, promote innovation in mobile phones and
provide a better experience for consumers at a lower cost.
The OHA was established on 5 November 2007, led by Google with 34
members, including mobile handset makers, application developers, some
mobile carriers and chip maker. Android, the flagship software of the alliance
(first developed by Google in 2007), is based on an open-source license and
has competed against mobile platforms
from Apple (iOS), Microsoft (Windows
Phone), Nokia( Symbian), HP (formerly Palm), Samsung
Electronics / Intel (Tizen, bada), and BlackBerry (BlackBerry OS).
Android Ecosystem
Android Ecosystem
Android is nothing but the inter-dependence between user, developer and equipment maker
one cannot exist without the other. The main building block of android ecosystem is
Android
Equipment maker for android device
Developer
1. User by device and application
Android users has more space for customizability their device. Android User are less
extroverted than other users and they are perceived to have greater levels of support.
Android users are also more likely to prefer saving their cost and love the openness of the
platform also they like to customize their device.
2. Equipment makers sell devices, sometimes bundled with applications
Android equipment is available in market in huge amount. Some of the listed below:
a. Smart watches:
A smart watch is a handheld, wearable device that closely relate a wristwatch or other time
device. In Addition to telling time, many smart watches are wireless connectivity oriented
such as Bluetooth capable. The Traditional watch becomes, in effect , a wireless Bluetooth
technology extending the capabilities of the wearer’s smartphone to the watch.
b. E-reader devices:
An e-reader is mobile electronic device that is used for reading digital e-books and journal
or other reading materials.
c. Internet TV/Smart TV:
An android TV box is small computer that plugs into any TV and gives the user the ability to
stream content, locally and online apps can be downloaded from google play store , install and
do most anything standard computer can do from streaming videos to writing a email .
3. Development buy devices, then make and sell application
-An android Development is specialist software developer in designing application for the
Android .Some of following task where android developer can play his role in development of
android apps.
-Design and build advanced application for the android platform.
-Collaborate and define with development team for design and ship new features.
-Troubleshoot and fix bugs in new and existing applications .
-Evaluate and implement new development tools work with outside data sources and APIS.
Need of Android
1. Android Market:
Android market is the techno based and fastest growing market in the world. You can
effortlessly get almost any software you wish for in the android market. The ready or
available software to run on your android phone means that your phone will have more
functionality and thus making it convenient to use.
2. Customization:
Androids offer the best in terms of end user experience mainly because of the extend that
one can customize his/her phone. Android is open source software. This means that
anybody with programming skills can create application for android device. This creates a
unbounded customization in terms of colors, design, functionality and general appearance
of your phone or tablet.
3. Rooting:
Expansion of the scope of functionality of your phone and boosts it’s performance
multiple times over. By rooting the device, makes it possible for you to change system
files in your device and thus enabling you to further customize it for a better experience.
4. The Android Community:
This is one of the major reasons which define need of android device is the best decision
you will ever make. The large android community provides you with the necessary help
and support to help you get the best out of your device. The limitless forums, blogs,
websites and guides written by experts will go a long way in boosting your experience as
a user.
5. Powerful Development Framework:
Android provides almost everything you need to build best-in-class app experiences. Android
provides a single application model that lets you deploy your apps broadly to hundreds of
millions of user across a wide range of devices – from phones to tablets.
6. Global partnerships and large installed base:
Building on the contributions of the open-source Linux community and more than 300 hardware,
software and carrier partners, android has rapidly becomes the fastest – growing mobile OS.
Android’s openness has made it a favorite for consumers and developers alike, driving strong
growth in app consumption. Android users download more than 1.5 billons app and games from
Google Play Store each month. With its partners, android is continuously pushing the boundaries
of hardware and software forward to bring new capabilities to users and developers.
Feature of Android
1 Beautiful UI
Android OS basic screen provides a beautiful and intuitive user interface.
2 Connectivity
GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, LTE, NFC and WiMAX.
3 Storage
SQLite, a lightweight relational database, is used for data storage purposes.
4 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.
5 Messaging
SMS and MMS
6 Web browser
Based on the open-source WebKit layout engine, coupled with Chrome's V8 JavaScript engine
supporting HTML5 and CSS3.
7 Multi-touch
Android has native support for multi-touch which was initially made available in handsets such
as the HTC Hero.
8 Multi-tasking
User can jump from one task to another and same time various application can run
simultaneously.
9 Resizable widgets
Widgets are resizable, so users can expand them to show more content or shrink them to save
space.
1 Multi-Language
0
Supports single direction and bi-directional text.
1 GCM
1
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.
1
Wi-Fi Direct
2
A technology that lets apps discover and pair directly, over a high-bandwidth peer-to-peer
connection.
1 Android Beam
3
A popular NFC-based technology that lets users instantly share, just by touching two NFC-
enabled phones together.
Android Applications
Android applications are usually developed in the Java language using the Android Software
Development Kit.
Once developed, Android applications can be packaged easily and sold out either through a
store such as Google Play, SlideME, Opera Mobile Store, Mobango, F-droid and
the Amazon Appstore.
Android powers hundreds of millions of mobile devices in more than 190 countries around
the world. It's the largest installed base of any mobile platform and growing fast. Every day
more than 1 million new Android devices are activated worldwide.
This tutorial has been written with an aim to teach you how to develop and package Android
application. We will start from environment setup for Android application programming and
then drill down to look into various aspects of Android applications.
What is API level?
API Level is an integer value that uniquely identifies the framework API revision offered
a version of the Android platform.
API
Platform Version VERSION_CODE
Level
Android 6.0 23 MARSHMALLOW
Android 5.1 22 LOLLIPOP_MR1
Android 5.0 21 LOLLIPOP
Android 4.4W 20 KITKAT_WATCH KitKat for Wearables Only
Android 4.4 19 KITKAT
Android 4.3 18 JELLY_BEAN_MR2
Android 4.2, 4.2.2 17 JELLY_BEAN_MR1
Android 4.1, 4.1.1 16 JELLY_BEAN
ICE_CREAM_SANDWICH_M
Android 4.0.3, 4.0.4 15
R1
Android 4.0, 4.0.1, 4.0.2 14 ICE_CREAM_SANDWICH
Android 3.2 13 HONEYCOMB_MR2
Android 3.1.x 12 HONEYCOMB_MR1
Android 3.0.x 11 HONEYCOMB
Android 2.3.4
10 GINGERBREAD_MR1
Android 2.3.3
Android 2.3.2
Android 2.3.1 9 GINGERBREAD
Android 2.3
Android 2.2.x 8 FROYO
Android 2.1.x 7 ECLAIR_MR1
Android 2.0.1 6 ECLAIR_0_1
Android 2.0 5 ECLAIR
Android 1.6 4 DONUT
Android 1.5 3 CUPCAKE
Android 1.1 2 BASE_1_1
Android 1.0 1 BASE
Tools and Software Required for developing and android Application
Android application development on either of the following operating systems −
Microsoft Windows XP or later version.
Mac OS X 10.5.8 or later version with Intel chip.
Linux including GNU C Library 2.7 or later.
Second point is that all the required tools to develop Android applications are freely
available and can be downloaded from the Web. Following is the list of software's you will
need before you start your Android application programming.
Java JDK5 or later version
Android Studio
Windows requirements
Microsoft Windows 7/8/10 (32-bit or 64-bit)
3 GB RAM minimum, 8 GB RAM recommended (plus 1 GB for the Android
Emulator)
2 GB of available disk space minimum, 4 GB recommended (500 MB for IDE plus 1.5
GB for Android SDK and emulator system image)
1280 x 800 minimum screen resolution
Mac OS requirements
Mac OS X 10.10 (Yosemite) or higher, up to 10.13 (High Sierra)
3 GB RAM minimum, 8 GB RAM recommended (plus 1 GB for the Android
Emulator)
2 GB of available disk space minimum, 4 GB recommended (500 MB for IDE plus 1.5
GB for Android SDK and emulator system image)
1280 x 800 minimum screen resolution
Linux OS requirements
GNOME or KDE desktop. Tested on Ubuntu 14.04 LTS, Trusty Tahr (64-bit
distribution capable of running 32-bit applications)
64-bit distribution capable of running 32-bit applications
GNU C Library (glibc) 2.19 or later
3 GB RAM minimum, 8 GB RAM recommended (plus 1 GB for the Android
Emulator)
2 GB of available disk space minimum, 4 GB recommended (500 MB for IDE plus 1.5
GB for Android SDK and emulator system image)
1280 x 800 minimum screen resolution
Android Architecture
Android architecture is a stack of software components. It is in the form of a software
application, operating system, run-time environment, middleware, native libraries and
services.
It is categorized into five parts as below:
1. Linux Kernel
2. Native Libraries
3. Android Runtime
4. Application Framework
5. Applications
Each part of the stack and the elements within each layer are integrated and provide optimal
application development and execution environment for mobile devices.
The following diagram shows the architecture of Android,
1. Linux Kernel
Linux is the heart of Android architecture.
It provides a level of abstraction between the hardware devices and the upper layers of
the Android software stack.
The Android operating system is based on the Linux kernel.
The Linux kernel is responsible for various device drivers such as Camera driver,
Display driver, Bluetooth driver, Keypad driver, Memory management, Process
management, Power management, etc.
2. Native Libraries
The native libraries such as Media, WebKit, SQLite, OpenGL, FreeType, C Runtime
library (libc) etc. are situated on the top of a Linux kernel.
Media library is responsible for playing and recording audio and video formats,
FreeType is for font support, WebKit is for browser support, SQLite is for database, SSL is
for Internet security etc.
3. Android Runtime
Android Runtime is the third section of the architecture and situated on the second
layer from the bottom.
Android Runtime includes core libraries and Dalvik Virtual Machine (DVM) which is
responsible to run android application.
Dalvik Virtual Machine (DVM) is like Java Virtual Machine (JVM) in Java, but
DVM is optimized for mobile Devices.
DVM makes use of the Linux core features like memory management and multi-
threading, which are essential in the Java language.
DVM provides fast performance and consumes less memory.
4. Application Framework
Application framework is situated on the top of the Native libraries and Android
runtime.
Android framework provides a lot of classes and interfaces for Android application
development and higher level services to the applications in the form of Java classes.
It includes Android API's such as Activity manager, Window manager, Content
Provider, Telephony Manager, etc.
Activity manger is responsible for controlling all the aspects of the application
lifecycle and activity stack, Content provider is responsible for allowing the applications to
publish and share the data with the other applications, View system is responsible for
creating application user interfaces, etc.
5. Applications
Applications are situated on the top of the Application framework.
The applications such as Home, Contact, Alarm, Calender, Camera, Browsers, etc.
use the Android framework which uses Android runtime and libraries. Android runtime and
Native libraries use Linux kernel.
The user can write his/her application to be installed on this layer only.