MOBILE APPLICATION DEVELOPMENT
UNIT-I
About Android SDK
Android SDK is a collection of libraries and Software Development tools that are essential
for Developing Android Applications. Whenever Google releases a new version or update
of Android Software, a corresponding SDK also releases with it. In the updated or new
version of SDK, some more features are included which are not present in the previous
version. Android SDK consists of some tools which are very essential for the development
of Android Application. These tools provide a smooth low of the development process
from developing and debugging. Android SDK is compatible with all operating systems
such as Windows, Linux, macOS, etc.
Components of Android SDK
If you’re keen on mastering the Android SDK and learning to use its components
ef iciently, consider enrolling in the Android Development with Kotlin course by
GeeksforGeeks. This course will help you build a solid foundation in Kotlin and Android
app development, enabling you to create professional and ef icient applications. Android
SDK Components play a major role in the Development of Android applications. Below
are the important components:
1. Android SDK Tools
Android SDK tool is an important component of Android SDK. It consists of a complete set
of development and debugging tools. Below are the SDK developer tools:
Android SDK Build tool.
Android Emulator.
Android SDK Platform-tools.
Android SDK Tools.
These are shown below :
2. Android SDK Build-Tools
Android SDK build tools are used for building actual binaries of Android App. The main
functions of Android SDK Build tools are built, debug, run and test Android applications.
The latest version of the Android SDK Build tool is 30.0.3. While downloading or
updating Android in our System, one must ensure that its latest version is download in
SDK Components.
3. Android Emulator
An Android Emulator is a device that simulates an Android device on your system.
Suppose we want to run our android application that we code. One option is that we will
run this on our Android Mobile by Enabling USB Debugging on our mobile. Another
option is using Android Emulator. In Android Emulator the virtual android device is
shown on our system on which we run the Android application that we code.
Thus, it simply means that without needing any physical device Android SDK component
“Android Emulator” provides a virtual device on the System where we run our
Application. The emulator’s come with the con iguration for Various android phones,
tablets, Wear OS, and Android TV devices.
In Android Virtual Emulator all functions that are feasible on real Android mobile is
works on virtual Device like:
phone calls, text messages.
stimulate different network speeds.
specify the location of a device
access on google play store and lot’s more.
But there is one disadvantage of this emulator is that. It is very slow when System’s PC
has less RAM. It works ine when a maximum GB of RAM is present on our device.
4. Android SDK Platform-tools
Android SDK Platform-tools is helpful when we are working on Project and they will show
the error messages at the same time. It is speci ically used for testing. It includes:
Android Debug Bridge (ADB), is a command-line tool that helps to communicate
with the device. It allows us to perform an action such as Installing App and
Debugging App etc.
Fastboot allows you to lash a device with a new system image.
Systrace tools help to collect and inspect timing information. It is very crucial for
App Debugging.
5. Android SDK Tools
Android SDK tool is a component of SDK tool. It consists of a set of tools which and other
Utilities which are crucial for the development of Android Application. It contains the
complete set of Debugging and Development tools for android.
6. SDK Platforms
For Each Android Software, one SDK platform is available as shown below:
Like in this Android 11.0(R) is installed.
These are numbered according to the android version. The new version of the SDK
platform has more features and more compatible but the old version is less compatible
with fewer features. Like in Android 11.0(R) have more compatible and have more feature
but the below versions like Android 10.0(Q), Android4.4(KitKat) have less feature and is
less compatible.
7. SDK Update Sites
In SDK Update Sites, some sites are embedded in it which will check for Android SDK
Updates Tools. In this, one must ensure we don’t unclick the button below because these
are checked by default which will check for updates if we will unclick it then it doesn’t
check updates for those.
ECLIPSE INSTALLATION
Eclipse is a completely free open-source platform, Integrated Development Environment
(IDE) with the help of which several types of applications are made using the Java
programming languages and other programming languages are also used such
as C/C++, PERL, Python, Ruby, etc.
Eclipse is a preferred choice for developers for several reasons. It provides a user-friendly
interface that makes it easy for both beginners and experienced coders. It supports
multiple programming languages. It also offers collaborative tools that allow multiple
developers to contribute to a project simultaneously.
Eclipse Software incorporates of many plug-ins and is designed to be extensible the use
of extra plug-ins. Eclipse IDE can be used for any programming language for which a plug-
in is available.
Famous Plugins Used in Eclipse IDE
Following are some famous plug-ins used in Eclipse IDE :
The Java Development Tools (JDT) is a plugin that allows Eclipse to be used as a
Java IDE.
PyDev is a plugin that allows Eclipse to be used as a Python IDE.
C/C++ Development Tools (CDT) is a plug-in that lets in Eclipse for use as C/C++
development.
The Scala is a plug-in is a plug-in that permits Eclipse for used as an IDE to broaden
Scala applications.
PHPeclipse is a plug-in that permits Eclipse for used as an IDE to increase PHP
applications.
Steps to Download and install Eclipse on Windows :
Now let’s look at the step by step process to Download and install Eclipse on Windows:
Step 1: In the irst step, Open your browser and navigate to this URL.
Step 2: Then, click on the “Download” button to download Eclipse IDE.
Step 3: Now, click on the “Download x86_64” button.
Step 4: Then click on the “Download” button. After clicking on the download button the
.exe ile for the eclipse will be downloaded.
Step 5: Now go to File Explorer and click on “Downloads” after that click on the “eclipse-
[Link]” ile for installing Eclipse IDE.
Step 6: Then, click on “Eclipse IDE for Java Developers”.
Step 7: Then, click on the “Install” button.
Step 8: Now click on “Create a new Java project”.
Now, you’re prepared to make new Java initiatives the usage of eclipse IDE and the display
screen will appear like this :
Congratulations! you have successfully Eclipse software download for your Windows PC.
ANDRIOD INSTALLATION
Step 1: Head over to this link to get the Android Studio executable or zip ile.
Step 2: Click on the Download Android Studio Button.
Click on the “I have read and agree with the above terms and conditions” checkbox
followed by the download button.
Click on the Save ile button in the appeared prompt box and the ile will start
downloading.
Step 3: After the downloading has inished, open the ile from downloads and run it. It
will prompt the following dialog box.
Click on next. In the next prompt, it’ll ask for a path for installation. Choose a path and hit
next.
Step 4: It will start the installation, and once it is completed, it will be like the image
shown below.
Click on next.
Step 5: Once ” Finish ” is clicked, it will ask whether the previous settings need to be
imported [if the android studio had been installed earlier], or not. It is better to choose
the ‘Don’t import Settings option’.
Click the OK button.
Step 6: This will start the Android Studio.
Meanwhile, it will be inding the available SDK components.
Step 7: After it has found the SDK components, it will redirect to the Welcome dialog box.
Click on Next .
Choose Standard and click on Next. Now choose the theme, whether the Light theme or
the Dark one. The light one is called the IntelliJ theme whereas the dark theme is
called Dracula . Choose as required.
Click on the Next button.
Step 8: Now it is time to download the SDK components.
Click on Finish. Components begin to download let it complete.
The Android Studio has been successfully con igured. Now it’s time to launch and build
apps. Click on the Finish button to launch it.
Step 9: Click on Start a new Android Studio project to build a new app.
ANATOMY OF ANDROID APPLICATION
There are some necessary building blocks that an Android application consists of. These
loosely coupled components are bound by the application manifest ile which contains
the description of each component and how they interact. The manifest ile also contains
the app’s metadata, its hardware con iguration, and platform requirements, external
libraries, and required permissions. There are the following main components of an
android app:
1. Activities
Activities are said to be the presentation layer of our applications. The UI of our
application is built around one or more extensions of the Activity class. By using
Fragments and Views, activities set the layout and display the output and also respond to
the user’s actions. An activity is implemented as a subclass of class Activity.
JavaKotlin
1
public class MainActivity extends Activity {
2
}
To read more, refer to the article: Introduction to Activities in Android
Also, to fully understand how to structure an app with Kotlin, from basic components to
advanced architecture, the Android Mastery with Kotlin: Beginner to
Advanced course offers a comprehensive guide to Android app development.
2. Services
Services are like invisible workers of our app. These components run at the backend,
updating your data sources and Activities, triggering Noti ication, and also broadcast
Intents. They also perform some tasks when applications are not active. A service can be
used as a subclass of class Service:
JavaKotlin
1
public class ServiceName extends Service {
2
}
To read more, refer to the article: Services in Android with Example
3. Content Providers
It is used to manage and persist the application data also typically interacts with the SQL
database. They are also responsible for sharing the data beyond the application
boundaries. The Content Providers of a particular application can be con igured to allow
access from other applications, and the Content Providers exposed by other applications
can also be con igured.
A content provider should be a sub-class of the class ContentProvider.
JavaKotlin
1
public class contentProviderName extends ContentProvider {
2
public void onCreate(){}
3
}
To read more, refer to the article: Content Providers in Android with Example
4. Broadcast Receivers
They are known to be intent listeners as they enable your application to listen to the
Intents that satisfy the matching criteria speci ied by us. Broadcast Receivers make our
application react to any received Intent thereby making them perfect for creating event-
driven applications.
To read more, refer to the article: Broadcast Receiver in Android With Example
5. Intents
It is a powerful inter-application message-passing framework. They are extensively used
throughout Android. Intents can be used to start and stop Activities and Services, to
broadcast messages system-wide or to an explicit Activity, Service or Broadcast Receiver
or to request action be performed on a particular piece of data.
To read more, refer to the article: Intent and Intent Filters
6. Widgets
These are the small visual application components that you can ind on the home screen
of the devices. They are a special variation of Broadcast Receivers that allow us to create
dynamic, interactive application components for users to embed on their Home Screen.
7. Noti ications
Noti ications are the application alerts that are used to draw the user’s attention to some
particular app event without stealing focus or interrupting the current activity of the user.
They are generally used to grab user’s attention when the application is not visible or
active, particularly from within a Service or Broadcast Receiver. Examples: E-mail popups,
Messenger popups, etc.
Android Manifest File in Android
Every project in Android includes a Manifest XML ile, which is [Link],
located in the root directory of its project hierarchy. The manifest ile is an important part
of our app because it de ines the structure and metadata of our application, its
components, and its requirements. This ile includes nodes for each of
the Activities, Services, Content Providers, and Broadcast Receivers that make the
application, and using Intent Filters and Permissions determines how they coordinate
with each other and other applications.
The manifest ile also speci ies the application metadata, which includes its icon, version
number, themes, etc., and additional top-level nodes can specify any required
permissions, and unit tests, and de ine hardware, screen, or platform requirements. The
manifest comprises a root manifest tag with a package attribute set to the project’s
package. It should also include an xmls:android attribute that will supply several system
attributes used within the ile. We use the versionCode attribute is used to de ine the
current application version in the form of an integer that increments itself with the
iteration of the version due to update. Also, the versionName attribute is used to specify
a public version that will be displayed to the users. To master managing your Android
app’s con iguration, including how to handle permissions and app components with
Kotlin, the Android Mastery with Kotlin: Beginner to Advanced course provides a
detailed breakdown of Android’s architecture, including effective usage of the manifest
ile.
We can also specify whether our app should install on an SD card of the internal memory
using the installLocation attribute. A typical manifest ile looks as:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[Link]
xmlns:tools="[Link]
package="[Link]"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="preferExternal">
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="27" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent- ilter>
<action android:name="[Link]" />
<category android:name="[Link]" />
</intent- ilter>
</activity>
</application>
</manifest>
1. manifest
The main component of the [Link] ile is known as manifest. Additionally,
the packaging ield describes the activity class’s package name. It must contain an
<application> element with the xmlns:android and package attribute speci ied.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[Link]
xmlns:tools="[Link]
package="[Link]">
<!-- manifest nodes -->
<application>
</application> </manifest>
2. uses-sdk
It is used to de ine a minimum and maximum SDK version by means of an API Level
integer that must be available on a device so that our application functions properly, and
the target SDK for which it has been designed using a combination of minSdkVersion,
maxSdkVersion, and targetSdkVersion attributes, respectively. It is contained within the
<manifest> element.
XML
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="27" />
3. uses-permission
It outlines a system permission that must be granted by the user for the app to function
properly and is contained within the <manifest> element. When an application is installed
(on Android 5.1 and lower devices or Android 6.0 and higher), the user must grant the
application permissions.
XML
<uses-permission
android:name="[Link]"
android:maxSdkVersion="18" />
4. application
A manifest can contain only one application node. It uses attributes to specify the
metadata for your application (including its title, icon, and theme). During development,
we should include a debuggable attribute set to true to enable debugging, then be sure to
disable it for your release builds. The application node also acts as a container for the
Activity, Service, Content Provider, and Broadcast Receiver nodes that specify the
application components. The name of our custom application class can be speci ied using
the android:name attribute.
XML
<application
android:name=".GeeksForGeeks"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@drawable/gfgIcon"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@android:style/[Link]"
android:debuggable="true"
tools:targetApi="31">
<!-- application nodes -->
</application>
5. uses-library
It de ines a shared library against which the application must be linked. This element
instructs the system to add the library’s code to the package’s class loader. It is contained
within the <application> element.
XML
<uses-library
android:name="[Link]"
android:required="true" />
6. activity
The Activity sub-element of an application refers to an activity that needs to be speci ied
in the [Link] ile. It has various characteristics, like label, name, theme,
launchMode, and others. In the manifest ile, all elements must be represented
by <activity>. Any activity that is not declared there won’t run and won’t be visible to the
system. It is contained within the <application> element.
<activity
android:name=".MainActivity"
android:exported="true">
</activity>
7. intent- ilter
It is the sub-element of activity that speci ies the type of intent to which the activity,
service, or broadcast receiver can send a response. It allows the component to receive
intents of a certain type while iltering out those that are not useful for the component.
The intent ilter must contain at least one <action> element.
XML
<intent- ilter>
<action android:name="[Link]" />
<category android:name="[Link]" />
</intent- ilter>
UNIT- II
GENERAL ANDROID TERMINOLOGY:
1. Android – An operating system based on the Linux kernel, designed primarily for
touchscreen mobile devices like smartphones and tablets.
2. Android OS – The software stack for mobile devices, consisting of the operating
system, middleware, and key applications.
3. Android Device – A mobile or wearable device running the Android operating system.
4. AOSP (Android Open Source Project) – The open-source version of the Android
operating system maintained by Google, available for anyone to modify and use.
5. API (Application Programming Interface) – A set of protocols, tools, and de initions
that allow developers to interact with the Android operating system and build apps.
Development Terms:
1. SDK (Software Development Kit) – A collection of tools provided by Google to help
developers build Android apps, including libraries, emulator, and more.
2. IDE (Integrated Development Environment) – Software used for development,
such as Android Studio, which includes tools for writing, testing, and debugging
Android applications.
3. APK (Android Package) – The ile format used to distribute and install Android
apps, similar to an .exe for Windows.
4. Java/Kotlin – The primary programming languages used for Android app
development (Kotlin is now preferred over Java for modern Android apps).
5. Activity – A single screen with a user interface in an Android app. Each activity
serves as a window for user interaction.
6. Intent – A messaging object used to request actions from other components (e.g.,
to start a new activity or service).
7. Fragment – A reusable portion of an activity's UI, which can be combined to form
a complete UI for an activity.
8. View – A UI element like a button, text box, or image.
9. RecyclerView – A lexible, performance-optimized view used for displaying lists or
grids of items.
10. Manifest File – An XML ile ([Link]) that contains important
metadata about the Android app, including permissions, components, and
features.
Android Components:
1. Service – A component that runs in the background to perform long-running
operations like downloading iles, playing music, or checking for updates.
2. Broadcast Receiver – A component that listens for system-wide broadcast
messages (e.g., when the device is charging or the network is available).
3. Content Provider – A component that manages access to a shared set of app data,
allowing other apps to read and write to it.
Android Architecture Components:
1. LiveData – A lifecycle-aware data holder class used to handle data in a way that
respects the lifecycle of an Android component like Activity or Fragment.
2. ViewModel – A component designed to manage UI-related data and lifecycle
management, helping to separate data from UI logic.
3. Room – A database library that provides an abstraction layer over SQLite, making
it easier to interact with databases in Android apps.
4. Navigation Component – A library that helps to navigate between different screens
(activities/fragments) in a structured way.
5. WorkManager – A library for managing background tasks and jobs, ensuring they
execute even when the app is not active or the device is restarted.
UI/UX Related:
1. Material Design – A design system created by Google that provides guidelines for
building visually appealing and easy-to-use Android apps.
2. UI (User Interface) – The part of the app with which the user interacts (buttons,
menus, text ields, etc.).
3. UX (User Experience) – The overall experience a user has when interacting with
an app, focusing on ease of use and satisfaction.
4. ConstraintLayout – A lexible layout manager for arranging UI elements in a
responsive, ef icient manner.
5. Toolbar – A customizable action bar that can contain navigation buttons, search
ields, or other controls.
Performance and Memory Management:
1. Garbage Collection – The process by which unused objects are automatically
cleared from memory to free up resources.
2. Heap – The memory pool used for dynamic memory allocation in Android, which
is managed by the garbage collector.
3. ANR (Application Not Responding) – A situation where an Android app becomes
unresponsive due to heavy operations on the main thread.
4. JNI (Java Native Interface) – A framework that allows Android to run code written
in native languages like C or C++ for performance-critical tasks.
5. ProGuard – A tool that optimizes and obfuscates Android code to reduce size and
protect against reverse engineering.
Android Security:
1. Permission – A request to access certain sensitive resources, such as the camera
or microphone, requiring user approval.
2. Keystore – A secure container for storing cryptographic keys and performing
encryption operations.
3. Sandboxing – The isolation of apps in their own space so they can't access other
apps' data or resources without permission.
Android Updates & Versions:
1. OTA (Over-the-Air) – A method of delivering software updates to devices
wirelessly.
2. Nougat, Oreo, Pie, etc. – Codenames for different versions of the Android operating
system. These names follow a sweet/dessert-themed convention, though later
versions have switched to a numeric system (e.g., Android 10, Android 11).