Unit-1-Android-And-Its-Tools MAD
Unit-1-Android-And-Its-Tools MAD
Unit-1-Android-And-Its-Tools MAD
Course Outcome:
Unit Outcomes:
---------------------------------------------------------------------------------------------------------------
Contents:
---------------------------------------------------------------------------------------------------------------
Introduction to android
What is Android?
Android is a stack of software for mobile devices that are an Operating System,
Middleware and Key Applications.
Operating System
Middleware
Key Applications
The Open Handset Alliance (OHA) is consortium of multiple companies like Samsung,
Sony, Intel and many more to provide services and deploy handsets using android
platform.
Android Ecosystem
Need of Android
There are so many reasons you should choose Android platform for mobile application
development.
The development tools like Android SDK, JDK, and Eclipse IDE etc. are free to download
for the android mobile application development. Also Google charge a small fee $25, to
distribute your mobile app on the Android Market.
2. Open Source
The Android OS is an open-source platform based on the Linux kernel and multiple
open-source libraries. In this way developers are free to contribute or extend the
platform as necessary for building mobile apps which run on Android devices.
3. Multi-Platform Support
In market, there are a wide range of hardware devices powered by the Android OS,
including many different phones and tablet. Even development of android mobile apps
can occur on Windows, Mac OS or Linux.
4. Multi-Carrier Support
World wide a large number of telecom carriers like Airtel, Vodafone, Idea Cellular, AT&T
Mobility, BSNL etc. are supporting Android powered phones.
Android Market place (Google Play store) has very few restrictions on the content or
functionality of an android app. So the developer can distribute theirs app through
Google Play store and as well other distribution channels like Amazon’s app store.
Features of Android
There are numerous features of android. Some of them are listed below:
Feature Description
Connectivity Android supports multiple connectivity technologies including
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 Android supports various type of audio/video/still media formats like:
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, BMP and WebP
Web The web browser available in Android is based on the open-source Blink
browser (previously WebKit) layout engine, coupled with Chrome's V8 JavaScript
engine supporting HTML5 and CSS3
Messaging SMS and MMS are available forms of messaging, it also include threaded
text messaging and Android Cloud To Device Messaging (C2DM) and now
support the enhanced version of C2DM, Android Google Cloud Messaging
(GCM) is also a part of Android Push Messaging services
Multi- Multitasking of applications, with unique handling of memory allocation,
tasking is available, using this user can jump from one task to another and at the
same time various application can run simultaneously
Resizable Widgets are re-sizable, so users can expand them to show more content
widgets or shrink them to save space
Multi-touch Android has native support for multi-touch which was initially made
available in handsets such as the HTC Hero
Wi-Fi A technology that lets apps discover and pair directly, over a high-
bandwidth peer-to-peer connection.
Screen Android supports capturing a screenshot by pressing the power and
capture home-screen buttons at the same time. This features supports after
Android 4.0
Android A popular NFC-based technology that lets users instantly share, just by
Beam touching two NFC-enabled phones together
Multi- Android supports multiple languages, also supports single direction and
Language bi-directional text
The android developer tools let you create interactive and powerful application for
android platform. The tools can be generally categorized into two types.
SDK tools
Platform tools
SDK tools
SDK tools are generally platform independent and are required no matter which
android platform you are working on. When you install the Android SDK into your
system, these tools get automatically installed. The list of SDK tools has been given
below −
1 android
This tool lets you manage AVDs, projects, and the installed components of the SDK
2 ddms
This tool lets you debug Android applications
3 Draw 9-Patch
This tool allows you to easily create a NinePatch graphic using a WYSIWYG editor
4 emulator
This tools let you test your applications without using a physical device
5 mksdcard
Helps you create a disk image (external sdcard storage) that you can use with the
emulator
6 proguard
Shrinks, optimizes, and obfuscates your code by removing unused code
7 sqlite3
Lets you access the SQLite data files created and used by Android applications
8 traceview
Provides a graphical viewer for execution logs saved by your application
9 Adb
Android Debug Bridge (adb) is a versatile command line tool that lets you
communicate with an emulator instance or connected Android-powered device.
2. DDMS
DDMS stands for Dalvik debug monitor server that provides many services on the
device. The service could include message formation, call spoofing, capturing
screenshot, exploring internal threads and file systems etc.
Running DDMS
From Android studio click on Tools>Android>Android device Monitor.
How it works
In android, each application runs in its own process and each process run in the
virtual machine. Each VM exposes a unique port, that a debugger can attach to.
3. Sqlite3
Sqlite3 is a command line program which is used to manage the SQLite
databases created by Android applications. The tool also allows us to execute
the SQL statements on the fly.
There are two ways through which you can use SQLite, either from remote shell
or you can use locally.
Platform tools
The platform tools are customized to support the features of the latest android
platform.
The platform tools are typically updated every time you install a new SDK
platform. Each update of the platform tools is backward compatible with older
platforms.
Some of the platform tools are listd below −
Android Debug bridge (ADB)
Android Interface definition language (AIDL)
aapt, dexdump and dex etc.
1.4 Android Architecture
Android architecture or Android software stack is categorized into five parts:
1. Linux kernel
2. native libraries (middleware),
3. Android Runtime
4. Application Framework
5. Applications
2) Native Libraries
Running on the top of the kernel, the Android framework was developed with various
features. It consists of various C/C++ core libraries with numerous of open source tools.
Some of these are:
1. The Android runtime:
The Android runtime consist of core libraries of Java and ART(the Android
RunTime). Older versions of Android (4.x and earlier) had Dalvik runtime.
3. WebKit:
This open source web browser engine provides all the functionality to display web
content and to simplify page loading.
4. Media frameworks:
These libraries allow you to play and record audio and video.
3) Android Runtime
In android runtime, there are core libraries and DVM (Dalvik Virtual Machine) which is
responsible to run android application. DVM is like JVM but it is optimized for mobile
devices. It consumes less memory and provides fast performance.
4) Android Framework
On the top of Native libraries and android runtime, there is android framework. Android
framework includes Android API's such as UI (User Interface), telephony, resources,
locations, Content Providers (data) and package managers. It provides a lot of classes
and interfaces for android application development.
1. Activity Manager:
It manages the activity lifecycle and the activity stack.
2. Telephony Manager:
It provides access to telephony services as related subscriber information, such as
phone numbers.
3. View System:
It builds the user interface by handling the views and layouts.
4. Location manager:
It finds the device’s geographic location.
5) Applications
On the top of android framework, there are applications. All applications such as home,
contact, settings, games, browsers are using android framework that uses android
runtime and libraries. Android runtime and native libraries are using linux kernal.
1. XML
In Android, XML is used for designing the application’s UI like creating layouts, views,
buttons, text fields etc. and also used in parsing data feeds from the internet.
2. View
A view is an UI which occupies rectangular area on the screen to draw and handle user
events.
3. Layout
Layout is the parent of view. It arranges all the views in a proper manner on the screen.
4. Activity
An activity can be referred as your device’s screen which you see. User can place UI
elements in any order in the created window of user’s choice.
5. Emulator
An emulator is an Android virtual device through which you can select the target
Android version or platform to run and test your developed application.
6. Manifest file
Manifest file acts as a metadata for every application. This file contains all the essential
information about the application like app icon, app name, launcher activity, and
required permissions etc.
7. Service
Service is an application component that can be used for long-running background
processes. It is not bounded with any activity as there is no UI. Any other application
component can start a service and this service will continue to run even when the user
switches from one application to another.
8. Broadcast Receiver
Broadcast Receiver is another building block of Android application development which
allows you to register for system and application events. It works in such a way that,
when the event triggers for the first time all the registered receivers through this
broadcast receiver will get notified for all the events by Android Runtime. To know
more about the broadcast receivers, kindly refer Android Basic Building Blocks.
9. Content Providers
Content Providers are used to share data between two applications. This can be
implemented in two ways:
1. When you want to implement the existing content provider in another application.
2. When you want to create a new content provider that can share its data with other
applications
10. Intent
Intent is a messaging object which can be used to communicate between two or more
components like activities, services, broadcast receiver etc. Intent can also be used to
start an activity or service or to deliver a broadcast message.