0% found this document useful (0 votes)
13 views

ChapterAT 1

The document provides an overview of mobile programming, focusing on mobile operating systems, particularly Android. It covers the history, architecture, and components of Android, detailing its evolution from its inception to the present, including various versions and the transition from Dalvik Virtual Machine to Android Runtime. Additionally, it outlines the requirements for developing Android applications and the structure of an Android project.

Uploaded by

tilay1921
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

ChapterAT 1

The document provides an overview of mobile programming, focusing on mobile operating systems, particularly Android. It covers the history, architecture, and components of Android, detailing its evolution from its inception to the present, including various versions and the transition from Dalvik Virtual Machine to Android Runtime. Additionally, it outlines the requirements for developing Android applications and the structure of an Android project.

Uploaded by

tilay1921
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Chapter 1

Mobile Programming
Introduction
Mobile Devices need some type of OS to run its services
OS:- a software platform on top of which other apps can
run on
Modern OS combines a PC with other mobile specific
features like Bluetooth, GPS, speech recognition,
video camera, infrared etc, so mobile OS had to grow to
support all these features. This results the growth of
technology
Some of the mobile operating systems are:
iOS:- Developed by Apple inc. and distributed exclusively
for Apple Hardware
Windows Phone:- A proprietary software Smartphone
OS developed by Microsoft
Android:- Developed by Open Handset Alliance (OHA),
Led by Google
Other OSs are: Symbian, BlackBerry, webOS
What is Android?
An open source mobile OS developed
by Google, based on the Linux kernel
It is designed primarily for touch
screen mobile devices such as smart
phones, tablets, mp4 players, TVs etc.
It is a software stack for mobile
devices that includes an operating
system, middleware and key
applications
Android SDK provides the tools and
APIs necessary to develop applications
History of Android
Initially, Andy Rubin founded Android Incorporation in
Palo Alto, California, United States in October, 2003.
In 17th August 2005, Google acquired android
Incorporation. Since then, it is in the subsidiary of
Google Incorporation.
Originally intended for camera but shifted to smart
phones later because of low market for camera
only.
Android is the nick name of Andy Rubin given by
coworkers because of his love to robots.
Google formed Open Handset Alliance (OHA) on 5th
November 2007.
OHA is a group of 84 technology and mobile companies who
have come together to accelerate innovation.
HTC Dream was the first Commercial Smartphone running
Android (T-Mobile 2008)
Android Versions
Date Version Code name API Level
September 23, 2008 1.0 No codename 1
February 9, 2009 1.1 Petit Four 2
April 27, 2009 1.5 Cupcake 3
September 15, 2009 1.6 Donut 4
October 26, 2009 2.0 - 2.1 Éclair 5-7
May 20, 2010 2.2 – 2.2.3 Froyo 8
December 6, 2010 2.3 – 2.3.7 Gingerbread 9 - 10
February 22, 2011 3.0 – 3.2.6 Honeycomb 11 - 13
October 18, 2011 4.0 – 4.0.4 Ice Cream Sandwich 14 - 15
July 9, 2012 4.1 - 4.3 Jelly Bean 16 - 18
October 31, 2013 4.4 - 4.4.4 KitKat 19-20
November 12, 2014 5.0 - 5.1.1 Lollipop 21-22
October 5, 2015 6.0 - 6.0.1 Marshmallow 23
August 22, 2016 7.0 -7.1.2 Nougat 24-25
August 21, 2017 8.0 Oreo 26-27
August 6, 2018 9.0 Pie 28
Android Architecture
Linux Kernel
Is the OS.
It is responsible for:
Memory Management:- allocate and free
memory for files
Power Management:- Provide power for various
devices such as Bluetooth, camera etc.
Resource Management:- provide resource for
each process and making it versatile.
Driver Management:- handle installations of
various drivers
Go to “About phone” or “About tablet” in
Android’s settings to find out the kernel
version
Middleware
Libraries:-
Used for interacting with low level media
components (programs written in some other
languages like C, C++, Assembly language which are
specific to hardware and operating system or native
application).
Example: WebKit library is responsible for browser
support, SQLite is for database, FreeType for font
support, Media for playing and recording audio and
video formats.
Application 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
Android Runtimes:-
includes Dalvik Virtual Machine(DVM)
and Core Libraries 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.
Applications
is the top most layer of Android
Architecture.
All applications using android framework
uses android runtime and libraries,
while android runtime and native
libraries are using Linux Kernel.
Dalvik Virtual Machine(DVM)
.java file .dex file

Java Compiler Dex Compiler Packaging


(aapt)
(javac) (dx)

.class files .apk file


 Android applications can be developed using languages
such as C++, C#, Java etc. But the official language is
Java.
 JDK compiles a Java Code and Produces a .class file (byte
code)
 In android Dex compiler takes .class file and
produce .dex file, DVM takes .dex file and generate a
machine code.
 DVM was used as runtime in Android v 2.2 – 5.0 and
then replaced by Android Run Time. ART was introduced
Why did Google switched from DVM
to ART?
DVM
based on JIT compilation i.e. that each time you run an app,
the part of the code required for its execution is going to be
translated (compiled) to machine code at that moment
Requires smaller memory but more CPU overhead
ART
compiles the intermediate language, Dalvik bytecode, into a
system independent binary during installation (once), thus
removing the lag that we see when we open an app on our
device
Less CPU usage and in turn results less battery drain
Memory is much cheaper now
Android Application Components
Activities: An activity in Android represents a single screen
with which a user can interact with. An application can have
one or more activities but run independently.
Services: Long running background process without any need of
user interaction is known as Service.
Broadcast Receiver: handle communication between
Android OS and applications. Example:-battery is low
notification, the sign of earphone as soon as you plug a headset
Content Provider: content providers are used to share data
between the applications. In android the data cannot be shared
directly between the two applications.
 Additional Components: Fragments, Views , Layouts,
Intent, Resources, Manifest etc
Getting Started
 In order to write android application we need:
Java Development Kit (JDK) and JRE (Java Runtime Environment)
IDE (Android Studio or Eclipse or Netbeans)
 Android Studio includes SDK (Software Development Kit)
 Android Emulator

Building your first app


 File>New>Android Application Project
 Fill Application Name and package name
 Select the Phone in Target SDK and proceed
 Select Activity and Finish
Running Application
You can run your application on Android
Emulator or Real Device
To run the application via Android Emulator
First create an Emulator in AVD manager and
Select Run>Run
To run the application via a real device
Go to Settings>General>About Phone.
Scroll and select Software Information>Build
Number.
Quickly tap on “Build Number” seven times and
you will see the message “You are now a
developer”.
 Connect your mobile device and Select
Run>Run
Android Project Structure
Android Studio creates the necessary
structure for all your files and makes them
visible in the project window on the left
side of the IDE
App:
is the default module name for your project. You can
have one or more modules.
Module is a collection of source files and build
settings. It provides essential files and some code
templates
Manifest.xml:
describes the fundamental characteristics of an
app and each of its components.
 It works as an interface between your android OS
and your application.
Android Java:
contains the Java source code files
separated by package names and
JUnit test code.
All the Activity classes are stored
inside java folder
Android Resource:
contains all non-code resources, such
as xml layouts, UI strings, Styles,
Colors, bitmap images etc

You might also like