[go: up one dir, main page]

0% found this document useful (0 votes)
105 views40 pages

Mobile Application Development

This document provides an overview of mobile application development using Android. It discusses the Android architecture including activities, services, and components. It describes setting up the Android development environment and creating a simple "Hello World" application. Key topics covered include the Android software stack, core building blocks, and how to get started with Android Studio.

Uploaded by

Akhed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views40 pages

Mobile Application Development

This document provides an overview of mobile application development using Android. It discusses the Android architecture including activities, services, and components. It describes setting up the Android development environment and creating a simple "Hello World" application. Key topics covered include the Android software stack, core building blocks, and how to get started with Android Studio.

Uploaded by

Akhed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Mobile Application Development

Prof. Urmi Desai,SCET CO.


Course Outcome
Illustrate Android architecture, activities and their life
CO701.1 cycle.
Design user interface using Android UI And
CO701.2 Component
Develop application using web services and Firebase
CO701.3 to manage database operations
Integrate map, location services, Graphics, android
CO701.4 system and background services in application.
Examine the perfomance of Android Application using
CO701.5 emulator and deploy it.
Prof. Urmi Desai,SCET CO.
Mobile Application Development

Prof. Urmi Desai,SCET CO.


Java
• Basic Java programming
– Exceptions
– Inner Class, Interface
• Advanced topics we will touch:
– Java IO
– Java Thread
– Java Socket

Prof. Urmi Desai,SCET CO.


What is Android?
• Android is a complete set of software for mobile
devices such as tablet computers, notebooks,
smartphones, electronic book readers, set-top boxes
etc.
• It contains a linux-based Operating
System, middleware and key mobile applications.
• It is developed by Google and later the OHA (Open
Handset Alliance).
• Java language is mainly used to write the android code
even though other languages can be used.
• The goal of android project is to create a successful
real-world product that improves the mobile
experience for end users.
Prof. Urmi Desai,SCET CO.
What is Open Handset Alliance (OHA)
• It's a consortium of 84 companies such as
google, samsung, AKM, synaptics, KDDI,
Garmin, Teleca, Ebay, Intel etc.
• It was established on 5th November, 2007, led
by Google. It is committed to advance open
standards, provide services and deploy
handsets using the Android Plateform.

Prof. Urmi Desai,SCET CO.


Features of Android
• The important features of android are given below:
• 1) It is open-source.
• 2) Anyone can customize the Android Platform.
• 3) There are a lot of mobile applications that can be
chosen by the consumer.
• 4) It provides many interesting features like weather
details, opening screen, live RSS (Really Simple
Syndication) feeds etc.
• 5) It provides support for messaging services(SMS and
MMS), web browser, storage (SQLite), connectivity
(GSM, CDMA, Blue Tooth, Wi-Fi etc.), media, handset
layout etc.
Prof. Urmi Desai,SCET CO.
Categories of Android applications
• There are many android applications in the market. The
top categories are:
• Entertainment
• Tools
• Communication
• Productivity
• Personalization
• Music and Audio
• Social
• Media and Video
• Travel and Local etc.
Prof. Urmi Desai,SCET CO.
History of Android
• The code names of android ranges from A to P
currently,such
as Aestro, Blender, Cupcake, Donut, Eclair, Froyo, Gingerbr
ead, Honeycomb, Ice Cream Sandwitch, Jelly
Bean, KitKat and Lollipop, Marshmallow, Nougat, Oreo, Pie.
• Let's understand the android history in a sequence.
• 1) Initially, Andy Rubin founded Android Incorporation in
Palo Alto, California, United States in October, 2003.
• 2) In 17th August 2005, Google acquired android
Incorporation. Since then, it is in the subsidiary of Google
Incorporation.
• 3) The key employees of Android Incorporation are Andy
Rubin, Rich Miner, Chris White and Nick Sears.

Prof. Urmi Desai,SCET CO.


History of Android
• 4) Originally intended for camera but shifted to
smart phones later because of low market for
camera only.
• 5) Android is the nick name of Andy Rubin given
by coworkers because of his love to robots.
• 6) In 2007, Google announces the development
of android OS.
• 7) In 2008, HTC launched the first android mobile.

Prof. Urmi Desai,SCET CO.


Android Versions, Codename and API
Version Code name API Level

1.5 Cupcake 3

1.6 Donut 4

2.1 Eclair 7

2.2 Froyo 8

2.3 Gingerbread 9 and 10

3.1 and 3.3 Honeycomb 12 and 13

4.0 Ice Cream Sandwitch 15

4.1, 4.2 and 4.3 Jelly Bean 16, 17 and 18

4.4 KitKat 19

5.0 Lollipop 21

6.0 Marshmallow 23

7.0 Nougat 24-25

8.0 Oreo 26-27


Prof. Urmi Desai,SCET CO.
Android Architecture
• Android architecture or Android software
stack is categorized into five parts:
• linux kernel
• native libraries (middleware)
• Android Runtime
• Application Framework
• Applications

Prof. Urmi Desai,SCET CO.


Prof. Urmi Desai,SCET CO.
Linux Kernel
• It is the heart of android architecture that
exists at the root of android architecture.
• Linux kernel is responsible for device drivers,
power management, memory management,
device management and resource access.

Prof. Urmi Desai,SCET CO.


Native Libraries
•These contain all the code that provides the
main features of an Android OS.
•For example, the SQLite library provides
database support so that an application can use
it for data storage.
•The WebKit library provides functionalities for
web browsing.

Prof. Urmi Desai,SCET CO.


