Mobile Application Development
MODULE I – INTRODUCTION TO ANDROID
I. Overview of the Android Platform
Google describes Android as “the first truly open and comprehensive platform for mobile
devices.” Android provides all the software required to run a mobile phone while avoiding the
proprietary barriers that previously limited innovation in mobile technology. This openness
allows developers and manufacturers to extend, modify, or replace components of the
platform. Android is designed as a software stack made up of several necessary and
dependent parts, each responsible for a specific function within the system.
Android Software Stack Components
[Link] Reference Design
Defines the capabilities required of a mobile device to support Android.
Ensures devices meet the minimum requirements to run Android efficiently.
[Link] Operating System Kernel
Provides the low-level interface between software and hardware.
Handles memory management, process control, and device drivers (camera, display,
audio, Bluetooth, Wi-Fi).
Optimized for mobile devices, ensuring stability, multitasking, and security.
[Link] Source Libraries
Libraries written in C/C++ to support application development.
Key libraries include:
o SQLite – Embedded database for app data storage
o WebKit – Browser engine
o OpenGL ES – Graphics rendering
o Media Framework – Audio and video playback
o SSL – Secure communication
4. Android Runtime
• Earlier Android versions used Dalvik Virtual Machine.
• Current Android versions use ART (Android Runtime).
• Executes Android applications with better performance and security.
• Each app runs in its own Linux process, ensuring isolation.
Mobile Application Development
[Link] Framework
Provides high-level APIs and system services for developers.
[Link] services include:
o Activity Manager – Manages application lifecycle
o Window Manager – Handles UI windows and screens
o Content Providers – Share data between apps
o Resource Manager – Manages app resources like strings, images, layouts
o Notification Manager – Push notifications
o Location Manager – Access device location
[Link] Interface Framework
Hosts and launches applications.
Manages user input, screen layouts, and application windows.
[Link] Applications
Android devices ship with built-in applications such as:
o Email client, SMS manager
o Personal Information Management (Contacts, Calendar)
o Google Maps, web browser
o Music player, picture viewer, instant messaging
o Android Marketplace and Amazon MP3 store
Exact apps vary depending on device manufacturer or mobile carrier.
Third-party apps can also be installed and interact with system services.
[Link] Development Kit (SDK)
Includes tools, plug-ins, APIs, and documentation for creating Android applications.
Applications developed for Android do not have to be open source, giving developers
flexibility to protect their code.
Mobile Application Development
II. Android SDK (Software Development Kit)
The Android SDK provides the tools, APIs, and documentation required to develop Android
applications. It allows developers to create apps that can integrate deeply with the phone, just
like built-in applications, while remaining platform-neutral and flexible.
Android SDK Features Explained
1. No licensing, distribution, or development fees
o You can develop and distribute Android apps for free. There’s no cost for
using the SDK.
2. Wi-Fi hardware access
o Apps can control and use Wi-Fi on the device to connect to networks or
transfer data.
3. Mobile data networks (2G/3G/4G/5G) for telephony or data transfer
Apps can make/receive calls, send/receive SMS, and transfer data over mobile
networks.
4. Comprehensive APIs for location-based services (GPS)
o Apps can use GPS to find the user’s location or provide location-based
services (like maps or navigation).
5. Full multimedia hardware control
o Apps can use the camera and microphone for recording or playback of
audio and video.
6. APIs for accelerometer and compass hardware
o Apps can detect device movement, tilt, and orientation, useful for games,
fitness apps, or navigation.
7. IPC (Inter-Process Communication) message passing
o Apps can send messages or data to other apps safely.
8. Shared data stores between applications
o Apps can store and share data with other apps, like contacts or notes, in a
controlled way.
9. Integrated open-source WebKit-based browser
o Apps can display web pages using the built-in browser engine.
Mobile Application Development
10. Support for applications that integrate Map controls
o Apps can show maps, directions, and location markers inside the app
interface.
11. Peer-to-peer (P2P) support
• Earlier Android versions supported P2P messaging using Google Talk. In modern
Android, P2P communication is implemented using Firebase Cloud Messaging
(FCM) and network-based messaging APIs.
12. Mobile-optimized hardware-accelerated graphics
o Apps can use fast graphics processing for smoother animations and visuals.
13. Path-based 2D graphics library
o Apps can draw shapes, lines, and curves for 2D graphics in games or
interfaces.
14. Support for 3D graphics using OpenGL ES
o Apps can use 3D graphics for gaming, simulations, or 3D visualizations.
15. Media libraries for playing and recording audio, video, or still images
o Apps can play music, videos, take photos, or record sounds easily using
built-in libraries.
16. Application framework encouraging reuse and replacement of native apps
o Developers can reuse existing app components and even replace default
system apps with their own version
Mobile Application Development
III Eclipse Installation
Earlier Android development used Eclipse IDE with ADT (Android Development Tools)
plugin.
Installation Steps (Traditional Approach)
1. Install Java Development Kit (JDK)
2. Install Eclipse IDE
3. Install ADT plugin
4. Configure Android SDK path
5. Create Android Virtual Device (AVD)
Eclipse + ADT is deprecated; Android Studio is now the official IDE.
IV. Android Installation Process
1. Install Java Development Kit (JDK)
Needed to develop Android apps in Java/Kotlin.
Set JAVA_HOME environment variable.
2. Download Android Studio
Official IDE for Android development.
Download from: [Link]
3. Install Android Studio
Run installer → Select default options:
o Android Studio IDE
o Android SDK
o Android Emulator
o SDK Tools
4. Configure Android SDK
SDK provides Android libraries and tools.
Use SDK Manager to install/update SDK versions and tools.
5. Create Android Virtual Device (AVD)
Emulator to test apps without a real phone.
Mobile Application Development
Open AVD Manager → Create Device → Select model & Android version →
Finish
6. Connect Real Device (Optional)
Enable Developer Options → USB Debugging
Connect via USB → Android Studio detects device → Run apps
7. Run Sample App
Open Android Studio → New Project → Select template → Run on
Emulator/Device
Check Logcat for logs/errors
8. Verify Installation
Android Studio opens successfully
Emulator/SDK installed correctly
Sample app runs without errors
V. Building Android Applications
Step 1: Launch Android Studio
Open Android Studio after installation.
On the Welcome screen, select New Project.
Step 2: Choose Template and Configure Project
Template: Select Empty Views Activity (allows selecting Java as the language).
Project Configuration:
o Name: Enter app name (e.g., MyFirstJavaApp)
o Package name: Unique identifier (e.g., [Link])
o Save location: Choose folder for project files
o Language: Select Java
o Minimum SDK: Choose the lowest Android version your app will support
Click Finish → Android Studio sets up the project (Gradle build may take a moment).
Step 3: Explore Project Files
Mobile Application Development
[Link] → Java logic for the app’s main screen
activity_main.xml → Defines the UI layout
UI Design:
o Use Design tab to drag-and-drop elements
o Or edit the XML code directly
Step 4: Add Functionality with Java
Define UI Elements: Declare variables for UI components (e.g., Button, TextView)
Link UI and Code: Use findViewById() in onCreate() to connect Java variables to
XML elements
Implement Logic: Add event handlers, e.g., setOnClickListener for buttons
Step 5: Test Your App
Set up device/emulator:
o Physical device: Enable USB Debugging and connect via USB
o Emulator: Create an Android Virtual Device (AVD) in Device Manager
Run App: Click the green Run button → select device or AVD → app launches
Check Logcat for debugging or errors
VI Understanding the Anatomy of an Android Application
An Android application is made up of different parts. Each part has a specific role. Android
Studio automatically creates and organizes these parts when a new project is created.
1. Android Application Components
Android applications are built using four main components. These components are managed
by the Android operating system.
1.1 Activity
An Activity represents one screen in an Android application.
It is the place where the user interacts with the app.
Every app has at least one activity.
Example:
o Login screen
Mobile Application Development
o Home screen
o Settings screen
Key points:
Written in Java (or Kotlin)
UI is connected using XML
Lifecycle is controlled by Android OS
Example:
public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
}
}
This code means:
App is starting
Show the screen design called activity_main
1.2 Service
A Service runs in the background.
It does not have a user interface.
Used when a task should continue even if the app is not visible.
Examples:
Playing music
Downloading files
Updating data in background
Types of Services:
Started Service
Bound Service
Foreground Service
1.3 Broadcast Receiver
A Broadcast Receiver listens for system messages.
It reacts when a specific event occurs.
Examples of events:
Mobile Application Development
Battery low
Incoming SMS
Network change
Important point:
It does not have a UI.
It runs for a very short time.
1.4 Content Provider
A Content Provider manages application data.
It allows data to be shared between different apps.
Data is accessed using URIs.
Examples:
Contacts
Media files
Call logs
2. Android Studio Project Structure
Android Studio organizes the application into folders and files.
2.1 java Folder
Contains all Java source code files.
Each Activity is written here.
Example:
[Link]
2.2 res Folder
Contains resources used by the app.
Important subfolders:
layout – Screen design files (XML)
drawable – Images and icons
mipmap – App launcher icons
values – Strings, colors, styles
2.3 Layout Files (XML)
Layout files define how the screen looks.
Mobile Application Development
They control:
o Buttons
o Text
o Images
Stored inside:
res/layout/activity_main.xml
2.4 [Link]
The main configuration file of the app.
It tells Android about the app before it runs.
3. Android Runtime
Android applications run inside a protected environment.
Each app has:
o Its own memory
o Its own process
This improves security and stability.
4. APK (Android Application Package)
APK is the final file created after building the app.
It contains:
o Code
o Resources
o Manifest file
Used to install the app on a device.
VII. Android Manifest File
The [Link] file is a compulsory file in every Android application. Without
this file, the app will not run.
1. Purpose of Android Manifest File
Registers all components (Activities, Services, etc.)
Specifies permissions required by the app
Defines app name and icon
Specifies supported Android versions
Mobile Application Development
2. Structure of [Link]
2.1 <manifest> Tag
Root tag of the file
Contains the package name
<manifest xmlns:android="[Link]
package="[Link]">
2.2 <application> Tag
Contains application-level settings
Defines:
App name
App icon
App theme
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">
2.3 <activity> Tag
Registers an activity with Android
Every activity must be declared here
<activity android:name=".MainActivity">
2.4 Launcher Activity
The activity that starts when the app opens
<intent-filter>
<action android:name="[Link]"/>
<category android:name="[Link]"/>
</intent-filter>
This means:
MAIN → starting screen
LAUNCHER → app icon opens this screen
Mobile Application Development
2.5 Other Component Tags
<service> – Background tasks
<receiver> – System messages
<provider> – Data sharing
3. Permissions
Permissions allow access to protected features.
<uses-permission android:name = "[Link]"/>
4. Importance of Manifest File
App cannot install without it
Controls security
Helps Android system manage app