Mobile Application
Development
Chapter
one
Outline
Introduction
What is mobile computing, android?
Why android?
Feature, category, and history of android.
What is API level?
Android architecture
How android work?
Android IDE
Main Sections of the IDE
Mobile Computing
Its an umbrella term used to describe technologies that enable people
to access services anyplace and anytime.
Mobile computing has three main components which are mobile
hardware, mobile software, and mobile communication.
In mobile technology, Android and iOS are primarily used operating
systems.
Android is now the world’s most commonly used smartphone
platform and is used by many different phone manufacturers.
iOS is only used on Apple devices, such as the iPhone.
What is Android?
What is Android?
Its an Open source and Linux-based OS for mobile devices
» such as smartphones, tablet computers, and digital
television, Vehicle. Watches and Android are also used on
game, digital cameras other electronics.
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.
Cont…
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 or the Amazon
App store.
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.
Why android?
Features of Android
Beautiful UI
Connectivity (like Bluetooth, Wi-Fi, CDMA,
GSM/EDGE)
Storage
Media support
Messaging
Web browser
Multi-tasking
Categories of Android applications
• Entertainment
• Tools
• Communication
• Productivity
• Personalization
• Music and Audio
• Social
• Media and Video
• Travel and Local
Categories of Android applications
History of Android
What is API level?
API level is basically the Android version.
Instead of using the Android version name (eg 2.0, 2.3,
3.0, etc) an integer number is used.
This number is increased with each version.
Android 1.6 is API Level 4, Android 2.0 is API Level 5, Android 2.0.1
is API Level 6, and so on.
API Level is an integer value that uniquely identifies the framework
API revision offered by a version of the Android platform..
Cont…
Platform Version API Level VERSION_CODE
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
Android 4.0.3, 4.0.4 15 ICE_CREAM_SANDWICH_MR1
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
Android Architecture
Cont…
Linux kernel
» Linux kernel exists at the root of android architecture and is thus
also called as the heart of the android architecture. This provides a
level of abstraction between the device hardware.
» The device drivers, power management, memory management,
device management, and resource access , and a security model
comes under the responsibility of the Linux Kernel.
Libraries
» It can include everything needed to build an app, including source
code, resource files, and an Android manifest.
» Web browser engine WebKit, c runtime library libc, SQLite
database which is a useful repository for storage and sharing of
application data, media libraries to play and record audio and
video, SSL libraries responsible for Internet security etc.
Cont…
Android Runtime
» The core libraries and DVM (Dalvik Virtual Machine) are there in
android runtime.
» They are responsible for running android applications. Originally
being like JVM,
» DVM is optimized for mobile devices to consume less memory
and to facilitate a fast performance..
The Dalvik VM enables every Android application to run in its own process,
with its own instance of the DVM
» The Android runtime also provides a set of core libraries which
enable Android application developers to write Android
applications using standard Java programming language.
Cont…
Application Framework
» The Application Framework layer provides many higher-level
services to applications in the form of Java classes and interfaces.
» The Android framework includes different key services: Activity
Manager, Content Providers, Resource Manager, Notifications
Manager and View System
Applications
» You will find all the Android application at the top layer.
» You will write your application to be installed on this layer only.
» Examples of such applications are Home, Contacts, Settings,
Books, Browser, Games etc.
How it Work
Similar to Java applications, Android applications also run on a
VM. There are two special virtual machines used in Android:
Dalvik Virtual Machine (DVM) has been the default runtime
environment (~ virtual machine) until the Lollipop release
(Android 5.0). and
Android Run Time (ART) is introduced by Android 4.0 and has
been the default VM as of Android 5.0.
The main advantage of ART over DVM is the utilization of a concept called Ahead of Time
(AOT) compilation instead of Just in Time (JIT) approach.
The .apk files (executable of Android apps) actually run on these virtual
machines.
Setting Up Your Development
Environment
Android Studio is the official IDE for Android app development.
Android Studio offers even more features that enhance your
productivity when building Android apps, such as:
» A flexible Gradle-based build system
» A fast and feature-rich emulator
» A unified environment where you can develop for all Android
devices
» Apply Changes to push code and resource changes to your running
app without restarting your app
Cont…
» Code templates and GitHub integration to help you build common
app features and import sample code
» Extensive testing tools and frameworks
» Lint tools to catch performance, usability, version compatibility,
and other problems
» C++ and NDK support
» Built-in support for Google Cloud Platform, making it easy to
integrate Google Cloud Messaging and App Engine
System Requirements
» Operating System Version - Microsoft Windows 7/8/10 (32-
bit or 64-bit).
» Random Access Memory (RAM) - Minimum 4 GB RAM
and 8 GB RAM recommended.
» Free Disk Space - Minimum 2 GB and 4 GB recommended.
» Minimum Required JDK Version - Java Development Kit
(JDK) 8.
» Minimum Screen Resolution - 1280 * [Link]
Installation of Android Studio
Installation of Java
[Link]
oads/jre8-
[Link].
Cont…
Installation of Android Studio and Android SDK
– Navigate to the official download site
[Link]
» install it with the usual installation procedure (Next, next, …).
Cont…
Finally, Click on the "Finish" button to proceed.
Android Studio Setup Configuration
Android Studio Setup Wizard" will appear on
the screen with the welcome wizard. Click on
the "Next" button.
Cont…
Cont…
Cont…
Creating Your First Project
Cont…
Installation of Emulators
Emulators are software that mimics the behavior of
real devices
we run the apps on emulators for testing on various
devices
Emulators are also called as “Android Virtual
Devices (AVDs)”
Tools AVD Manager
Cont…
Cont…
Cont…
Running on a Real Device
Things to be done on the device
» Enable the Developer Mode on the device
Settings About Build number or Settings About
Software information Build number
» Once you find the Build number, tap on it seven times
and then your device will show a dialog box saying
“You’re now a developer.”
» Find a “Developer options” under the Settings of your
device. Please tap on it and then check “USB debugging”
to enable debugging via the USB connection.
» Update device driver of your mobile in device manager
Main Sections of the IDE
Cont…
The opened files can be activated
from the tabs located here for
viewing in the middle pane.
Cont…
This section is also controlled
via tabs.
The developer can switch
project files, structures,
captures and favorites for
viewing in the left pane.
This is the middle pane.
Contents of the active files can be viewed and changed from here.
Cont…
The current or previous compilation, building or
debugging processes are shown here.
This is the Run button of Android Studio.
we click this button to make the Android Studio build the project
and then we can run it on an emulator or on a real device.
Folder and File Structure of an
Android Studio Project
Cont…
manifests folder
» This folder has the [Link] file inside.
» This file contains the configuration parameters of the
project such as permissions, services and additional
libraries.
java folder
» The source code files written in Java programming
language reside in this folder.
» You can see that the java file of the activity named
“[Link]” is automatically created in this
folder.
Cont…
res folder
» The resource files are contained in this folder.
» Resources basically mean all the needed files except the source
code.
For example, if we want to include an mp3 file in our project, we place this
file inside the “res”.
» The media, image and layout files residing in the resources folder
are accessed via Java code written in [Link] as we’ll
see in a while.
Building the User Interface
Android Studio provides an easy way of designing user interfaces.
The file named “activity_main.xml” located under the “res/layout”
folder contains all the layout information of the current activity.
Cont…
At the left top of the middle pane, there exists a tab called “Palette”
When the palette tab is
clicked, two panes are
opened: the Palette shown
by the upper rectangle and
the Component Tree pane
inside the lower rectangle
Cont…
select this TextView and then drag and drop to the middle by the help
of the guiding lines as shown below
After the drag and drop
operation, the TextView will
be kept selected.
We can now change the
properties of the
TextView using the
Properties pane which is
at the right of the Layout
view
Exercise
Develop android application that displays your
personal information using TextView UI with
necessary properties