Android Runtime
•Android runtime provides a set of core libraries
that enable developers to write Android apps using
the Java programming language.
•The Android runtime also includes the Dalvik
virtual machine, which enables every Android
application to run in its own process, with its own
instance of the Dalvik virtual Machine.
•Dalvik is a specialized virtual machine designed
specifically for Android and optimized for battery-
powered mobile devices with limited memory and
CPU. Prof. Urmi Desai,SCET CO.
Application 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.
Prof. Urmi Desai,SCET CO.
Application Framework
• Activity Manager − Controls all aspects of the
application lifecycle and activity stack.
• Content Providers − Allows applications to
publish and share data with other applications.
• Resource Manager − Provides access to non-code
embedded resources such as strings, color
settings and user interface layouts.
• Notifications Manager − Allows applications to
display alerts and notifications to the user.
• View System − an extensible set of views used to
create application user interfaces.
Prof. Urmi Desai,SCET CO.
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. Prof. Urmi Desai,SCET CO.
Android Core Building Blocks
• The core building blocks or fundamental
components of android are activities, views,
intents, services, content providers, fragments
and AndroidManifest.xml.

Prof. Urmi Desai,SCET CO.


Android Core Building Blocks
• Activity
• An activity is a class that represents a single screen. It is like a Frame
in AWT.
• View
• A view is the UI element such as button, label, text field etc.
Anything that you see is a view.
• Intent
• Intent is used to invoke components. It is mainly used to: Start the
service, Launch an activity, Display a web page
• Service
• Service is a background process that can run for a long time.
• There are two types of services local and remote. Local service is
accessed from within the application whereas remote service is
accessed remotely from other applications running on the same
Prof. Urmi Desai,SCET CO.
device.
Android Core Building Blocks
• Content Provider
• Content Providers are used to share data between the applications.
• Fragment
• Fragments are like parts of activity. An activity can display one or
more fragments on the screen at the same time.
• AndroidManifest.xml
• It contains information about activities, content providers,
permissions etc. It is like the web.xml file in Java EE.
• Android Virtual Device (AVD)
• It is used to test the android application without the need for
mobile or tablet etc. It can be created in different configurations to
emulate different types of real devices.
Prof. Urmi Desai,SCET CO.
Setup Android Environment
• Android supports java, c++, c# etc. language to
develop android applications. Java is the
officially supported language for android
• Download and Install Android Studio.
• To Download android studio:
https://developer.android.com/studio
• And install it with follow the steps.

Prof. Urmi Desai,SCET CO.


Development with Android
Say Hello to Android Application
• For creating the simple example:
• Create the new android project
• Write the message (optional)
• Run the android application

Prof. Urmi Desai,SCET CO.


1) Create the New Android project
• For creating the new android studio project:
• 1) Select Start a new Android Studio project

Prof. Urmi Desai,SCET CO.


• Select the Activity type (Empty Activity).

Prof. Urmi Desai,SCET CO.


• 3) Give Name of Application, location,
language and Select the API level of
application and click finish.

Prof. Urmi Desai,SCET CO.


• Now an android project has been created. You
can explore the android project and see the
simple program, it looks like this:

Prof. Urmi Desai,SCET CO.


• Run the android application

Prof. Urmi Desai,SCET CO.


Android Emulator
• The Android emulator is
an Android Virtual Device
(AVD), which represents a
specific Android device.
• We can use the Android
emulator as a target device to
execute and test our Android
application on our PC.
• The Android emulator provides
almost all the functionality of a
real device.

Prof. Urmi Desai,SCET CO.


Internal Details of Hello Android
Example

Prof. Urmi Desai,SCET CO.


• Android application contains different
components such as java source code, string
resources, images, manifest file, apk file etc.
Let's understand the project structure of
android application.
• Java Source Code:MainActivity.java

Prof. Urmi Desai,SCET CO.


• (1) Activity is a java class that creates and default
window on the screen where we can place
different components such as Button, EditText,
TextView, Spinner etc. It is like the Frame of Java
AWT.
• It provides life cycle methods for activity such as
onCreate, onStop, OnResume etc.
• (2) The onCreate method is called when Activity
class is first created.
• (3) The setContentView(R.layout.activity_main)
gives information about our layout resource.
Here, our layout resources are defined in
activity_main.xml file.

Prof. Urmi Desai,SCET CO.


activity_main.xml

Prof. Urmi Desai,SCET CO.


AndroidManifest.xml file in android
• The AndroidManifest.xml file contains information of your
package, including components of the application such as
activities, services, broadcast receivers, content providers
etc.
• It performs some other tasks also:
• It is responsible to protect the application to access any
protected parts by providing the permissions.
• It also declares the android api that the application is going
to use.
• It lists the instrumentation classes. The instrumentation
classes provides profiling and other informations. These
informations are removed just before the application is
published etc.

Prof. Urmi Desai,SCET CO.


• <manifest>
• manifest is the root element of the AndroidManifest.xml file. It
has package attribute that describes the package name of the activity
class.
• <application>
• application is the subelement of the manifest. It includes the
namespace declaration. This element contains several subelements
that declares the application component such as activity etc.
• The commonly used attributes are of this element
are icon, label, theme etc.
• android:icon represents the icon for all the android application
components.
• android:label works as the default label for all the application
components.
• android:theme represents a common theme for all the android
activities.
• <activity> activity is the subelement of application and represents an
activity that must be defined in Desai,SCET
Prof. Urmi the AndroidManifest.xml
CO. file. It has
Prof. Urmi Desai,SCET CO.
• Generated R.java file
• It is the auto-generated file
that contains IDs for all the
resources of res directory.
• It is generated by
aapt(Android Asset
Packaging Tool). Whenever
you create any component
on activity_main, a
corresponding ID is created
in the R.java file which can
be used in the Java Source
file later.
Prof. Urmi Desai,SCET CO.
Prof. Urmi Desai,SCET CO.
Apk file

Prof. Urmi Desai,SCET CO.

You might also like