0% found this document useful (0 votes)
9 views231 pages

Mobile

The document outlines the process of software development for mobile devices, detailing key aspects such as requirement analysis, design, implementation, testing, deployment, and maintenance. It highlights the characteristics of mobile devices and introduces Android as a widely used open-source operating system for mobile applications. Additionally, it covers essential tools, concepts, and the activity lifecycle in Android development, emphasizing the importance of user experience and continuous learning for developers.

Uploaded by

donzdon71
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)
9 views231 pages

Mobile

The document outlines the process of software development for mobile devices, detailing key aspects such as requirement analysis, design, implementation, testing, deployment, and maintenance. It highlights the characteristics of mobile devices and introduces Android as a widely used open-source operating system for mobile applications. Additionally, it covers essential tools, concepts, and the activity lifecycle in Android development, emphasizing the importance of user experience and continuous learning for developers.

Uploaded by

donzdon71
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

23CA106

SOFTWARE DEVELOPMENT FOR MOBILE


DEVICES
Software
Software refers to a collection of data, instructions, or
programs that tell a computer or other electronic
devices how to perform specific tasks.
Software Development
Software Development is the process of writing and
maintaining the source code of software.
Key Aspects of Software Development
Requirement Analysis: Gathering and analyzing the needs and requirements of
the end-users or clients to define what the software should do.

Design: Planning the architecture and user interface of the software.

Implementation (Coding): Programmers use programming languages like Java,


Python, C++, or JavaScript.

Testing: Verifying that the software works as intended by identifying and fixing
bugs or errors.

Deployment: Releasing the software to users, either through installation on


individual devices or distribution through online platforms.

Maintenance: Ongoing support and updates to fix issues, improve performance,


add new features, and ensure compatibility with new systems or technologies.
Mobile Devices
Mobile Devices are portable, handheld electronic devices that allow
users to perform a variety of tasks such as communication, browsing the
internet, running applications, and more.

Key Characteristics of Mobile Devices:


Convenient: Making them convenient for users to access information and
services anytime and anywhere.
Wireless Connectivity: Most mobile devices have built-in wireless
capabilities, such as Wi-Fi, Bluetooth, and cellular networks (3G, 4G, 5G)
Touchscreen Interface: To allowing users to interact
Operating Systems: Mobile devices run on specialized operating systems
such as Android, iOS, or Windows
Sensors (GPS - Global Positioning System) and Hardware (Cameras, Speakers
etc.): To enhance their functionality and user experience.
Multifunctionality: Mobile devices combine the features of multiple
devices into one, serving as phones, cameras, media players, and more.
Examples of Mobile Devices
Smartphones - iPhone or Samsung Galaxy

Tablets: Larger touchscreen devices like the iPad

Smartwatches: Wearable devices like the Apple Watch

E-Readers: Devices like the Amazon Kindle, designed specifically for


reading digital books and magazines.
Definition
"Software Development for Mobile Devices" refers to the
process of designing, creating, testing, and maintaining
software applications specifically for mobile devices like
smartphones, tablets, and wearable devices.
Overview of Android and Android
Application Development
What is Android?
Android is an open-source operating system primarily
used for mobile devices such as smartphones and tablets.

Developed by Google

it is based on the Linux kernel and is the most widely


used OS in the world.

Kernal -Part of the operating system that manages


system resources, facilitates communication between
hardware and software, and controls system processes.
History and Evolution
Android was first introduced in 2008. Since then, it has
undergone numerous updates.
Android Versions
Cupcake
Donut
Oreo
Android Updates
It improvements in performance
user interface
security.
Why Learn Android App Development?
[Link] Demand for Android Developers
To create innovative and user-friendly apps.
[Link] Source and Free
Android is open-source, which means that the source code
is freely available. This allows students to experiment, learn,
and develop their own apps without any licensing costs.
[Link]
Android supports a wide range of devices, from smartphones
to wearables and even smart TVs.
[Link]
This versatility provides students with the opportunity to
develop apps for various platforms.
Concepts
1. Android Studio
Android Studio is the official Integrated Development
Environment (IDE) for Android app development.
It provides the tools necessary for coding, debugging, and
testing Android apps.

2. Java and Kotlin


Android apps are primarily developed using Java or Kotlin.
.
Concepts
[Link] Interface (UI) Design
UI design in Android involves creating layouts using
XML files and connecting them with backend code.
Android Studio provides a drag-and-drop feature to
make UI design more accessible.
4. Android SDK
The Android Software Development Kit (SDK) includes a
set of development tools, libraries, and documentation
that assist in building Android apps.
It provides APIs to interact with the hardware and
software features of Android devices.
Steps to Develop an Android App
1. Setting Up the Environment - Install Android Studio
and configure the necessary SDKs and libraries.

2. Creating a New Project - Start a new project in Android


Studio and choose a project template (e.g., Empty
Activity).

3. Designing the User Interface : Design the app’s UI


using XML or the drag-and-drop interface in Android
Studio.
Steps to Develop an Android App
4. Writing the Code - Implement the app’s functionality
using Java or Kotlin. This includes handling user inputs,
connecting to databases, and integrating APIs.

[Link] the App - Test the app using Android Studio’s


emulator or on a physical device to identify and fix any
bugs.

[Link] and Publishing - Build the final APK (Android


Package) and publish it to the Google Play Store or
distribute it directly to users.
.
Future of Android Development
Growth of Mobile Usage
- leading to more opportunities for developers.

Integration with Emerging Technologies


