Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

Mobile Application Development

By
FAHAD ASLAM
MSCS From AIOU
Chapter 1
 What Is Android?
 Android Versions
 Features of Android
 Architecture of Android
 Obtaining the Required Tools Android Studio
 Android Development Tools (ADT)
 Creating Android Virtual Devices (AVDs)
 Creating Your First Android Application
 Anatomy of an Android Application
What is Android
• Android is an OS based on Linux with a Java programming
interface. It is a comprehensive open source platform designed
for mobile devices.
• First beta version of Android Software Development Kit
(SDK) was released by Google in 2007 where as first
commercial version, Android 1.0, was released in September
2008.
• On June 27, 2012, at the Google I/O conference, Google
announced the next Android version, 4.1 Jelly Bean. Jelly
Bean is an incremental update, with the primary aim of
improving the user interface, both in terms of functionality and
performance.
Android Versions
Features of Android
Feature Description
Beautiful UI Android OS basic screen provides a beautiful and
intuitive user interface.

Connectivity GSM/EDGE, IDEN, CDMA, EV-DO, UMTS,


Bluetooth, Wi-Fi, LTE, NFC and WiMAX.

Storage SQLite, a lightweight relational database, is used


for data storage purposes.

Messaging SMS and MMS


Features…

Web browser Based on the open-source WebKit layout engine,


coupled with Chrome's V8 JavaScript engine supporting
HTML5 and CSS3.
Multi-tasking User can jump from one task to another and same time
various application can run simultaneously.
Wi-Fi Direct A technology that let apps discover and pair directly,
over a high bandwidth peer-to-peer connection.
Media support H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC, HE-
AAC, AAC 5.1, MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG,
GIF, and BMP
Architecture of Android
 The Android OS is roughly divided into five sections in four main
layers:
 Linux kernel This is the kernel on which Android is based. This
layer contains all the low level device drivers for the various
hardware components of an Android device.
 Libraries These contain all the code that provides the main features
of an Android OS. For example, the SQL Lite library provides
database support so that an application can use it for data storage.
The Web Kit library provides functionalities for web browsing.
 Android runtime At the same layer as the libraries, the 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 (Android applications are compiled
into the Dalvik executables). Dalvik is a specialized virtual machine
designed specifically for Android and optimized for battery-powered
mobile devices with limited memory and CPU
 Application framework — Exposes the various capabilities of the
Android OS to application developers so that they can make use of them in
their applications.
 Applications — At this top layer, you will find applications that ship with
the Android device (such as Phone, Contacts, Browser, etc.), as well as
applications that you download and install from the Android Market. Any
applications that you write are located at this layer.
Obtaining the Required Tools
 Java JDK The Android SDK makes use of the Java SE Development Kit
(JDK). Hence, if your computer does not have the JDK installed, you
should start by downloading the JDK from
www.oracle.com/technetwork/java/javase/downloads/index.html and
installing it prior to moving to the next section.
 Android Studio The first step towards developing any applications is
obtaining the integrated development environment (IDE). In the case of
Android, the recommended IDE is Android studio, a multi-language
software development environment featuring an extensible plug-in system.
It can be used to develop various types of applications, using languages
such as Java, Ada, C, C++, COBOL, Python, etc.
 Android SDK The next important piece of software you need to download
is, of course, the Android SDK. The Android SDK contains a debugger,
libraries, an emulator, documentation, sample code, and tutorials. You can
download the Android SDK from http://developer.android.com/sdk/
index.html. Once the SDK is downloaded, unzip its content (the android-
sdk-windows folder) into the C:\Android\ folder, or whatever name you
have given to the folder you just created.
Android Development Tools (ADT)
 Create new Android application projects.
 Access the tools for accessing your Android emulators and devices.
 Compile and debug Android applications.
 Export Android applications into Android Packages (APK).
 Create digital certificates for code-signing your APK.
Installation of Android Studio
 Step 0: Pre-Installation Check List. Before installing
Android SDK, you need to install Java Development Kit
(JDK). ...
 Step 1: Install "Android Studio IDE" Reference: "Install
Android Studio" @
https://developer.android.com/studio/install.
 Step 2: Installing Android SDK
Creating Android Virtual Devices
(AVDs)
 The next step is to create AVD to be used for testing your Android
applications. AVD stands for Android Virtual Devices. An AVD is an
emulator instance that enables you to model an actual device.
 Each AVD consists of a hardware profile, a mapping to a system image, as
well as emulated storage, such as a secure digital (SD) card.
 You can create as many AVDs as you want in order to test your
applications with several different configurations. This testing is important
to confirm the behavior of your application when it is run on different
devices with varying capabilities.
Create a New Android Project
 Install the latest version of Android Studio
 In the Welcome to Android Studio window, click Start a new Android
Studio project.
 In the Choose your project window, select Empty Activity and
click Next.
 In the Configure your project window, complete the following:
◦ Enter "My First App" in the Name field.
◦ Enter "com.example.myfirstapp" in the Package name field.
◦ If you'd like to place the project in a different folder, change
its Save location.
◦ Select either Java or Kotlin from the Language drop-down menu.
◦ Select the checkbox next to Use androidx.* artifacts.
◦ Leave the other options as they are.
 Click Finish.
Create a New Android Project…
 First, be sure the Project window is open (select View > Tool Windows >
Project) and the Android view is selected from the drop-down list at the
top of that window. You can then see the following files:

 app > java > com.example.myfirstapp > MainActivity


 This is the main activity. It's the entry point for your app. When you build
and run your app, the system launches an instance of this Activity and
loads its layout.
app > res > layout > activity_main.xml

 This XML file defines the layout for the activity's user interface (UI). It
contains a TextView element with the text "Hello, World!"
 app > manifests > AndroidManifest.xml

 The manifest file describes the fundamental characteristics of the app and
defines each of its components.

 Gradle Scripts > build.gradle


 There are two files with this name: one for the project, "Project: My First
App," and one for the app module, "Module: app." Each module has its
own build.gradle file, but this project currently has just one module. Use
each module's build.file to control how the Gradle plugin builds your app.
For more information about this file, see Configure your build.
Android Applications
• 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,
SlideME, Opera Mobile Store, Mobango, F-droid and the
Amazon Appstore.
Run Your Application
Set up your device as follows:
 Connect your device to your development machine with a USB cable. If

you developed on Windows, you might need to install the appropriate


USB driver or your device.
 Perform the following steps to enable USB debugging in the Developer

options window:
◦ Open the Settings app.
◦ If your device uses Android v8.0 or higher, select System. Otherwise,
proceed to the next step.
◦ Scroll to the bottom and select About phone.
◦ Scroll to the bottom and tap Build number seven times.
◦ Return to the previous screen, scroll to the bottom, and tap Developer
options.
◦ In the Developer options window, scroll down to find and enable USB
debugging.
Run the app on your device as follows:
 In Android Studio, select your app from the run/debug
configurations drop-down menu in the toolbar.

 In the toolbar, select the device that you want to run your app
on from the target device drop-down menu.
Run on an emulator
Run the app on an emulator as follows:
 In Android Studio, create an Android Virtual Device

(AVD) that the emulator can use to install and run your app.
 In the toolbar, select your app from the run/debug

configurations drop-down menu.


 From the target device drop-down menu, select the AVD that

you want to run your app on.


Thank You

You might also like