Notes Unit2.pptx
- 2. 2
Course Outcomes
ESC155: Mobile Application Development
ESC255: Lab-III: Mobile Application Development
CO1: Explain Android Ecosystem and features of android operating system (II Understand)
CO2: Configure Android environment and development tools. (III Apply)
CO3: Use different layouts and control flow for designing User interface. (III Apply)
CO4: Design user interface using different UI Components of Android. (III Apply)
CO5: Demonstrate different lifecycles in Android. (III Apply)
CO6: Illustrate process of publishing an android app on google play store. (III Apply)
- 3. • UNIT-II: Java SDK, Android Development Tools, Android Virtual
Devices, Emulators, Dalvik Virtual Machines, Steps to install Android
Studio and SDK
Textbooks/ Reference Books :
1. Composing Mobile Apps , by Anubhav Pradhan, Anil V Deshpande, Wiley
Publication.
2. Android App Development for Dummies , Michael Burton , Wiley
Publication.
3. Android Programming for Beginners , John Horton , Packt Publishing.
3
- 4. Configuration of Android Environment
1. Operating System
2. Java JDK
3. Android SDK
4. Android Development Tools (ADT)
5. Android Virtual Devices (AVD)
6. Emulators
7. Dalvik Virtual Machine
8. Difference between Java virtual machine and
Dalvik virtual machine
9. Steps to install and configure Eclipse and SDK
4
- 5. 1. Operating System
– Windows xp/vista/7/10
– Mac OS X
– Linux
2. Java JDK
– As android programs are developed in the Java programming
language, JDK (Java Development Kit) has to be installed,
which includes Java SE and Java Runtime (JRE)
3. Android SDK
-The Android SDK (Software Development Kit) is a set of development
tools that are used to develop applications for the Android platform
-The Android SDK consists of an emulator, development tools, sample
projects with source code, and the required libraries to
build Android applications
5
- 6. Android SDK can be downloaded from http://developer .android.com/sdk/index.html
using Android SDK manager
*Android SDK is made up of two main parts : the tools and the packages
6
- 7. 4. Android Development Tools(ADT)
• - ADT is a plugin for the Eclipse IDE which provides a suitable environment to
develop an Android application where creation, compilation and debugging are
possible . ADT can set up new Android projects, create an application UI, insert
packages based on the Android Framework API, debug your application using the
Android SDK tools and export .apk files in order to distribute the application
• Also ADT provides custom XML editors and debug output
pane
• Android Developer Tools Bundle (ADT Bundle) provides,
– Eclipse + ADT plugin
– Android SDK tools
– Android platform tools
– The most recent Android platform
– The newest android system image for the emulator
7
- 9. 5. Android Virtual Devices (AVD)
- An Android virtual device AVD is an emulator configuration that enables to
model an actual device by calling hardware and software options to be emulated
by the Android Emulator
- the AVD manager can be used to create an AVD. launch it from eclipse
by clicking Window| AVD manager
- an Android virtual device AVD is used for testing the Android applications.
An AVD is an emulator occurrence that enables to form a real device Each AVD
consists of a hardware sketch, a connection to a system image , and emulated
storage , such as a secure digital SD card
9
- 10. 10
An AVD consists of
A hardware profile: defines the hardware features of the virtual device. for
example, you can describe whether the device has a camera, whether it uses
a physical QWERTY keyboard or a dialling pad , how much memory has and
so on.
A mapping to a system image: what version of the Android platform will run
on the virtual machine can be defined. The version of the standard Android
platform or the system image packaged with the SDK add on can be chosen
the emulator skin to be used with the AVD can be specified , which lets you
control the screen dimensions, look and so on .The emulated SD card to use
with the AVD, also can be specified
A dedicated storage area on your development machine: the devices user
area (installed applications settings and so on ) and emulated SD card are
stored in this area
•
- 12. • Difference between JVM(Java Virtual Machine) and
DVM(Dalvik Virtual Machine)
DVM (Dalvik Virtual Machine) JVM(Java Virtual Machine)
1 It is Register based which is designed to
run on low memory.
It is Stack based.
2 DVM uses its own byte code and runs the
“.Dex” file. From Android 2.2 SDK Dalvik has
got a Just in Time compiler
JVM uses java byte code and runs “.class” file
having JIT (Just In Time).
3 DVM has been designed so that a device
can run multiple instances of the VM
efficiently. Applications are given their own
instance.
A single instance of JVM is shared with
multiple applications.
4 DVM supports the Android operating
system only.
JVM supports multiple operating systems.
5For DVM very few Re-tools are available For JVM many Re-tools are available.
6There is a constant pool for every
application
It has a constant pool for every class.
12
- 15. 15
LOGICAL COMPONENTS OF AN ANDROID APP
1. Activity: It is the basis of the UI of any Android app. The overall UI may consist
of other visual elements, layout elements, resources, and many more things,
besides the Activity that forms the foundation of UI
2. Service: Service is another key logical component of an Android app. It runs in
the background, and does not have an UI. To interact with a Service, typically
an UI (Activity) is associated with it.
3. Broadcast Receiver: While the mobile device is being used, there may be
several announcements (broadcasts) which an app needs to capture and
respond to. Announcements such as an incoming call, an incoming SMS,
availability of Wi-Fi spot, or low battery are initiated by the system.
4. Content Provider: Persisting data pertaining to an app and making it accessible
across apps is a crucial aspect of mobile app development. However, as a
security feature, the Android platform prevents one app to access data of
another app. To overcome this constraint, where an app needs to share the
data with other apps, the data has to be exposed, which is done using Content
Provider.
- 16. 16
Because mobile apps run in resource-constrained
environments, there is a dire need to ensure that they are
optimally designed, responsive, and performant.
The Android SDK comes bundled with a rich set of tools that
not only help developers to cater to these pressing demands
but also provide utilities that help them during the
development of apps.
These tools are broadly classified as SDK tools and platform
tools.
SDK tools are Android platform version agnostic, and are
present in the tools subfolder of the SDK.
Platform tools are specific to Android platform version, and
are present in platform-tools subfolder of the SDK.
ANDROID TOOL REPOSITORY
- 19. 19
1. FirstApp is the name of the project.
2. src is the source folder where all .java files are placed. Android
mandates the creation of packages to manage the .java files. A
package name must have at least two identifiers, for example,
com.mad.
3. MainActivity is the default launcher activity of the app and its
contents are represented in Snippet 2.1. It inherits from the
Activity class and contains the onCreate() method. Within this
method, the setContentView() method is called to inflate the
layout of the screen (Line 9).