Android development is expanding to include integration with emerging
technologies like IoT (Internet of Things), AI (Artificial Intelligence), and
VR (Virtual Reality).

Cross-Platform Development
With tools like Flutter, developers can create apps that run on both
Android and iOS, which may become more common in the future.

Focus on User Experience (UX)


Future Android development will likely focus on enhancing user
experience through better UI design, faster performance, and more
personalized apps.
Student Perspective
Easy to Start -
Android development is accessible to students, with plenty of
online resources, tutorials, and communities to help beginners.
Career Opportunities
Learning Android development can open up numerous career
opportunities in software development, mobile app design, and
more.
Practical Application
Students can create real-world projects, like simple apps or games
Continuous Learning
Offering students the chance to keep learning and stay updated
with the latest trends and technologies.
Activity Life Cycle in Android
The activity life cycle is a set of states

An activity is user navigates through the app or interacts with the


system.

These states are managed by several callback methods provided by


the Activity class.
Activity Class
|
Callback Methods
Use
•Manage the system resources
•Developers can manage how an activity moves
Activity Life Cycle in Android
Methods
onCreate() → Called when the activity is created.

onStart() → Called when the activity is visible to the user.

onResume() → Called when the activity starts interacting with the user.

onPause() → Called when the activity is partially stop.

onStop() → Called when the activity is no longer visible.

onRestart() → Called when the activity is restarted after stopping.

onDestroy() → Called when the activity is destroyed.


Activity Life Cycle in Android
Method
onCreate() → Called when the activity is created.

Operations
•Setting the layout
•initializing variables
•binding data to UI components
•Initializing objects and components.
•Restoring saved state.
Activity Life Cycle in Android
onCreate() - Format
@Override
protected void onCreate(Bundle savedInstanceState)
{
[Link](savedInstanceState); // setup for the activity,
such as creating the window in which the UI
will be displayed and restoring the
state setContentView([Link].activity_main);
}
Activity Life Cycle in Android
@Override - overriding a method from its superclass (Activity).
Protected – Access Modifier
Void – Nothing
onCreate – when the activity is first created.
Bundle savedInstanceState - Saved state of the activity
Activity Life Cycle in Android
[Link](savedInstanceState); -
setup for the activity, such as creating the
window in which the UI
will be displayed and restoring the state

setContentView([Link].activity_main); - XML file


activity_main.xml

The [Link].activity_main refers to the layout file located in the


res/layout directory of the Android project
Activity Life Cycle in Android
onStart()
→ Called when the activity is visible to the user.

Common Usage:

Preparing the app to become visible.

Setting up components for visible or used.


