Lesson 7 Android Mobile Application Development
Lesson 7 Android Mobile Application Development
What is android?
Complete: allows for rich application development opportunities.
Open: It is provided through open source licensing.
Free: Android applications are free to develop. Android applications can be
distributed and commercialized in a variety of ways.
Features of Android
Free and Open Source
Familiar and inexpensive development tools
Freely available SDK
Familiar Language, Familiar Development Environments
Reasonable learning curve for developers
Enabling development of powerful applications
Rich, secure application integration
No costly obstacles to publication
A new growing platform
What it is not?
Android is not:
A Java ME implementation: Android applications are written in the Java language, but they are
not run within a Java ME virtual machine, and Javacompiled classes and executable will not run
natively in Android.
Part of the Linux Phone Standards Forum or the Open Mobile Alliance: Android runs on an
opencomplete software stack approach goes further than the focus of these standards-defining
organizations.
Simply an application layer (like UIQ or S60): While Android does include an encompassing
the underlying operating system, the API libraries, and the applications themselves.
A mobile phone handset Android includes a reference design for mobile handset designed to
support many alternative hardware devices.
: The iPhone is a fully proprietary hardware and software platform released by a single company
(Apple), while Android is an open-source software
NATIVE ANDROID APPLICATIONS
Android phones will normally come with a suite of generic preinstalled applications that are part
of the Android Open Source Project (AOSP), including, but not necessarily limited to:
An e-mail client
An SMS management application
A full PIM (personal information management) suite including a calendar and
contacts list
A Web Kit-based web browser
A music player and picture gallery
A camera and video recording application
A calculator
The home screen
An alarm clock
In many cases Android devices will also ship with the following proprietary Google
mobile applications:
The Android Market client for downloading third-party Android applications
A fully-featured mobile Google Maps application including StreetView, driving
directions and turn-by-turn navigation, satellite view, and traffic conditions
The Gmail mail client
The Google Talk instant-messaging client
The YouTube video player
ANDROID SDK FEATURES
The true appeal of Android as a development environment lays in the APIs it provides. As an
application-neutral platform, Android gives you the opportunity to create applications that are as
much a part of the phone as anything provided out of the box. The following list highlights some
of the most noteworthy Android features:
No licensing, distribution, or development fees or release approval processes
Wi-Fi hardware access GSM, EDGE, and 3G networks for telephony or data transfer, enabling
you to make or receive calls or SMS messages, or to send and retrieve data across
mobile networks
Comprehensive APIs for location-based services such as GPS
Full multimedia hardware control, including playback and recording with the
camera and microphone
APIs for using sensor hardware, including accelerometers and the compass
Libraries for using Bluetooth for peer-to-peer data transfer
IPC message passing
Shared data stores
Background applications and processes
Home-screen Widgets, Live Folders, and Live Wallpaper
The ability to integrate application search results into the system search
An integrated open-source HTML5WebKit-based browser
Full support for applications that integrate map controls as part of their user interface
Mobile-optimized hardware-accelerated graphics, including a path-based 2D graphics library
and support for 3D graphics using OpenGL ES 2.0
Media libraries for playing and recording a variety of audio/video or still image formats
Localization through a dynamic resource framework
An application framework that encourages reuse of application components and the replacement
of native applications
ANDROID ARCHITECTURE
Android is an open source, Linux-based software stack created for a wide array of devices and
form factors. The following diagram shows the major components of the
Android platform.
The Linux Kernel
The foundation of the Android platform is the Linux kernel. For example, the Android
Runtime (ART) relies on the Linux kernel for underlying functionalities such as threading and
low-level memory management. Using a Linux kernel allows Android to take advantage of key
security features and allows device manufacturers to develop hardware drivers for a well-known
kernel.
Hardware Abstraction Layer (HAL)
The hardware abstraction layer (HAL) provides standard interfaces that expose
device hardware capabilities to the higher-level Java API framework. The HAL
consists of multiple library modules, each of which implements an interface for a
specific type of hardware component, such as the camera or Bluetooth module.
When a framework API makes a call to access device hardware, the Android system
loads the library module for that hardware component.
Android Runtime
For devices running Android version 5.0 (API level 21) or higher, each app runs in its
own process and with its own instance of the Android Runtime (ART). ART is written
to run multiple virtual machines on low-memory devices by executing DEX files, a
byte code format designed especially for Android that's optimized for minimal
memory footprint. Build tool chains, such as Jack, compile Java sources into DEX
byte code, which can run on the Android platform.
Some of the major features of ART include the following:
Ahead-of-time (AOT) and just-in-time (JIT) compilation
Optimized garbage collection (GC)
On Android 9 (API level 28) and higher, conversion of an app package's Dalvik Executable
format (DEX) files to more compact machine code.
Better debugging support, including a dedicated sampling profiler, detailed diagnostic
exceptions and crash reporting, and the ability to set watch points to monitor specific fields
Prior to Android version 5.0 (API level 21), Dalvik was the Android runtime. If your app runs
well on ART, then it should work on Dalvik as well, but the reverse may not be true. Android
also includes a set of core runtime libraries that provide most of the functionality of the Java
programming language, including some Java 8 language features that the Java API framework
uses.
Native C/C++ Libraries
Many core Android system components and services, such as ART and HAL, are
built from native code that requires native libraries written in C and C++. The Android
platform provides Java framework APIs to expose the functionality of some of these
native libraries to apps. For example, you can access OpenGL ES through the
2D and 3D graphics in your app. If you are developing an app that requires C or C++
code, you can use the Android NDK to access some of these native platform libraries
directly from your native code
Java API Framework
The entire feature-set of the Android OS is available to you through APIs written in
the Java language. These APIs form the building blocks you need to create Android
apps by simplifying the reuse of core, modular system components and services,
which include the following:
lists, grids, text boxes, buttons, and even an embeddable web browser
A Resource Manager, providing access to non-code resources such as localized strings,
graphics, and layout files
A Notification Manager that enables all apps to display custom alerts in the status bar
An Activity Manager that manages the lifecycle of apps and provides a common navigation
back stack
Content Providers that enable apps to access data from other apps, such as the Contacts app, or
to share their own data
Developers have full access to the same framework APIs that Android system apps use.
System Apps
Android comes with a set of core apps for email, SMS messaging, calendars, internet browsing,
contacts, and more. Apps included with the platform have no special status among the apps the
user chooses to install. So a third-party app can become the user's default web browser, SMS
messenger, or even the default keyboard (some exceptions apply, such as the system's Settings
app).
The system apps function both as apps for users and to provide key capabilities that developers
can access from their own app. For example, if your app would like to deliver an SMS message,
you don't need to build that functionality you you can instead invoke whichever SMS app is
already installed to deliver a message to the recipient you specify.
Factors that affect Mobile Application development
You should keep in mind the following factors while developing mobile application:
Low processing power
Limited RAM
Limited permanent storage capacity
Small screens with low resolution
High costs associated with data transfer
Slow data transfer rates with high latency
Unreliable data connections
Limited battery life
Following are some of the factors that affect app development time:
User Interface & User Experience.
Custom application
Resource availability
App security and publishing the app
App designing
Number of screens/devices/platforms/operating systems
Third party integration
Features
Understanding the business logic
Complexity of the App
Other components
Fragments
– Represents a portion of user interface in an Activity.
• 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.