Activity Life Cycle in Android
@Override
protected void onStart()
{ [Link](); // The activity is now visible

@Override - indicates that the method is overriding a method


from its parent class.
onStart( ) - It is a lifecycle method in Android that is called when an
activity is becoming visible to the user
Activity Life Cycle in Android
super refers to the parent.

[Link]() is the method being called from that parent class.

[Link]() is a call to ensure that the parent class's version of


onStart() executes before any additional code you provide in your
overridden method.
Activity Life Cycle in Android
onResume()

→ Called when the activity starts interacting with the user.

Common Usage:

Start animations

UI updates.
Activity Life Cycle in Android
@Override
protected void onResume()
{ [Link](); // The activity is now in the foreground
and can interact with the user

}
Activity Life Cycle in Android
onPause() → Called when the activity is partially stopped.

Common Usage:

Save the current state.

Release resources that are not needed


Activity Life Cycle in Android
@Override
protected void onPause()
{ [Link](); // Pause tasks or animations when activity
is partially obscured
}
Activity Life Cycle in Android
onStop() → Called when the activity is no longer visible.

Common Usage:

Stop animations

Stop updates

Release resources
Activity Life Cycle in Android
@Override
protected void onStop()
{ [Link](); // Stop resources when the activity is not
visible
}
Activity Life Cycle in Android
onRestart()

→ Called when the activity is restarted after stopping.

Common Usage:
Restore the state
Activity Life Cycle in Android
@Override
protected void onRestart()
{
[Link](); // The activity is being restarted

}
Activity Life Cycle in Android
onDestroy()
→ Called when the activity is destroyed.

Common Usage:

Clean up resources

Activity is completely removed from memory.


Activity Life Cycle in Android
@Override
protected void onDestroy()
{ [Link](); // Cleanup resources before activity is
destroyed
}
Activity Life Cycle in Android
LINT TOOL
Lint is a static code analysis tool used in Android development.

To checks for coding errors and performance issues,


Purpose of LINT Tool
To identifying errors

To check the coding standards

Find the unused resources

Find the redundant elements.

To check the different Android versions.


Key Features of Lint in Android

Find the security issues

To detect the unused resources and find the errors

Easy to customize the code.

IDE
Running Lint in Android Studio
Build Menu + Analyze APK - To find out the warnings and errors

Command line

./gradlew lint
Advantages of LINT
Find out the issues

Ensuring Code Quality

Easy to customize

Automate the code quality check


Tools that Collaborative Android SDK
Android Studio – IDE and Easy to Customize the code

GitHub – Built-in Android Codes and Platform Independent

GitLab – Similar to GitHub . It provides find out the issues and


hosting.

Bitbucket – It is used for project management


Tools that Collaborative Android SDK
Firebase - It is real time database and cloud storage.

Slack – To integrate the GitHub and GitLab

Gradle – Compiling , Packaging and Testing the Android Apps

ADB (Android Debug Bridge) – It is Command line tool.


To communicate with the devices
Tools that Collaborative Android SDK
Emulator (Or) AVD (Android Virtual Device – To test the
applications on different virtual devices.

ProGuard – To reduce the size of the Android applications and


improve the performance.

DVM (Dalvik Virtual Machine) – To run the Android application


and optimize the memory space.

AVM (Android Virtual Machine) – To running and executing


Android Code.
MONKEY TOOL
It is the part of Android SDK.

To test the Android application.

It works on UI Components and Trigger system events

Example
ANR Errors (Application Not Responding)

UI Components Bugs
MONKEY TOOL
Testing

Stress Testing – To overload the phases

Performance Testing – To test the android software performance

Error Detection – Find out the unexcepted crashes

Automated Testing - To automatically test the code.


MONKEY TOOL
Advantages

Easy to use

Using More tesing

Easy to find out the issues.


MONKEY TOOL
Running the Monkey Tool

Adb shell monkey –p <package_name> - v <number of events>

Adb shell monkey – Starts the Monkey Tool

-p – Package Name. To specify the package Name.

-v - event generated. Ex. 500


Android Manifest File
Android manifest file is an XML file

Android OS--------------------------- Application


Bridge

It acts as a bridge between the Android operating system and the


application, specifying crucial aspects of the app.
Android Manifest File
The main purpose of the Android Manifest file is to:

1. To define the application's components

[Link] permission to access device resources (e.g., internet,


camera, GPS).

3. To Specify the minimum Android API level required to run the


app.

4. To Define the hardware and software

[Link] the app themes, icon, and versioning.


Android Manifest File Name
[Link]
Key Components
<manifest> Tag - The root element of the manifest file. It
Contains the package name.

<uses-permission> Tag - Used to declare the permissions the app

<application> Tag
It contains attributes like icon, label, allowBackup, theme, etc.
Key Components
<activity> Tag - Declares an activity in the app. To interact with
user interface.

<service> Tag
A service performs background tasks

<uses-sdk> Tag – To specifies the SDK versions


Components of Android Applications
Activities:
To interact with the user interface.
Example: A login screen or a form screen in an app.

Services:
A service is a background component
Example: Fetching data from the network.
Components of Android Applications
Content Providers:
To share the data

Example: Sharing contact details between apps

Fragments:
To part of the user interface in an activity

Intents
To facilitate communication between different components of an
app,
Components of Android Applications
Views

Views are basic UI components like buttons, text fields, etc.,

Resources

Resources refer to external elements like strings, images, and


layout files used to define the visual and functional aspects of an
application.
Components of Android Applications
Views

Views are basic UI components like buttons, text fields, etc.,

Resources

Resources refer to external elements like strings, images, and


layout files used to define the visual and functional aspects of an
application.
GRADLE
Gradle is an advanced build system

To automates the process of creating Android applications.

Works
Gradle allows developers to define
Custom build configurations
Automate tasks and
testing.
Gradle Build Process
1. To Initialization the environment.

2. Gradle reads the [Link] files

3. To Configures the tasks based on the project settings.

4. To Execute the task


Gradle Plugins
Kotlin Plugin: If your app is written in Kotlin, this plugin is
necessary for compiling Kotlin code.

Java Plugin: Adds tasks for compiling Java code.

Android Plugin for Gradle: Using Java/Kotlin code


Gradle Build Variants
Debug variant: Used for testing and includes additional debugging
information.

Release variant: To increase the app performance


Advantages
Flexibility

Efficiency

Easy to use

To automate tasks such as testing and buildingthe app,


Stages of software Development
Software Development is the process of writing and maintaining
the source code of software.

Stages
Requirement Analysis: Gathering the needs and requirements of
the end-users or clients to define what the software should do.

Design: Planning the architecture and user interface of the


software. This stage involves creating models, diagrams, and plans
that guide the actual coding process.
Stages of software Development
Implementation (Coding): Writing the actual code that makes the
software function according to the design. This is where
programmers use programming languages like Java, Kotlin.

Testing: To test the software products. To identify the bugs.

Deployment: Releasing the software to users,


Stages of software Development
Maintenance

Improve performance
Add new features, and
Ensure compatibility with new systems or technologies.
XML to GUI Objects in Android
Definition
•To define the user interface

•A user interface (UI) is the space where interactions between a


user and a system occur, typically involving visual elements like
buttons, text, and menus

•It is used to describe the layout and the structure of the GUI
objects in Android applications.

Widgets
To define the UI components
XML Introduction to GUI Objects in
Android
XML file Storage Location
XML files are stored in the res/layout directory of the Android
project.

res - resources
XML Introduction to GUI Objects in
Android
Benefits
Easy to maintain the code

Readable and Structured

Ease of Modification

Support for Different Screen Sizes:


Three Layouts
LinearLayout: Arranges child views either horizontally or
vertically.

RelativeLayout: Arranges views relative to the parent.

ConstraintLayout: layout arrangements using constraints.


Format of XML Layout File
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="[Link]
droid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
………. GUI Objects - Text, Radio
--------
</LinearLayout>
Explain the Format of XML Layout File
<?xml version="1.0" encoding="utf-8"?>

•This line specifies the XML declaration.

•<?xml version="1.0": Declares the version of the XML

•Utf-8 – Unicode Transformation Format 8 bit

•encoding="utf-8": Character Encoding. Support for


multiple languages
Format of XML Layout File
<LinearLayout>: This is the root element of the layout.
It includes parent and child

xmlns:android=[Link]
roid - It is XML name space.
Unique identify the elements and attributes
Format of XML Layout File
android:layout_width="match_parent" - Width of the
LinearLayout. (parent layout)

android:layout_height="match_parent" - Height of the


LinearLayout. (parent layout)

android:orientation="vertical" - This attribute specifies


the direction in which the child elements (views) inside
the LinearLayout will be arranged.
GUI Objects
TextView: Displays text to the user.

EditText: A user-input field for entering text.

Button: Represents a clickable button that performs


actions.

ImageView: Used to display an image.


GUI Objects
CheckBox: A UI component that allows users to select or
deselect an option.

RadioButton and RadioGroup: RadioButton allows the


user to select one option from a set.

Switch: Toggle switch to select between two states


(on/off).

ProgressBar: Shows progress in a visual form, such as


during loading.
TextView
Displays text to the user.

Common attributes:
<TextView android:id="@+id/textView"
android:text = “Message”,
android:textSize =“Value”,
android:textColor = “Color Value”
android:layout_width="wrap_content"
android:layout_height="wrap_content“ >
TextView
Example
<TextView android:id="@+id/textView"
android:layout_width=“75
android:layout_height=“150"
android:textColor = “#000000”
android:text="Welcome to Android" />

<TextView - Declaration for an Textview element


@+id/editText - Assigns a unique ID to this Textview.
TextView
Format
android:layout_width="wrap_content" - sets the width
of the TextView.

android:layout_height="wrap_content" - sets the width


of the TextView.

android:text="Welcome to Android" /> - Sets the text that


will be displayed in the TextView.
Button
Represents a clickable button that performs actions.

Common attributes:
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me"
android:background
android:onClick="handleClick"/>

<button - Declaration for an button element


@+id/editText - Assigns a unique ID to this button.
android:onClick – used to specify a method to be invoked on click).
Button
Format
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Submit" />
EditText
Purpose: Input field for user text input.
<EditText
android:id="@+id/editText"
android:hint="Enter your name"
android:inputType="text“
android:text=“Message”>
<EditText - Declaration for an EditText element
@+id/editText - Assigns a unique ID to this EditText.
android:id="@+id/editText": This assigns a unique ID to
the edit text
ImageView:
Purpose: Displays an image.
<ImageView
android:id="@+id/imageView“
android:src="@drawable/image“
android:height="@drawable/image“
android:width="@drawable/image"
android:contentDescription="Sample Image"/>
<ImageView>: Declaration for an Image element
android:id="@+id/editText": This assigns a unique ID to
the image view
CheckBox:
Purpose: Represents a checkbox which can be checked or
unchecked.
<CheckBox
android:id="@+id/checkBox“
android:text="I agree to the terms"
android:checked="false"/>

<CheckBox>: Declaration for an Image element


android:id="@+id/checkBox": This assigns a unique ID to
the check box
RadioButton:
Purpose: Represents a radio button, typically used within
a RadioGroup.
Format
<RadioButton android:id="@+id/radioButton“
android:text="Option 1"
android:checked="false"/>

<RadioButton>: Declaration for an radio element


android:id="@+id/radioButton": This assigns a unique ID
to the radio button
Switch:
Purpose: Toggle switch to select between two states
(on/off).
Format
<Switch
android:id="@+id/switch“
android:text="Enable notifications"
android:checked="true"/>
<Switch>: Declaration for switch element
android:id="@+id/switch": This assigns a unique ID to
the switch
ProgressBar:
Purpose: Shows progress in a visual form, such as during
loading.
Example
<ProgressBar android:id="@+id/progressBar“
android:layout_width="wrap_content"
android:layout_height="wrap_content“
android:layout_gravity="center"/
android:max="100"
android:progress="50"/>
Progress – To set the initial progress value
Max – To set the maximum value
Adapter Methods in Android
Interface between UI components and the data source.
| |
View Collection of data
View (Array & List)
View refers to the basic building block of the user
interface (UI).
Examples of views
It include buttons, text fields, image views, or progress
bars.
Adapter Methods in Android

Operations
•Creating views
•Binding data
•Getting data count
•Position of the data
•Managing the views.
Types of Adapter Methods in Android

getCount()
getItem(int position)
getItemId(int position)
getView( )
getDropDownView( )
notifyDataSetChanged()
notifyDataSetInvalidated()
onCreateViewHolder()
onBindViewHolder()
Format
@Override
Access Modifier returntype AdapterMethodName (Arg.)
{
------
}

Access Modifier – Public or Private


Return Type – int, long, view
Basic Methods in Adapters
getCount()
This method returns the total number of items in the data
source.

Example:
@Override
public int getCount()
{
------
}
Basic Methods in Adapters
getItem(int position)
This method returns the object at a specific position
in the data set.
Example:
@Override
public int getItem(int position)
{
………..
}
Basic Methods in Adapters
getItemId(int position)
•This method returns the unique ID of the item at the
specified position.
•It can be a primary key from a database.
Example:
@Override
public long getItemId(int position)
{
-----
}
The getView( )

To view to display the data in a list

@Override
public View getView( )
{

}
getDropDownView( )
•To supply data to Spinner widgets

•It returns the view for each item in the


drop-down list of the spinner.

@Override
public View getDropDownView( )
{
-------
}
notifyDataSetChanged()

•To refresh the UI


•Reload the data
Format

public void notifyDataSetChanged(arg.);


notifyDataSetInvalidated()

•Find out the not available in the list or


array.

Format
public void notifyDataSetInvalidated(arg);
onCreateViewHolder()

•It includes create layouts and store the data


items.

Format
@Override
public MyViewHolder onCreateViewHolder()
{

}
onBindViewHolder()

•To binding the data in run time.

Format
public abstract void onBindViewHolder();
XML Files in Android
XML files in Android serve as a bridge
between the UI and code.

Languages
Java
Kotlin.
XML Files in Android
XML files in Android serve as a bridge between
the UI and code.

Languages
Java
Kotlin.

Uses
To define the User Interface (UI) layout
Hardware resources
Software resources
XML Files in Android
XML files in Android serve as a bridge
between the UI and code.

Languages
Java
Kotlin.
Role of XML in Android Development

UI Layout: Defining the structure and


design of user interfaces (buttons, text
fields, images, etc.).
Resources: Managing resources like
strings, colors, and dimensions.
Security : Permission to access the file.
Animations: Defining animations in the
app.
Types of XML Files in Android
Layout XML Files
•Used to define the UI of an activity.
•Location: res/layout/
Values XML Files
Stores key resources like strings, colors,
dimensions, and styles.
Location: res/values/
Types of XML Files in Android
Manifest XML File: It include the app
permissions
Location: [Link]

Drawable XML Files: Used to define


shapes, colors, gradients, or other visual
elements used for UI components.
Location: res/drawable/
Types of XML Files in Android
Menu XML Files: Used to define menus.
Location: res/menu/

Resource XML Files


[Link] - To store color values used
in the app.
[Link] – It denotes the margins,
and text sizes.
DIALOG
A dialog in Android is a small window.
To prompts the user to make a decision.
Use
It is often used to
•capture user input,
•Show important information that
requires user attention.
Types of Dialogs in Android
AlertDialog - Ok, Cancel.
DatePickerDialog: Used for selecting
dates.
TimePickerDialog: Used for selecting
times.
ProgressDialog : Displays a progress
indicator such as loading.
Custom Dialogs: Fully customized
dialogs with custom layouts.
Dialog vs. Activity
Dialog: Represents a Small screen that
takes over the user’s interaction with
the app.

Activity: Represents a full screen that


takes over the user’s interaction with
the app.
Advantages of Using Dialogs
Quick Interactions

Clear Focus

Flexible Design
AlertDialog
It often used to display warnings, alerts,
or confirmations.

It typically contains a title, a message,


and action buttons (e.g., OK, Cancel).
AlertDialog
[Link] – class is used to create an
AlertDialog.

[Link] – Title of Alert Dialog

[Link] – Diplay the message


[Link]("Are you sure you want to delete this item?");

[Link] – Positive action – Yes (0r)


Ok

[Link] – Negative Action –


Cancel or No
DatePickerDialog
•A dialog that allows the user to pick a
date from a calendar-like interface.
Class
•DatePickerDialog class
Method
[Link]();
TimePickerDialog
•It is Used for selecting times.
•User is to set the times, such as alarm or
reminder apps.
Class
TimePickerDialog class to create a
time picker.
Method : [Link]();
ProgressDialog
A dialog that shows a progress indicator,
typically used for long-running tasks.

Ideal for operations where the user has


to wait, such as file downloads or data
processing…
ProgressDialog
Class
ProgressDialog
Methods
[Link]("Loading...");
[Link]();
// Prevents closing the dialog
Custom Dialog
Developers to define their own layout
using XML.

android:orientation="vertical"
android:padding=“value"
android:layout_width=“value"
android:layout_height=“value”"
Widgets in Android App Development
Definition
Widgets are building blocks
To creating the user interface (UI) in Android applications.
Types of Widgets
TextView Spinner
EditText ProgressBar
Button Switch
CheckBox
RadioButton
WeightSum in Android

Definition
To represents the total sum of weights in the layout.
It is mainly used for linear layout.

Format
android:weightSum="value"
Spinner
Definition
A Spinner in Android is a UI component
Binds the data to the views.
User to select an item from a drop-down list.
Explain
•AdapterView: It is a view that acts as a bridge between
the user interface and the data source.

•ArrayAdapter: It is an adapter that binds data to the


views (such as Spinners) and provides a simple list of
items.
Toast
A Toast in Android is a short message that pops up on the
screen and disappears after a short duration.

It is used to display short messages to the user without


requiring any interaction.
Components of Toast
Activity: Represents a single screen in the app. It hosts
the UI.

XML Layout: Defines the UI components.

Java/Kotlin Code: Contains the logic for interacting with


the UI and performing tasks.
Methods
showToastButton - button defined in the XML.
setOnClickListener: Wait for button is click or not.
[Link] – To display the message.
Toast.LENGTH_SHORT - Duration of display the message
[Link]() – To display the toast on the screen.
[Link]([Link]); - left or right or center
Splash Screen

A splash screen is the initial screen that appears


when a user launches an app.

It typically displays a logo, app name, or any


branding visuals and is often shown for a few
seconds before moving on to the main content of
the app.
Splash Screen
Used for

<RelativeLayout>

……

</RelativeLayout>
Splash Screen Attributes
android:background=“Name of the color">
android:src="@drawable/logo“ – logo
android:text=“Message"
android:textSize=“Text Size"
android:textColor=“Text color“
SPLASH_TIME_OUT = “Number of seconds“;
Layouts in Android
It defines the structure of the user
interface (UI) of an application.

It organizes the elements (views) such


as buttons, text fields, and images on
the screen in a specific arrangement.
Types of layouts in Android
Linear Layout
Relative Layout
Nested Layout
Constraint Layout
Frame Layout
Table Layout
Format
<LayoutName
--------
------
----- >

---
</LayoutName>
Types of Android Layouts
LinearLayout - is arranged horizontally or vertically

RelativeLayout – To relate the parent container.

Nested Layouts - Nested layouts occur when one layout is


placed inside another layout.

ConstraintLayout: Allows flexible positioning of views by


defining constraints relative to other views or parent
layout.
Types of Android Layouts
Frame Layout – Area of the screen. In row wise or column wise

TableView Layout – To specify the number of rows and columns


Android Layouts Properties
To define how views are displayed on the screen.

layout_width and layout_height - Specifies the width and height of


the view.

layout_gravity - Defines how the view is aligned within its parent


layout. Options: top, bottom, left, right, center, start, end, etc.

layout_margin – To set the layout margin


Android Layouts Properties
Padding - Adds space inside the view, between its content and its
boundary.

layout_alignParentStart and layout_alignParentEnd (specific to


RelativeLayout) – To aligns a view to the start or end of the parent
layout.

Layout_backcolor

Layout_visible
Menus
Definition
It allows you to provide user interface (UI)
options to the User.
Format Menus
<menu >
<item android:id="@+id/Parent Menu"
android:title=“Parent Menu">
<menu>
<item android:id="@+id/Child Menu"
android:title=“Child Menu1"/>
</item>
</menu>
</item>
</menu>
Example of Menus
<menu >
<item android:id="@+id/menu_file"
android:title="File">
<menu>
<item android:id="@+id/menu_new"
android:title="New"/>
</item>
</menu>
</item>
</menu>
Types of Menus
Options Menu

Context Menu

Popup Menu

Custom Menu
Types of Menus
Options Menu: Accessible through the action bar.
Types of Menus
Context Menu: Triggered on a long press of a
View.
Types of Menus
Popup Menu: Anchored to a View, displayed on
demand.
Types of Menus
Custom Menu: Customizable layout for a visually
distinct menu.
SQLite in Android
SQLite is a embedded database.
It is used for storing structured data in Android
applications.

Concepts
•Database: A collection of tables to store structured data.
•Tables: Each table contains rows (records) and columns
(fields).
•Queries: SQL statements used to interact with the
database, such as SELECT, INSERT, UPDATE, and DELETE.
Features of SQLite in Android
•Embedded: No need for separate database
management software; it's built into Android.
•Zero configuration: No server setup
•Small footprint: Less space.
•Cross-platform: Supports various platforms.
•Transactional: Supports all standard database
transactions (COMMIT, and ROLLBACK).
Benefits of SQLite
Offline support: Data can be stored locally.

Persistence

Ease of use

Efficient
Create a Database

Android provides the

SQLiteOpenHelper class – Parent Class


I
I
DatabaseHelper – Child Class
Define a Database Helper class

Class Declaration
public class DatabaseHelper extends
SQLiteOpenHelper
{

}
Database Constants

Create a database file


private static final String DATABASE_NAME =
"[Link]";

Versions

private static final int DATABASE_VERSION = 1;


Constructors

public DatabaseHelper( )
{

}
Common SQLite Methods in Android
onCreate(): To create a database.
onUpgrade(): Handles database version changes
insert(): Inserts a new row into the table.
query(): Retrieves data from the database.
update(): Modifies existing records in the
database.
delete(): Removes records from the database.
Drop( ) : To delete the table
.aia
.aia is App Inventor Archive.
An .aia file contains all the components, blocks,
and design of an App Inventor project
How to Use .aia Files
• To Export: Go to Projects > Export selected
project (.aia) to save the project as an .aia file.

• To Import: Go to Projects > Import project


(.aia) from my computer and select an .aia file
to add the project to your workspace.
Google Emulator
[Link]
[Link]/latest
onCreate( )
To create a database.
@Override
public void onCreate(SQLiteDatabase db)
{
[Link]("CREATE TABLE students (id
INTEGER PRIMARY KEY, name TEXT, mark1
INTEGER)");
}
SQLiteDatabase db - allowing SQL commands to
be executed on it
onUpgrade() Method
Handles database version changes
@Override
public void onUpgrade(SQLiteDatabase db, int
oldVersion, int newVersion)
{

}
SQLiteDatabase db - allowing SQL commands to
be executed on it
insert() Method
Adds a new row to the table in the database.

[Link]("students", 1, x);
query() Method
Retrieves data from the table in the database.

[Link]("students", no, m1);


update() Method

Modifies existing rows in the table.

[Link]("students", m1 100);

[Link]("students", m1 100 where no 1);


delete() MethodPurpose
Removes rows from the table.

[Link]("students", no, 100);


Drop

[Link]("DROP TABLE IF EXISTS students");


Opening a Database in SQLite

Existing Data

Read data from the database.


Opening a Database in SQLite

Steps to Open a Database


SQLiteOpenHelper class - To manage database
creation and version control.
Methods
1. getWritableDatabase() - Write Mode
Automatically calls onCreate() or onUpgrade()
2. getReadableDatabase() – Read mode
Closing a Database in SQLite

Closing the database connection.


Frees up system resources and reduces memory
usage.
Using close() Method

Example
[Link](); // Closes the database connection
Shared Preferences in Android
Used to store small and simple data

It is lightweight data storage

Using Primary Key

Ex. Login Details


Persistence
To permanently store the data in DB
Modes of Shared Preferences

MODE_APPEND

MODE_WORLD_READABLE

MODE_WORLD_WRITEABLE
Advantages of Shared Preferences

Simple

fast to implement.

Persistent data storage


Modes of Shared Preferences

MODE_WORLD_WRITEABLE: Users to modify data

MODE_WORLD_READABLE: Users to read the


data

MODE_PRIVATE: Restrict to access the data.


Adding Data to Shared Preferences

using the Editor interface.

Use put method

[Link](“stuname", “x");
[Link](“age", 25);
[Link]();
Retrieving Data from Shared Preferences

use the get methods.

[Link](“stuname", “John");

[Link]("Age", 34);
Removing and Clearing Data
remove() - delete a particular data.
clear() to delete all data.

Example
[Link](“college");
[Link]();

// Clear all items


[Link]();
[Link]();
Content Providers in Android
It is a component

To manage and share data between applications.


.
Usage of Content Provider
Data Sharing: To share the data between
applications.

Data Security: permission to access the data

Standard Interface: To interact with various data


sources like databases and files
Components of a Content Provider
URI (Uniform Resource Identifier): A unique
address used to identify the data set

CRUD Operations: Methods that perform Create,


Read, Update, and Delete actions on the data.

Permissions: Set permissions to control access to


data.
Content Provider Structure
content://authority/path/id

Authority: Uniquely identifies the content


provider.

Path: Identifies the path of data accessed

ID: To allocate the id for each data


Content Providers Key Methods
onCreate(): Initializes the Content Provider.

query(): Reads data.

insert(): Adds new data.

update(): Modifies existing data.

delete(): Deletes data.


Built-in Android Content Providers
Contacts Provider: Access contact data.

MediaStore Provider: Access multimedia files, like


images and audio

.Calendar Provider: Access calendar data


Content Values
It is used to insert new rows into tables

Cursor Class
It returns database queries
Cursor Functions
moveToFirst - To move the cursor to first row.
moveToNext
moveToPrevious
moveToLast
GetCount – Return number of rows.
getPosition – Returns the current cursor position
Benefits of Using Content Providers
Easy to share the data

More Security

Easy to handle the data


Storage
To store the data and files.

Types of files : Text, audio, image and video files

File Operations
Read and Write Operations
Storage Location
Local storage
Centralized storage
Storage Options
SENSORS
To capture the real time information

Types
AccelerometerSensor
BarcodeScanner
LightSensor
LocationSensor
Animation
Graphical Movement
Techniques
Fade In
Fade Out
Bounce
Slide-In-Right, Slide-In-Left
Example
Car Animation program - Refer
Drawing line - Refer
Firebase in Android
Developed by Google

It is building mobile and web applications.

Provides
Real-time databases
Authentication
Cloud messaging, and
Google analytics
Features of Firebase
Real-time Database - Stores and syncs data
between users in real-time. No need for a
separate server to manage the database.
Authentication
Cloud Storage – To store files, videos and images
Cloud Messaging Allows sending message
Crashlytics - Helps identify and fix app crashes
with real-time crash reports.
Analytics – Analyze the app performance.
Advantages of Using Firebase
Real-time synchronization: Data updates instantly
across all connected devices.
Simplified backend
Cross-platform support
Scalable infrastructure: Handles large amounts of
data and users.
To protect the app's data.
Steps
[Link] sign in gmail account
[Link] URL [Link]
[Link] select the Go to console option
[Link] press the create a new project
[Link] type the project name Ex. MepcoFirebase
[Link] create a project id – Ex. Wed32e32
[Link] enable the google analytics
[Link] configure the firebase
[Link] + Firestore Database
Steps
10. To press the create database button + Next
11. To select the start in production mode +
Create
12. To press the rule option. To set true in
Read/Write + publish
rules_version = '2';
service [Link] {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true; } } }
Example

Store the input value – using textbox and button


UI

Experimental + firebase
MAPS
It is location based services.

To integrate the google map.

Use
Tracking user location

Providing navigation
Advantages of MAPS

User Interaction

Easy to customize
Types of Maps
Normal Map: Standard map view with roads and
locations.

Satellite Map: Visual representation of the Earth's


surface.

.Hybrid: Combines Normal and satellite maps

Example : Location finder Program


Storage
To store the data and files.

Types of files : Text, audio, image and video files

File Operations
Read and Write Operations
Storage Location
Local storage
Centralized storage
Storage Options
Types of Storage
Internal Storage – SQLite

External Storage – Multi Media Card (MMC) and


Secure Digital Card (SD Card)
Features MMC SD Card
Multi Media Card Secure Digital Card

Introduction Introduced in 1997 Introduced in 1999


by Siemens and by SanDisk,
SanDisk. Panasonic, and
Toshiba.
Storage Capacity Up to 512 GB Up to 2 TB

Speed Slower Faster

File System FAT12, FAT16, FAT16, FAT32, exFAT


FAT32. (Extended File
Allocation Table)
Compatibility Platform Dependent Platform
Independent
Features MMC SD Card
Multi Media Card Secure Digital Card
Power Consumption Higher Power Lower Power
consumption. Consumption
Cost Generally cheaper Slightly more
expensive
Sending SMS

Using smsManager API Class


|
To sending text messages and multimedia
messages
Sending SMS Methods
SendTextMessage () – Sending numbers and
characters messages

SendMultimediaMessage() – To send the audio,


video, text and animation files.

FindViewById() – To create unique id of each


message

SendTextMessage() – Sending message


Example of Sending SMS
[Link] (“Message”);
Sending E-mail
To share the message from one system to another
system through network

E-mail Providers
Gmail
Android
Outlook
Intent Object of E-mail
It is used to send and receiving and viewing mail
Intent Fields / Objects
EXTRA_BCC – used for blind carbon copy
EXTRA_CC – used for carbon copy
EXTRA_EMAIL– Used for receiving email
EXTRA_HTML_TEXT – Sending email
EXTRA_SUBJECT – Subject line of a message
EXTRA_TEXT – Denotes the body of the message
EXTRA_TITLE – To show the mail users
Bluetooth in Android
Bluetooth in Android enables wireless
communication between devices over short
distances
Provides
File sharing
Connecting to peripherals such as keyboards and
mice.
Features of Bluetooth in Android
Wireless Communication: Allows devices to
exchange data without cables.
Secure Connection
Low Power Consumption:
Wide Application: Used in IoT, smart devices,
health monitors, and more.
Bluetooth Architecture in Android

Bluetooth Adapter:
Represents the Bluetooth hardware on the device.
Bluetooth Device:
Represents a remote Bluetooth device.
Bluetooth Socket:
Enables communication between paired devices.
Bluetooth Server Socket:
Listens for incoming connections.
Steps to Use Bluetooth in Android
[Link] Bluetooth - Turn on the Bluetooth adapter
programmatically.
2. Discover Devices - Find nearby Bluetooth
devices.
3. Connection
Establish a secure connection between devices.
4. Communicate
Transfer data using Bluetooth sockets.
Classes
BluetoothAdapter:
Entry point for all Bluetooth interactions.
BluetoothDevice:
Represents a remote device.
BluetoothSocket:
Provides communication channels.
BluetoothServerSocket:
Listens for incoming connections.
Advantages
Wireless Connectivity:
Eliminates the need for physical connections.
Energy-Efficient:
Optimized for short-range communication.
File sharing

Platform Independent
Works across various operating systems.
Limitations of Bluetooth in Android
Short Range: Typically limited to 10 meters for
most devices.
Slow Transfer Speed
Battery Consumption: Can drain battery if not
managed efficiently.
Example
Scanner
<uses-permission
android:name="[Link].BLUETOOTH_
SCAN" />

Connection
<uses-permission
android:name="[Link].BLUETOOTH_
CONNECT" />
iOS in Mobile Application
iOS stands for iPhone Operating System (Internet
Phone)
Introduced in 2007
iOS is a mobile operating system
Developed by Apple

Advantages
user-friendly interface
High security
Easy to integration
iOS Devices:
Runs on
iPhone
iPad, and
iPod Touch.
Features of iOS
1. User Interface (UI): Used for navigation
2. App Store: Centralized platform to download
applications.
3. Security: Strong security features like Face ID,
Touch ID
4. High Performance: To perform smooth
operations
5. Virtual assistant for voice-based commands and
queries.
6. Multitasking: Allows switching between apps
Features of iOS
7. iCloud: Storage for apps, photos, and videos
8. Dark Mode:
Offers a system-wide dark theme to reduce eye
strain.
9. Regular Updates: To add new features with
each update.
Core Components of iOS
1. UIKit Framework: Used to design the UI of iOS
apps. It Provides tools for buttons, labels etc.,
2. Foundation Framework: Handles data storage,
date manipulation, and communication.
3. Core Data: Used for data persistence within
apps.
4. Core Graphics and Animation: Enables
developers to create animations and graphical
effects.
5. AVFoundation: Manages audio and video
playback.
Developer Tools for app development

Xcode (eXtreme Code) and

Objective-C (Extension of C) – Support the OOP


Advantages of iOS in Mobile Applications
Ease of Use: Simplifies complex tasks for
end-users.
Strong Security: Protects user data and privacy.
Consistent Performance
Seamless Ecosystem: Works well with other Apple
products like Mac, Apple Watch, and Apple TV.
Developer Tools: Xcode (eXtreme Code) and
Objective-C make app development efficient.
Challenges in iOS Development

Closed Ecosystem: Developers must adhere to


strict guidelines.

High Cost

Limited Customization
Development Process for iOS Apps
Setup: Use a Mac with Xcode installed.
Register for an Apple Developer account.
Design: Use Interface Builder in Xcode.
Coding: Write code in Swift or Objective-C.
Use libraries and frameworks for functionality.
Testing:
Test the app on the iOS Simulator or physical devices.
Deployment:
Submit the app to the App Store for review and
distribution.
Classes
Parent Class - UIViewController
Child Class - ViewController

class ViewController: UIViewController


{

}
Storyboard in Mobile Applications

•Visual representation of the UI of an application.


•It provides a graphical way to design and connect
multiple screens of an app.
•It is primarily used in iOS development
•IDE Environment
Storyboard Class

•UIViewController
Key Features of Storyboard
Graphical Representation:
Displays all screens of an app in a single file.
Helps visualize the flow and navigation between
different screens.
Drag-and-Drop Interface: - add UI components
such as buttons and labels using drag-and-drop.
Scene: Represents one screen
Segue: navigation between scenes.
Ease of Navigation – Moving one screen to
another
Advantages of Using Storyboards

Easy to design

No Coding

Easy to testing
Steps to Create a Storyboard
1. Open Xcode - To create a new project.
2. Select Storyboard File - [Link] file
3. Add Scenes - using ViewController
4 . To Design UI – using buttons, labels, and
images
5. Connect Scenes with Segues (Navigation)
6. Link to Code
Types of Segues
Show (Push):
Used for navigation in a navigation controller.
Modal:
Presents a new scene
Custom:
Enables custom transitions between scenes.
Best Practices
Use Storyboard IDs:
Assign unique IDs to view controllers

Split Workload:
Complex storyboards by splitting into smaller ones.
Consistency:
To represent the group of scenes

You might also like