Download as pdf or txt
Download as pdf or txt
You are on page 1of 200

Diploma Engineering

Laboratory Manual
Mobile Application Development using Android
(4350703)

[Computer Engineering, Semester IV]


Enrolment No
Name
Branch
Academic Term
Institute

Directorate of Technical Education


Gandhinagar - Gujarat
Mobile Application Development (4350703)

MOBILE APPLICATION DEVELOPMENT (4350703)

Laboratory Manual

Prepared By,
Shri. Paraskumar J. Joshi, Shri. Mayukumar R. Thakkar
Lecturer, Computer Engineering Lecturer, Computer Engineering
K. D. Polytechnic, Patan K. D. Polytechnic, Patan

Shri. Niraj R. Trivedi


Lecturer, Compute Engineering
A. V. Parekh Technical Institute, Rajkot

Branch Co-Ordinator,
Shri. B. H. Kantevala
HoD, Computer Engineering,
Govt. Polytechnic, Ahmedabad

Committee Chairman,
Shri. R. D. Raghani
HoD, Electronics & Communication,
Govt. Polytechnic, Gandhinagar

2 | Page
Mobile Application Development (4350703)

DTE’s Mission:
• To provide globally competitive technical education;
• Remove geographical imbalances and inconsistencies;
• Develop student friendly resources with a special focus on girls’ education and
support to weaker sections;
• Develop programs relevant to industry and create a vibrant pool of technical
professionals.

Institute’s Vision:
………………………………………………………………………………………..…………………
…….…………………………………………………………………………………..…………..……
………..……………………………………………………………………………….…………..……
…………..…………………………………………………………………………….……………..…
……………..………………………………………………………………………….………………..
………………..…………………………………………………………………………………………
..………………..……………………………………………………………………….……………..
Institute’s Mission:
………………………………………………………………………………………..…………………
…….…………………………………………………………………………………..…………..……
………..……………………………………………………………………………….…………..……
…………..…………………………………………………………………………….……………..…
……………..………………………………………………………………………….………………..
………………..…………………………………………………………………………………………
..………………..……………………………………………………………………….……………..
…………..…………………………………………………………………………….……………..…
……………..………………………………………………………………………….………………..
………………..…………………………………………………………………………………………
..………………..……………………………………………………………………….……………..

3 | Page
Mobile Application Development (4350703)

Department’s Vision:
………………………………………………………………………………………..…………………
…….…………………………………………………………………………………..…………..……
………..……………………………………………………………………………….…………..……
…………..…………………………………………………………………………….……………..…
……………..………………………………………………………………………….………………..
………………..…………………………………………………………………………………………
..………………..……………………………………………………………………….……………..
Department’s Mission:

………………………………………………………………………………………..…………………
…….…………………………………………………………………………………..…………..……
………..……………………………………………………………………………….…………..……
…………..…………………………………………………………………………….……………..…
……………..………………………………………………………………………….………………..
………………..…………………………………………………………………………………………
..………………..……………………………………………………………………….……………..
………………………………………………………………………………………..…………………
…….…………………………………………………………………………………..…………..……
………..……………………………………………………………………………….…………..……
…………..…………………………………………………………………………….……………..…
……………..………………………………………………………………………….………………..
………………..…………………………………………………………………………………………
..………………..……………………………………………………………………….……………..

4 | Page
Mobile Application Development (4350703)

Institute: ________________________________________________

Certificate

This is to certify that Mr./Ms ………………………………………………………………….


Enrollment No. ………….…………….…….…….……. of 5th Semester of Diploma in Computer
Engineering of ………………………………………………………………………. (GTU Code) has
satisfactorily completed the term work in course Mobile Application Development using
Android (4350703) for the academic year: …………………… Term: Odd prescribed in the GTU
curriculum.

Place: …………………..

Date: …………………..

Signature of Course Faculty Head of the Department

5 | Page
Mobile Application Development (4350703)

Preface
The primary aim of any laboratory/Practical/field work is enhancement of required skills as
well as creative ability amongst students to solve real time problems by developing relevant
competencies in psychomotor domain. Keeping in view, GTU has designed competency focused
outcome-based curriculum -2021 (COGC-2021) for Diploma engineering programmes. In this more
time is allotted to practical work than theory. It shows importance of enhancement of skills amongst
students and it pays attention to utilize every second of time allotted for practical amongst Students,
Instructors and Lecturers to achieve relevant outcomes by performing rather than writing practice in
study type. It is essential for effective implementation of competency focused outcome- based
Green curriculum-2021. Every practical has been keenly designed to serve as a tool to develop &
enhance relevant industry needed competency in each and every student. These psychomotor skills
are very difficult to develop through traditional chalk and board content delivery method in the
classroom. Accordingly, this lab manual has been designed to focus on the industry defined relevant
outcomes, rather than old practice of conducting practical to prove concept and theory.

By using this lab manual, students can read procedure one day in advance to actual
performance day of practical experiment which generates interest and also, they can have idea of
judgement of magnitude prior to performance. This in turn enhances predetermined outcomes
amongst students. Each and every Experiment /Practical in this manual begins by competency,
industry relevant skills, course outcomes as well as practical outcomes which serve as a key role for
doing the practical. The students will also have a clear idea of safety and necessary precautions to be
taken while performing experiment.

This manual also provides guidelines to lecturers to facilitate student-centered lab activities
for each practical/experiment by arranging and managing necessary resources in order that the
students follow the procedures with required safety and necessary precautions to achieve
outcomes. It also gives an idea that how students will be assessed by providing Rubrics.

Smartphones and mobile applications have grown in popularity in recent years. This trend is
expected to continue, resulting in an increased demand for professionals who can create mobile
applications. Android mobile application development is a relevant and important topic for
computer engineering students because it allows them to apply their programming skills and
knowledge to create real-world applications. The course provides students with hands-on
experience in developing mobile applications using Android. This practical experience is essential for
students to be able to apply the concepts they have learned in a real-world setting. This course will

6 | Page
Mobile Application Development (4350703)

help students to build core competencies in mobile application development with relevant skills and
knowledge, practical experience, and career opportunities in a growing and dynamic industry.

Although we try our level best to design this lab manual, there are always chances of
improvement. We welcome any suggestions for improvement.

7 | Page
Mobile Application Development (4350703)

Programme Outcomes (POs):


Following programme outcomes are expected to be achieved through the practical of the course:

1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics, science and
engineering fundamentals and engineering specialization to solve the engineering problems.
2. Problem analysis: Identify and analyse well-defined engineering problems using codified
standard methods.
3. Design/development of solutions: Design solutions for engineering well-defined technical
problems and assist with the design of systems components or processes to meet specified
needs.
4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to conduct standard tests and measurements.
5. Engineering practices for society, sustainability and environment: Apply appropriate
technology in context of society, sustainability, environment and ethical practices.
6. Project Management: Use engineering management principles individually, as a team member
or a leader to manage projects and effectively communicate about well-defined engineering
activities.
7. Life-long learning: Ability to analyse individual needs and engage in updating in the context of
technological changes in field of engineering.

8 | Page
Mobile Application Development (4350703)

Practical Outcome - Course Outcome matrix


Course Outcomes (COs):
• CO1: Develop Android applications using Android application Components and Life Cycle of
Activity after setting up Android Development Environment.
• CO2: Design Activity using Layouts and Widgets.
• CO3: Apply Event Handling in Android application to perform user actions.
• CO4: Develop Android Applications using Menu, Dialog, and Databases.
• CO5: Develop Android applications using Kotlin Language.
Sr.
Experiment/Practical Outcome CO1 CO2 CO3 CO4 CO5
No.
Set-up of Android development environment, managing √ - - - -
1
AVD and understanding its various components.
Understanding of Various Components available in √ - - - -
2
Android Application
Develop a “Hello World” Application in Android and √ - - - -
3
understand the structure of an Android Application
Develop Android Application to demonstrate methods of √ - - - -
4
Activity Life Cycle.
Design Android Activities using LinearLayout, - √ - - -
5 RelativeLayout, GridView, FrameLayout, and
ConstraintLayout
Design various Activities using different Layouts and - √ - - -
available Widgets(TextView, EditText, Button,
6 RadioButton, CheckBox, ImageButton,
ToggleButton,TimePicker, DatePicker, ProgressBar,
ImageView) to make the user-friendly GUI.
Develop code to demonstrate different ways of Handling - - √ - -
different events (onClick, onLongClick etc.) over Button,
7
EditText etc. to perform action in Android application at
run-time.
Develop code to demonstrate Event handling of - - √ - -
8
CheckBox and RadioButton selection.
Develop code to navigate between different activities - √ - -
-
9 and pass the data from one activity to other activity
using Intent.
Develop an android application to store data locally using - - √ - -
10 SharedPreferences and access-modify in different
activities.
Develop the code to implement the ListView and the - - √ - -
Spinner views, perform add, update, remove items
11 operations and implement the item selection event
handling over ListView and Spinner for appropriate
example.
9 | Page
Mobile Application Development (4350703)

Develop the code to manage Permission using Manifest - - √ - -


12 file and run time from Activity, and toggle state of WiFi
and Bluetooth.
Develop android applications to demonstrate user - - - √ -
13 interaction with the application using Options Menu,
Context Menu and Popup Menu.
Develop Android Applications to demonstrate different - - - √ -
14 AlertDialogs and the Custom Dialog.
Develop Android Application for local database - - - √ -
15 connectivity and performing basic database operations
(select, insert, update, delete) using SQLiteDatabase and
SQLiteOpenHelper Classes
Develop an Android Application to demonstrate the use - - - √ -
16 of RecyclerView and CardView for displaying list of items
with multiple information
Develop a simple application to display “Hello - - - - √
17 <Application Name>” using Kotlin
Develop an android application using Kotlin having a - - - - √
18 Button “Click” and upon clicking on that Button a Toast
message “Button Clicked” should be displayed on screen
through Toast Message
Publish an Android Application on Play Store √ √ √ √ √
19

10 | Page
Mobile Application Development (4350703)

Industry Relevant Skills


The following industry relevant skills of the competency “Mobile Application Development using
Android” are expected to be developed in the student by undertaking the practical of this
laboratory manual.
1. Install and configure software as per requirements.
2. Write code for the given problem.
3. Debug program to fix errors.
4. Follow Coding Guidelines.

Guidelines to Teachers
1. Couse faculty should demonstrate experiment with all necessary implementation strategies
described in curriculum.
2. Couse faculty should explain industrial relevance before starting of each experiment.
3. Course faculty should involve & give opportunity to all students for hands on experience.
4. Course faculty should ensure mentioned skills are developed in the students by asking.
5. Utilise 2 hrs of lab hours effectively and ensure completion of write up with quiz also.
6. Encourage peer to peer learning by doing same experiment through fast learners.

Instructions for Students


1. Organize the work in the group and make record of all observations.
2. Students shall develop maintenance skill as expected by industries.
3. Student shall attempt to develop related hand-on skills and build confidence.
4. Student shall develop the habits of evolving more ideas, innovations, skills etc.
5. Student shall refer technical magazines and data books.
6. Student should develop habit to submit the practical on date and time.
7. Student should well prepare while submitting write-up of exercise.

11 | Page
Mobile Application Development (4350703)

Assessment Rubrics
Criteria % Rubrics
Excellent [4-5 marks]:
• Student is able to analyse the problem statement and propose/design the
Rubric (RB1):
solution of the problem statement efficiently.
Problem
Adequate [2-3 marks]:
analysis and
20 % • Student is able to analyse the problem statement and propose/design the
proposing
solution of the problem statement satisfactorily
/designing
Unsatisfactory [0-1 marks]:
solution
• Student is not able to understand the problem statement and not able to
propose or design the solution completely.
Excellent [7-8 marks]:
• Completed programs correctly as per the requirements.
Rubric (RB2): Adequate [5-6 marks]:
Program • Completed programs correctly with approx. 70% requirements.
30%
Completeness Satisfactory [3-4 marks]:
/ Correctness • Completed programs correctly with 70% - 50% requirements.
Unsatisfactory [0-2 marks]:
• Completed programs correctly with less than 50% requirements.
Excellent [4-5 marks]:
• The code is efficient, clean, well-organized, and very easy to understand.
Satisfactory[2-3 marks]:
Rubric (RB3): • The code is readable only by someone who knows what it is supposed to
Code 20 % be doing.
efficiency • The code is not up to the mark of efficiency.
Unsatisfactory [0-1 marks]:
• The code is poorly organized and very difficult to understand.
• The code is inefficient.
Excellent [4-5 marks]:
• The documentation and lab records with programming code and output
is written neatly and accurately.
Rubric (RB4): • The timely submission for the practical assessment is done.
Readability Satisfactory [2-3 marks]:
and • The documentation and lab records with programming code and output
20 %
Documentati is written satisfactorily with some correction.
on of the • The timely submission for the practical assessment is done.
program Unsatisfactory [0-1 marks]:
• The documentation and lab records with programming code and output
is written poorly.
• The late submission for the practical assessment is done.
Excellent [2 marks]:
• Student demonstrates full knowledge by answering allclass questions
Rubric(RB5): with explanations and elaboration.
Viva/Sample Satisfactory [1marks]:
10 %
question • Student is uncomfortable with info and is able to answer only basics.
answering Unsatisfactory [0 marks]:
• Student does not grasp any information, and student cannot answer
question about practical.
12 | Page
Mobile Application Development (4350703)

Continuous Assessment Sheet

Enrolment No: Name:


Term:
Sr. Date Marks
Experiment/Practical Outcome Page Sign
No Performed (25)
Set-up of Android development environment,
1 managing AVD and understanding its various
components.
Understanding of Various Components available
2
in Android Application
Develop a “Hello World” Application in Android
3 and understand the structure of an Android
Application
Develop Android Application to demonstrate
4
methods of Activity Life Cycle.
Design Android Activities using LinearLayout,
5 RelativeLayout, GridView, FrameLayout, and
ConstraintLayout
Design various Activities using different Layouts
and available Widgets(TextView, EditText,
Button, RadioButton, CheckBox, ImageButton,
6
ToggleButton,TimePicker, DatePicker,
ProgressBar, ImageView) to make the user-
friendly GUI.
Develop code to demonstrate different ways of
Handling different events (onClick, onLongClick
7
etc.) over Button, EditText etc. to perform
action in Android application at run-time.
Develop code to demonstrate Event handling of
8
CheckBox and RadioButton selection.
Develop code to navigate between different
9 activities and pass the data from one activity to
other activity using Intent.
Develop an android application to store data
10 locally using SharedPreferences and access-
modify in different activities.
Develop the code to implement the ListView
and the Spinner views, perform add, update,
11 remove items operations and implement the
item selection event handling over ListView and
Spinner for appropriate example.
Develop the code to manage Permission using
12 Manifest file and run time from Activity, and
toggle state of WiFi and Bluetooth.

13 | Page
Mobile Application Development (4350703)

Develop android applications to demonstrate


13 user interaction with the application using
Options Menu, Context Menu and Popup Menu.
Develop Android Applications to demonstrate
14 different AlertDialogs and the Custom Dialog.
Develop Android Application for local database
15 connectivity and performing basic database
operations (select, insert, update, delete) using
SQLiteDatabase and SQLiteOpenHelper Classes.
Develop an Android Application to demonstrate
16 the use of RecyclerView and CardView for
displaying list of items with multiple
information.
Develop a simple application to display “Hello
17 <Application Name>” using Kotlin.
Develop an android application using Kotlin
having a Button “Click” and upon clicking on
18 that Button a Toast message “Button Clicked”
should be displayed on screen through Toast
Message.
Publish an Android Application on Play Store.
19

14 | Page
Mobile Application Development (4350703)

Practical No.1
Set-up of Android development environment, managing AVD and understanding its
various components.

A. Objective:
This practical will help student to set up an android development environment to write,
compile and debug android application. It will also help students to create and use AVD
to test and run android application, and to understand various components of an android
application.

B. Expected Program Outcomes (POs)


• Engineering knowledge (PO1): Apply knowledge of basic mathematics, science and
Engineering fundamentals and engineering specialization to solve the engineering
Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering problems
using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined technical
problems and assist with the design of systems components or processes to meet
specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern engineering
tools and appropriate technique to conduct standard tests and measurements.
• Engineering practices for society, sustainability and environment (PO5): Apply
appropriate technology in context of society, sustainability, environment and ethical
practices.
• Project Management (PO6): Use engineering management principles individually, as
a team member or a leader to manage projects and effectively communicate about
well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in updating in
the context of technological changes.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills for Android mobile application
development.
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Develop Android applications using Android application Components and Life Cycle of
Activity after setting up Android Development Environment.

E. Practical Outcomes (PRO)


• To setup Android development environment.

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.

15 | Page
Mobile Application Development (4350703)

G. Prerequisite Theory:
The practical does not require knowledge of any prerequisite theory. The steps for the
installation and the setup is to be followed by the students which is explained in the
following section.

H. Experimental set up/ Program Logic-Flow chart (CE & IT 1st and 2nd semester
software subjects only):
Android Studio is the official integrated development environment (IDE) for Android app,
development built and distributed by Google. An IDE contains tools that enable software
developers to design, build, run, and test software, in this case, apps for the Android
platform. Android Studio uses IntelliJ IDEA as its foundation and includes the Android
plugin pre-installed along with some modifications specifically for the Android platform.

What you'll need:


1. A computer running a 64-bit version of Windows (8, 10, or 11), Linux, macOS (10.14
Mojave or later), or ChromeOS.
2. Internet access for your computer.

Android Studio system requirements:


The following are the system requirements for Android Studio on Windows.
• 64-bit Microsoft® Windows® 8/10/11
• x86_64 CPU architecture; 2nd generation Intel Core or newer, or AMD CPU with
support for a Windows Hypervisor
• 8 GB RAM or more
• 8 GB of available disk space minimum (IDE + Android SDK + Android Emulator)
• 1280 x 800 minimum screen resolution

Download Android Studio


1. Open any web browser and navigate to the link:
https://developer.android.com/studio
2. This is the Android Developers website, where you can download Android Studio.
This page automatically detects your operating system.
3. Click Download Android Studio. The Terms and Conditions page with the Android
Studio License Agreement opens.
4. Read the License Agreement.
5. At the bottom of the page, if you agree with the terms and conditions, select the I
have read and agree with the above terms and conditions checkbox.
6. Click Download Android Studio to start the download.
7. When prompted, save the file to a location where you can easily locate it, such as the
Downloads folder.
8. Wait for the download to complete. This may take a while and may be a good
moment to enjoy some tea!

16 | Page
Mobile Application Development (4350703)

Install Android Studio on Windows


1. Open the folder where you downloaded and
saved the Android Studio installation file.
2. Double-click the downloaded file.
3. If you see a User Account Control dialog
about allowing the installation to make
changes to your computer, click Yes to
confirm the installation.
4. The Welcome to Android Studio Setup dialog
displays.

5. click Next to start the installation process


6. Accept the default installation settings for all
steps.

7. Click Finish when


the installation is done to launch Android
Studio.
8. Choose your preference of light or dark theme when Android Studio first launches.
Screenshots in this course use the light theme, but choose whichever one you prefer.

17 | Page
Mobile Application Development (4350703)

9. During the installation, the setup wizard downloads and installs additional
components and tools needed for Android app development. This may take some
time depending on your internet speed. During this time, you may see a User
Account Control dialog for Windows Command Processor. Click Yes to accept the
dialog.
10. You may also receive a Windows Security Alert about adb.exe. Click Allow Access, if
needed, to continue the installation.
11. When the download and installation completes, click Finish.
12. The Welcome to Android Studio window displays and you're ready to start creating
apps.

The SDK Manager:


The Android SDK Manager helps you download the SDK tools, platforms, and other
components you need to develop your apps. Once downloaded, you can find each
package in the directory indicated as the Android SDK Location, shown in figure.

To open the SDK Manager from Android Studio, click Tools > SDK Manager or

click SDK Manager in the toolbar.


When an update is
available for a package
you already have, a

dash appears in
the check box next to
the package.
To update an item or
install a new one, click
the check box so it
shows a checkmark.
To uninstall a package,
click to clear the check
box.

To update the selected


packages,
click APPLY or OK,
then agree to any
license agreements.
18 | Page
Mobile Application Development (4350703)

Recommended packages:
You should give special consideration to the following tools in the SDK Tools tab:
• ANDROID SDK BUILD-TOOLS
• REQUIRED. Includes tools to build Android apps.
• Android SDK Platform-Tools
• REQUIRED. Includes various tools required by the Android
platform, including the adb tool.
• ANDROID SDK TOOLS
• REQUIRED. Includes essential tools such as ProGuard.

Run apps on the Android Emulator:


The Android Emulator simulates Android devices on your computer so that you can test
your application on a variety of devices and Android API levels without needing to have
each physical device.
The emulator provides almost all of the capabilities of a real Android device. You can
simulate incoming phone calls and text messages, specify the location of the device,
simulate different network speeds, simulate rotation and other hardware sensors, access
the Google Play Store, and much more.
Testing your app on the emulator is in some ways faster and easier than doing so on a
physical device. For example, you can transfer data faster to the emulator than to a
device connected over USB.
The emulator comes with predefined configurations for various Android phone, tablet,
Wear OS, and Android TV devices.

Create and manage virtual devices:


An Android Virtual Device (AVD) is a configuration that defines the characteristics of an
Android phone, tablet, Wear OS, or Android TV device that you want to simulate in
the Android Emulator. The AVD Manager is an interface you can launch from Android
Studio that helps you create and manage AVDs.
To open the AVD Manager, do one of the following:
• Select Tools > AVD Manager.

• Click AVD Manager in the toolbar.

About AVDs:
An AVD contains a hardware profile, system image, storage area, skin, and other
properties. We recommend that you create an AVD for each system image that your app
could potentially support based on the<uses-sdk> setting in your manifest.

19 | Page
Mobile Application Development (4350703)

Create an AVD
To create a new AVD:

1. Open the AVD


Manager by
clicking Tools >
AVD Manager.
2. Click CREATE
VIRTUAL DEVICE,
at the bottom of
the AVD Manager
dialog.
3. The Select
Hardware page
appears.
4. Select a hardware
profile, and then click NEXT.
5. If you don't see the hardware profile you want, than you can create or import a
hardware profile.
6. The System Image page appears.

7. Select the system image for a particular API level, and then click NEXT.
8. The RECOMMENDED tab lists recommended system images. The other tabs include
a more complete list. The right pane describes the selected system image. x86
images run the fastest in the emulator.
9. If you see DOWNLOAD next to the system image, you need to click it to download
the system image. You must be connected to the internet to download it.
10. The API level of the target device is important, because your app won't be able to run
on a system image with an API level that's less than that required by your app, as
specified in the minSdkVersion attribute of the app manifest file.
20 | Page
Mobile Application Development (4350703)

11. The Verify Configuration page appears.


12. Change AVD properties as needed, and then click FINISH.

13. Click SHOW ADVANCED SETTINGS to show more settings, such as the skin.
14. The new AVD appears in the Your Virtual Devices page or the Select Deployment
Target dialog.

To run the application on Device:


To let Android Studio communicate with your Android device, you must enable USB
debugging in the Developer options settings of the device.
To show developer options and enable
USB debugging:
• On your Android device, tap Settings >
About phone.
• Tap Build number seven times.
• If prompted, enter your device
password or pin. You know you
succeeded when you see a You
are now a developer! message.

• Return to Settings and then
tap System > Developer
options.

• If you don't see Developer
options, tap Advanced options.

• Tap Developer options and
then tap the USB debugging
toggle to turn it on.

21 | Page
Mobile Application Development (4350703)

Install the Google USB Driver (Windows only)


If you installed Android Studio on Windows, you must install a USB device driver
before you can run your app on a physical device.
• In Android Studio, click Tools > SDK Manager. The Preferences > Appearance &
Behavior > System Settings > Android SDK dialog opens.
• Click the SDK Tools tab.
• Select Google USB Driver and then click OK.

When done, the driver files are downloaded into the


android_sdk\extras\google\usb_driver directory.Now you can connect and run
your app from Android Studio.
Run your app on the Android device with a cable
There are two ways to connect your device to Android Studio, through a cable or through
Wi-Fi. You can choose whichever you like more.
To run your app from Android Studio
on your Android device:

1. Connect your Android device to


your computer with a USB cable.
A dialog should appear on your
device, which asks you to allow
USB debugging.
2. Select the ALWAYS ALLOW FROM THIS COMPUTER checkbox and then tap OK.

22 | Page
Mobile Application Development (4350703)

3. In Android Studio on your computer, make sure your device is selected in the

dropdown. Click .

4. Select your device and then click OK. Android Studio installs the app on your
device and runs it.
5. If your device runs an Android platform that isn't installed in Android Studio
and you see a message that asks whether you want to install the needed
platform, click INSTALL > CONTINUE > FINISH. Android Studio installs the app
on your device and runs it.
Run your app on the Android device with Wi-Fi:
If you don't have a cable, you can also connect and run your app on your device with Wi-
Fi.

Get started:
1. Ensure that your computer and device are connected to the same wireless
network.
2. Ensure that your device runs Android 11 or higher. For more information,
see Check & update your Android version.
3. Ensure that your computer has the latest version of Android Studio. To
download it, see Android Studio.
4. Ensure that your computer has the latest version of the SDK Platform Tools.

Pair your device


1. In Android Studio, select PAIR DEVICES USING WI-FI from the run

configurations drop-down menu.


2. The PAIR DEVICES OVER WI-FI dialog opens.

23 | Page
Mobile Application Development (4350703)

3. Go to DEVELOPER
OPTIONS, scroll down
to
the DEBUGGING section
and turn on WIRELESS
DEBUGGING.

4. On the ALLOW
WIRELESS DEBUGGING
ON THIS
NETWORK? popup,
select ALLOW.

5. If you want to pair your


device with a QR code,
select PAIR DEVICE
WITH QR CODE and then scan the QR code on your computer. Alternatively, if
you want to pair your device with a pairing code, select PAIR DEVICE WITH
PAIRING CODE and then enter the 6-digit code.
6. Click run and you can deploy your app to your device.

24 | Page
Mobile Application Development (4350703)

I. Assessment-Rubrics
Assessment Criteria Obtained
Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

25 | Page
Mobile Application Development (4350703)

Practical No. 2
Understanding of Various Components available in Android Application

A. Objective:
This practical will help student to understand the basic components of
Android application. The understanding of the Android components will be
helpful to the students for the application of appropriate components while
developing the Android application.

B. Expected Program Outcomes (POs)


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:


The practical is expected to develop the following skills for Android mobile
application development.
• Critical thinking and Problem-solving.
D. Expected Course Outcomes (COs)
• Develop Android applications using Android application Components and
Life Cycle of Activity after setting up Android Development Environment.

E. Practical Outcome (PROs)


• To understand the Android application components.

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.

26 | Page
Mobile Application Development (4350703)

G. Prerequisite Theory:
Application components are the essential building blocks of an Android
application. These components are loosely coupled by the application
manifest file AndroidManifest.xml that describes each component of the
application and how they interact.

There are following four main components that can be used within an
Android application:

Sr Components & Description

Activities:
1 They dictate the UI and handle the user interaction to the smart
phone screen.

Services:
2 They handle background processing associated with an
application.

Broadcast Receivers:
3 They handle communication between Android OS and
applications.

Content Providers:
4
They handle data and database management issues.

Activities:
An activity represents a single screen with a user interface, in-short Activity
performs actions on the screen. For example, an email application might have
one activity that shows a list of new emails, another activity to compose an
email, and another activity for reading emails. If an application has more than
one activity, then one of them should be marked as the activity that is
presented when the application is launched.
• An activity is implemented as a subclass of Activity class as follows −
public class MainActivity extends Activity {
}
Services:
A service is a component that runs in the background to perform long-running
operations. For example, a service might play music in the background while

27 | Page
Mobile Application Development (4350703)

the user is in a different application, or it might fetch data over the network
without blocking user interaction with an activity.
• A service is implemented as a subclass of Service class as follows −
public class MyService extends Service {
}
Broadcast Receivers:
Broadcast Receivers simply respond to broadcast messages from other
applications or from the system. For example, applications can also initiate
broadcasts to let other applications know that some data has been
downloaded to the device and is available for them to use, so this is broadcast
receiver who will intercept this communication and will initiate appropriate
action.
• A broadcast receiver is implemented as a subclass
of BroadcastReceiver class and each message is broadcaster as
an Intent object.
public class MyReceiver extends BroadcastReceiver {
public void onReceive(Context, Intent){}
}
Content Providers:
A content provider component supplies data from one application to others
on request. Such requests are handled by the methods of
the ContentResolver class. The data may be stored in the file system, the
database or somewhere else entirely.
• A content provider is implemented as a subclass of ContentProvider class
and must implement a standard set of APIs that enable other applications
to perform transactions.
public class MyContentProvider extends
ContentProvider {
public void onCreate(){}
}
We will go through these tags in detail while covering application components
in individual chapters.
Additional Components
There are additional components which will be used in the construction of
above-mentioned entities, their logic, and wiring between them. These
components are:

28 | Page
Mobile Application Development (4350703)

Sr. No Components & Description

Fragments:
1
Represents a portion of user interface in an Activity.

Views:
2 UI elements that are drawn on-screen including buttons, lists
forms etc.

Layouts:
3 View hierarchies that control screen format and appearance of
the views.

Intents:
4
Messages wiring components together.

Resources:
5 External elements, such as strings, constants and drawable
pictures.

Manifest:
6
Configuration file for the application.

H. Practical related Quiz.


Give some quiz related to experiment which is useful to assess them with
space in between question.
I. References
• https://www.tutorialspoint.com/android/android_application_component
s.htm
• https://developer.android.com/training/basics/firstapp

J. Assessment-Rubrics

Assessment Criteria Obtained


Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

29 | Page
Mobile Application Development (4350703)

Practical No.3
Develop a “Hello World” Application in Android.

A. Objective:

After performing the practical, students will be able to understand the


structure of android application, write simple code for “Hello World”
application and test it on AVD.

B. Expected Program Outcomes (POs)


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Develop Android applications using Android application Components and
Life Cycle of Activity after setting up Android Development Environment.

E. Practical Outcomes (PROs)


• Develop a basic Android application to display a message

F. Expected Affective domain Outcomes (ADOs)

30 | Page
Mobile Application Development (4350703)

• Work as an Android Application Developer.


• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

An android application is usually consists of one or more activities, similar to


web pages in web application, that are loosely bound to each other. In
Android, an activity is made up of a UI component that is to be implemented
with the help of xml file, for example: activity_main.xml and a class
component that is to be implemented with the help of java file for example,
MainActivity.java.

Each activity is given a window in which to draw its user interface. Activities
use Views like TextView, Button etc. to form graphical user interfaces that
display information and interact with user actions. In this practical to display
the text “Hello World”, it only requires one TextView with “Hello World” as its
text property value.

Typically, one activity in an application is specified as the "main" activity,


which is presented to the user when the application is launched. Each activity
can then start another activity in order to perform different actions. If you
have worked with C, C++ or Java programming language then you must have
seen that your program starts from main() function. Very similar way, Android
application initiates its execution by running Main Activity with a call to its
onCreate() method.
Following are the steps to create a “Hello World” android application:
In this lab, you create an Android app with the EMPTY ACTIVITY project
template provided by Android Studio.

To create a project in Android Studio:


1. Double click the Android Studio icon to launch Android Studio.
2. In the Welcome to Android Studio dialog, click New Project.

31 | Page
Mobile Application Development (4350703)

The New Project window opens with a list of templates provided by Android
Studio.
In Android Studio, a project template is an Android project that provides the
blueprint for a certain type of app. Templates create the structure of the
project and the files needed for Android Studio to build your project. The
template that you choose provides starter code to get you going faster.
3. Make sure the Phone and Tablet tab is selected.
4. Click the Empty Activity template to select it as the template for your
project. The Empty Activity template is the template to create a simple
project that you can use to build a compose application. It has a single
screen and displays the text "Hello Android!".

5. Click Next. The New Project dialog opens. This has some fields to
configure your project.
6. Configure your project as follows:
7. The Name field is used to enter the name of your project, for this code lab
type "Greeting Card".

Leave the Package name field as it is. This is how your files will be organized
in the file structure. In this case, the package name will
be com.example.greetingcard.

Leave the Save location field as it is. It contains the location where all the files
related to your project are saved. Take a note of where that is on your
computer so that you can find your files.

32 | Page
Mobile Application Development (4350703)

Select whichever version you would like to select from the menu in
the Minimum SDK field. Minimum SDK indicates the minimum version of
Android that your app can run on.

8. Click Finish. This may take a while. While Android Studio is setting up, a
progress bar and message indicates whether Android Studio is still setting
up your project. It may look like this:

A message that looks similar to this informs you when the project set up is
created.

9. Click Split on the top right of Android Studio, this allows you to view both
code and design. You can also click Code to view code only or
click Design to view design only.

33 | Page
Mobile Application Development (4350703)

After pressing Split you should see three areas:

• The Project view (1) shows the files and folders of your project.
• The Code view (2) is where you edit code.
• The Design view (3) is where you preview what your app looks like.

In the Design view, you will see a blank pane with this text:

10. Click BUILD & REFRESH. It may take a while to build but when it is done
the preview shows a text box that says "HELLO ANDROID!". Empty
Compose activity contains all the code necessary to create this app.

34 | Page
Mobile Application Development (4350703)

H. Resources/Equipment Required

Sr.No. Instrument/Equipment
Specification
/Components/Trainer kit
Processor: x86_64 CPU architecture
1 Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2 Android Studio Version : Latest Version

I. Application Code

Layout Code (xml file)

35 | Page
Mobile Application Development (4350703)

Source Code (java file)

J. Output

36 | Page
Mobile Application Development (4350703)

K. Practical related Quiz


1. In which directory XML layout files are stored?
a) /assets
b) /src
c) /res/values
d) /res/layout

2. In which directory the java source file of activity is stored?


a) /assets
b) /src
c) /res/values
d) /res/layout

3. Which programming language is used for android application


development?
a) PHP
b) Java
c) NodeJs
d) Visual Basic

4. Which method is used to display user interface content of an activity?


a) findViewById()
b) getUI()
c) setContentView()
d) displayInterface()

L. References
https://developer.android.com/training/basics/firstapp
https://www.tutorialspoint.com/android/android_hello_world_example.htm
https://www.javatpoint.com/hello-android-example

M. Assessment-Rubrics

Assessment Criteria Obtained


Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

37 | Page
Mobile Application Development (4350703)

Practical No.4
Develop Android Application to demonstrate methods of Activity Life Cycle.

A. Objective:

After performing the practical, students will be able to understand life cycle of
an activity and implement different methods that are being executed during
the activity life cycle.

B. Expected Program Outcomes (POs)


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Develop Android applications using Android application Components and
Life Cycle of Activity after setting up Android Development Environment.

E. Practical Outcomes (PROs)


• To demonstrate the function of Android Activity Life Cycle.

38 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory

The activity life cycle in Android refers to the set of states that an activity goes
through during its lifetime. Understanding the activity life cycle is essential for
building robust and responsive Android applications. The activity life cycle
consists of several callback methods that are invoked as an activity transitions
between different states.

39 | Page
Mobile Application Development (4350703)

1. onCreate(): This method is called when the activity is first created. It is


typically used for initialization tasks, such as setting up the user interface
(UI) using setContentView() and retrieving references to UI elements.
2. onStart(): This method is called when the activity becomes visible to the
user. At this point, the activity is in the foreground, but it may not be
interactable yet.
3. onResume(): This method is called when the activity is about to start
interacting with the user. It is the point at which the activity is active and
in the foreground.
4. onPause(): This method is called when the activity is partially visible to the
user or about to be paused. It is often used to release resources that are
not needed while the activity is not in the foreground.
5. onStop(): This method is called when the activity is no longer visible to the
user. It may be invoked, for example, when another activity is launched on
top of it.
6. onRestart(): This method is called when the activity is being restarted
after being stopped. It is followed by onStart().
7. onDestroy(): This method is called when the activity is being destroyed. It
is the final callback that an activity receives, and it is typically used to
release any resources that were allocated during the activity's life cycle.

Additionally, there are two methods related to handling configuration


changes, such as screen rotation:
• onSaveInstanceState(): This method is called before an activity is
destroyed, allowing you to save any relevant state information that you
want to restore later.
• onRestoreInstanceState(): This method is called after an activity has been
recreated and the saved state needs to be restored.

By implementing these callback methods, you can manage the behavior of


your activities throughout their life cycles, ensuring a smooth user experience
and proper resource management.

H. Resources/Equipment Required

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

40 | Page
Mobile Application Development (4350703)

I. Application Code

Layout Code (xml file)

Source Code (java file)

41 | Page
Mobile Application Development (4350703)

42 | Page
Mobile Application Development (4350703)

43 | Page
Mobile Application Development (4350703)

J. Output

K. Practical related Quiz.


1. Android activity life cycle begins with:
a) onStart()
b) onActivityCreated()
c) onCreate()
d) onActivityStarted()

2. Which method is called just before activity is destroyed?


a) onKill()
b) onDestroy()
c) onPause()
d) onStop()

44 | Page
Mobile Application Development (4350703)

3. Which of the activity life cycle methods is essential to be implemented?


a) onCreate()
b) onStart()
c) onBegin()
d) onDestroy()

4. Which activity life cycle method is called first when activity comes back to
foreground again?
a) onResume()
b) onRestart()
c) onStart()
d) onCreate()
5. Which is not valid activity life cycle state?
a) Running
b) Stopped
c) Printing
d) Paused

L. References
https://developer.android.com/guide/components/activities/activity-lifecycle
https://www.geeksforgeeks.org/activity-lifecycle-in-android-with-demo-app/
https://www.javatpoint.com/android-life-cycle-of-activity
https://www.tutorialspoint.com/android/android_acitivities.htm

M. Assessment-Rubrics

Assessment Criteria Obtained


Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

45 | Page
Mobile Application Development (4350703)

Practical No. 5
Design Android Activities using LinearLayout, RelativeLayout, GridLayout,
FrameLayou, and ConstraintLayout.

A. Objective:

After performing the practical, students will be able to design the Activity
using LinearLayout, RelativeLayout, GridLayout, FrameLayout, and
ConstraintLayout.

B. Expected Program Outcomes (POs)


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Design Activity using Layouts and Widgets

E. Practical Outcomes (PROs)


• Design activities using various Layouts and widgets available in Android.

46 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

LinearLayout:

LinearLayout is a layout manager in android that arranges its child views


either horizontally or vertically in a single line. It is one of the most commonly
used layout managers as it provides a simple and flexible way to organize
views within a container.

Key features and properties of LinearLayout:


1. Orientation: LinearLayout can be set to arrange its child views either
horizontally or vertically. The orientation can be set using the
android:orientation attribute in XML or programmatically using the
setOrientation() method.
2. Weight: LinearLayout supports the concept of weight to distribute the
available space among its child views. By assigning a weight to a child view
using the android:layout_weight attribute, you can define how much
space each child view should occupy relative to others.
3. Gravity: LinearLayout allows you to control the alignment and positioning
of its child views within the layout using the android:gravity attribute. It
specifies how the child views are aligned along the layout's axis (start,
center, end) and how they are aligned perpendicular to the layout's axis
(top, center, bottom).
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<!-- Child views go here -->

</LinearLayout>

RelativeLayout:

RelativeLayout is a layout manager in android that allows you to position child


views relative to each other or to the parent container. It provides a powerful
way to create complex and customized UI layouts.

Key features and properties of RelativeLayout:


1. Positioning: RelativeLayout allows you to position child views relative to
the parent container or relative to each other using various attributes.
Some commonly used attributes for positioning include

47 | Page
Mobile Application Development (4350703)

android:layout_alignParentTop, android:layout_alignParentBottom,
android:layout_alignParentStart, android:layout_alignParentEnd,
android:layout_alignStart, android:layout_alignEnd,
android:layout_above, android:layout_below, etc.
2. Alignment: RelativeLayout provides control over the alignment of child
views within the layout. You can use attributes like
android:layout_alignLeft, android:layout_alignRight,
android:layout_alignTop, android:layout_alignBottom,
android:layout_centerHorizontal, android:layout_centerVertical,
android:layout_centerInParent, etc., to align child views in relation to
each other or to the parent container.
3. Margins: RelativeLayout allows you to define margins around child views
using attributes such as android:layout_marginTop,
android:layout_marginBottom, android:layout_marginStart,
android:layout_marginEnd, android:layout_marginLeft,
android:layout_marginRight, etc. Margins help in creating spacing
between views and the parent container.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- Child views go here -->

</RelativeLayout>

Inside the RelativeLayout, you can define child views and set their positioning
attributes to position them relative to the parent container or relative to
other child views.

RelativeLayout is a versatile layout manager that allows for flexible and


precise positioning of views in Android UI layouts. It provides a wide range of
attributes to control the positioning and alignment of views, making it a
powerful tool for creating complex UI designs.

GridLayout:

GridLayout is a layout manager in Android that arranges its child views in a


grid-like structure of rows and columns. It provides a flexible way to create
grid-based UI layouts where each child view occupies a specified grid cell.

Key features and properties of GridLayout:


1. Rows and Columns: GridLayout divides the layout into a grid of rows and
columns. You can define the number of rows and columns using the
android:rowCount and android:columnCount attributes in XML or
programmatically using the setRowCount() and setColumnCount()
methods.
2. Cell Occupancy: Child views are placed within the grid cells of the
GridLayout. You can specify the starting row and column for each child
view using the android:layout_row and android:layout_column attributes.

48 | Page
Mobile Application Development (4350703)

The number of occupied rows and columns by a child view can also be
specified using android:layout_rowSpan and android:layout_columnSpan.
3. Alignment: GridLayout supports alignment options to control how child
views are positioned within their respective grid cells. Alignment
attributes such as android:layout_gravity, android:layout_rowGravity, and
android:layout_columnGravity can be used to define the gravity of child
views within their cells.
4. Margins: You can apply margins to child views in a GridLayout using
attributes like android:layout_marginTop, android:layout_marginBottom,
android:layout_marginStart, android:layout_marginEnd,
android:layout_marginLeft, android:layout_marginRight, etc. These
attributes allow you to create spacing between views and the grid cells.

<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:rowCount="3"
android:columnCount="3">

<!-- Child views go here -->

</GridLayout>

In the example above, GridLayout is set to have 3 rows and 3 columns. You
can adjust the number of rows and columns based on your layout
requirements.

Inside the GridLayout, you can define child views and use the layout-related
attributes to specify the position of each view within the grid.

GridLayout provides a convenient way to create grid-based UI layouts in


Android. It is especially useful for displaying grids of images, icons, or any
other components where a grid structure is desired.

FrameLayout:

FrameLayout is a simple layout manager in Android that allows you to stack


multiple child views on top of each other. It is designed to display a single
view at a time, with each subsequent view placed on top of the previous view.
FrameLayout is commonly used for simple tasks such as displaying fragments
or overlays.

Key features and properties of FrameLayout:


1. Order: Child views added to a FrameLayout are stacked in a way that the
last added view is placed on top of the previous views. This stacking order
is defined by the order in which views are added or by using the
android:layout_gravity attribute to control the placement of each view
within the FrameLayout.

49 | Page
Mobile Application Development (4350703)

2. Overlapping: Child views in a FrameLayout can overlap each other,


creating layering effects. By default, the views are placed in the top-left
corner, but you can adjust their positioning using attributes like
android:layout_gravity, android:layout_margin, etc.
3. Match Parent and Wrap Content: FrameLayout supports the
match_parent and wrap_content layout parameters, allowing you to
control the size of the FrameLayout itself and its child views.
4. Margins: You can apply margins to child views in a FrameLayout using
attributes like android:layout_marginTop, android:layout_marginBottom,
android:layout_marginStart, android:layout_marginEnd,
android:layout_marginLeft, android:layout_marginRight, etc. These
attributes allow you to create spacing between views and the
FrameLayout.

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- Child views go here -->

</FrameLayout>

Inside the FrameLayout, you can add multiple child views, and they will be
stacked in the order they are added.

FrameLayout is a lightweight and straightforward layout manager that serves


the purpose of displaying a single view or stacking multiple views on top of
each other. It is often used for simple tasks where view layering is required,
such as displaying fragments, overlays, or managing dynamic UI elements.

ConstraintLayout:

ConstraintLayout is a layout manager in android that allows you to create


complex and responsive UI designs. It offers a wide range of features and
capabilities for positioning and aligning child views relative to each other and
to the parent container.

Key features and properties of ConstraintLayout:


1. Constraint-based positioning: ConstraintLayout uses constraints to define
the position and alignment of child views. Constraints are connections
between views and between views and the parent container. You can
specify constraints in XML using attributes like
layout_constraintTop_toTopOf, layout_constraintBottom_toBottomOf,
layout_constraintStart_toStartOf, layout_constraintEnd_toEndOf, etc.
These attributes define the relationship and alignment of views.
2. Responsive design: ConstraintLayout provides powerful tools for creating
responsive UI designs that can adapt to different screen sizes and
orientations. You can set constraints to adjust dynamically based on

50 | Page
Mobile Application Development (4350703)

available space, using features like layout_constraintWidth_percent,


layout_constraintHeight_percent, layout_constraintDimensionRatio, etc.
3. Chains: ConstraintLayout allows you to create chains of views, both
horizontally and vertically, using attributes like
layout_constraintHorizontal_chainStyle and
layout_constraintVertical_chainStyle. Chains enable you to create flexible
layouts where views can distribute available space evenly.
4. Guidelines: ConstraintLayout supports guidelines, which are invisible lines
that you can use for alignment and positioning. Guidelines can be set to
either horizontal or vertical orientation and can be positioned using
attributes like layout_constraintGuide_begin,
layout_constraintGuide_end, layout_constraintGuide_percent, etc.
5. Margins: You can apply margins to child views in a ConstraintLayout using
attributes like android:layout_marginTop, android:layout_marginBottom,
android:layout_marginStart, android:layout_marginEnd,
android:layout_marginLeft, android:layout_marginRight, etc. These
attributes allow you to create spacing between views and the
ConstraintLayout.
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- Child views go here -->

</androidx.constraintlayout.widget.ConstraintLayout>

Inside the ConstraintLayout, you can add child views and set their constraints
using various layout-related attributes.

ConstraintLayout provides extensive capabilities for creating flexible,


responsive, and complex UI layouts in Android. It is suitable for a wide range
of applications and is particularly useful when designing UIs that need to
adapt to different screen sizes and orientations.

H. Resources/Equipment Required

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

51 | Page
Mobile Application Development (4350703)

I. Application Code:
LinearLayout:
Layout Code (xml file)

52 | Page
Mobile Application Development (4350703)

Source Code (java file)

LinearLayout Output:

53 | Page
Mobile Application Development (4350703)

RelativeLayout:
Layout Code (xml file)

54 | Page
Mobile Application Development (4350703)

Source Code (java file)

RelativeLayout Output:

55 | Page
Mobile Application Development (4350703)

GridLayout:
Layout Code (xml file)

56 | Page
Mobile Application Development (4350703)

Source Code (java file)

GridLayout Output:

57 | Page
Mobile Application Development (4350703)

FrameLayout:
Layout Code (xml file)

58 | Page
Mobile Application Development (4350703)

Source Code (java file)

FrameLayout Output:

59 | Page
Mobile Application Development (4350703)

ConstraintLayout:
Layout Code (xml file)

60 | Page
Mobile Application Development (4350703)

Source Code (java file)

ConstraintLayout Output:

61 | Page
Mobile Application Development (4350703)

J. Practical related Quiz:


1. The android component that manages the appearance and visual structure
on screen is called:
a) view
b) layout
c) fragment
d) intent

2. A type of layout that allow all included element in order is :


a) FrameLayout
b) LinearLayout
c) AbsoluteLayout
d) RelativeLayout

3. A type of layout that allow user interface elements to have position


relatively is :
a) RelativeLayout
b) GridLayout
c) LinearLayout
d) FrameLayout

4. A layout that arranges its UI elements in rows and columns is :


a) RelativeLayout
b) GridLayout
c) LinearLayout
d) FrameLayout

K. References
https://developer.android.com/develop/ui/views/layout/declaring-layout
https://www.geeksforgeeks.org/android-ui-layouts/
https://www.tutorialspoint.com/android/android_user_interface_layouts.htm

L. Assessment-Rubrics

Assessment Criteria Obtained


Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

62 | Page
Mobile Application Development (4350703)

Practical No.6
Design various Activities using different Layouts and available widgets (TextView,
EditText, Button, RadioButton, CheckBox, ImageButton, ToggleButton, TimePicker,
DatePicker, ProgressBar, ImageView) to make the user-friendly GUI.

A. Objective:

After performing the practical, students will be able to Design various


Activities using different Layouts and available Widgets.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs):


• Design Activity using Layouts and Widgets.

E. Practical Outcomes (PROs):


• Design activities using various Layouts and widgets available in Android.

63 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs):


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

Android widgets are the interactive components in android application's user


interface. Android provides a wide variety of widgets/views, you can use in
User Interface, such as text fields, buttons, seek bars, check box, zoom
buttons, toggle buttons and many more.

Android UI Widgets/Controls

There are number of UI controls provided by Android that allow you to build
the graphical user interface for your app.
Sr. UI Widget Description
No.
1 TextView This control is used to display text to the user.
EditText EditText is a predefined subclass of TextView that
2
includes rich editing capabilities.
The AutoCompleteTextView is a view that is
similar to EditText, except that it shows a list of
3 AutoCompleteTextView
completion suggestions automatically while the
user is typing.
A push-button that can be pressed, or clicked, by
4 Button
the user to perform an action.
An ImageButton is an AbsoluteLayout which
ImageButton enables you to specify the exact location of its
5 children. This shows a button with an image
(instead of text) that can be pressed or clicked by
the user.
An on/off switch that can be toggled by the user.
CheckBox
You should use check box when presenting users
6
with a group of selectable options that are not
mutually exclusive.
7 ToggleButton An on/off button with a light indicator.

64 | Page
Mobile Application Development (4350703)

The RadioButton has two states: either checked


8 RadioButton
or unchecked.
A RadioGroup is used to group together one or
9 RadioGroup
more RadioButtons.
ProgressBar The ProgressBar view provides visual feedback
10 about some ongoing tasks, such as when you are
performing a task in the background.
A drop-down list that allows users to select one
11 Spinner
value from a set.
TimePicker The TimePicker view enables users to select a
12 time of the day, in either 24-hour mode or
AM/PM mode.
The DatePicker view enables users to select a
13 DatePicker
date of the day.

To create a UI Control/View/Widget you will have to define a widget/ view in


the layout file and assign it a unique ID as follow :
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/text_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I am a TextView" />

</LinearLayout>

Then you can create an object of the widget control and capture it from the
layout, using the following code:

myText = (TextView) findViewById(R.id.text_id);

Once you have the widget control in object form, you can manipulate it like
setting text or getting text as follow:

String data = myText.getText().toString();

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : 2022.2.1.20

65 | Page
Mobile Application Development (4350703)

I. Application Code:
First Activity:
Layout Code (xml file)

66 | Page
Mobile Application Development (4350703)

67 | Page
Mobile Application Development (4350703)

Source Code (java file)

First Activity Output:

68 | Page
Mobile Application Development (4350703)

Second Activity:
Layout Code (xml file)

69 | Page
Mobile Application Development (4350703)

70 | Page
Mobile Application Development (4350703)

Source Code (java file)

Second Activity Output:

71 | Page
Mobile Application Development (4350703)

J. Practical related Quiz:


1. What is the purpose of the findViewById() method in Android?
a) It is used to retrieve a reference to a View object based on its ID.
b) It is used to set the ID of a View object programmatically.
c) It is used to define the layout of a View object in XML.
d) It is used to handle click events for a View object.

2. Which method is used to programmatically set the text of a TextView in


Android?
a) setText()
b) setTextColor()
c) setCaption()
d) setContent()

3. Which Android UI control is used to capture user input as a series of


characters?
a) TextView
b) TextInputLayout
c) CheckBox
d) EditText

4. Can a button click listener be defined directly in XML?


a) No, it can only be defined programmatically.
b) Yes, using the onClick attribute.
c) It depends on the version of the Android SDK.
d) Only for certain types of buttons.

K. References:
https://developer.android.com/develop/ui
https://data-flair.training/blogs/android-ui-controls/
https://www.tutorialspoint.com/android/android_user_interface_controls.ht
m

L. Assessment-Rubrics

Assessment Criteria Obtained


Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date


72 | Page
Mobile Application Development (4350703)

Practical No.7
Develop code to demonstrate different ways of handling different events over
Button, EditText etc. to perform action in android application at run-time.

A. Objective:

After performing the practical, students will be able to understand event


handling mechanism in android and implement different ways of handling
different events over widgets to perform action in android application at run-
time.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs):


• Apply Event Handling in Android application to perform user actions.

E. Practical Outcomes (PROs):


• To handle different events over widgets in Android.

73 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs):


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

In Android, there are different ways to handle different events based on the
type of event and the desired behavior. Here are some common event
handling mechanisms and their corresponding ways of implementation:

1. Button Click Event:


• Set an OnClickListener on a Button object and implement the onClick()
method to define the actions to be performed when the button is clicked.

Button myButton = findViewById(R.id.my_button);


myButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Actions to be performed when the button is clicked
}
});

2. Touch Event:
• Set an OnTouchListener on a View object and implement the onTouch()
method to handle different touch events like touch down, touch up, or
touch move.
ImageViewmyImage = findViewById(R.id.my_image);
myImage.setOnTouchListener(new View.OnTouchListener() {
@Override
public booleanonTouch(View v, MotionEvent event) {
// Actions to be performed based on touch events
return true;
}
});

3. Text Change Event:


• Implement the TextWatcher interface by overriding its methods
beforeTextChanged(), onTextChanged() and afterTextChanged() to handle
text changes in an EditText view.
EditTextmyEditText = findViewById(R.id.my_edittext);
myEditText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int
start, int count, int after) {
// Actions to be performed before text is changed
}

74 | Page
Mobile Application Development (4350703)

@Override
public void onTextChanged(CharSequence s, int start,
int before, int count) {
// Actions to be performed while text is changing
}

@Override
public void afterTextChanged(Editable s) {
// Actions to be performed after text has changed
}
});

4. Item Click Event (ListView, GridView, etc.):


• Set an AdapterView.OnItemClickListener on the ListView, GridView and
implement the onItemClick() method to handle item clicks.
ListViewmyListView = findViewById(R.id.my_listview);
myListView.setOnItemClickListener(new
AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// Actions to be performed when an item is clicked
}
});

These are just a few examples of handling different events in Android using
specific event handling mechanisms. Depending on your application's
requirements, you may need to use other mechanisms or implement custom
event handling logic to handle events such as sensor events, broadcast
events, or gestures.

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

75 | Page
Mobile Application Development (4350703)

I. Application Code:

Layout Code (xml file)

76 | Page
Mobile Application Development (4350703)

77 | Page
Mobile Application Development (4350703)

Source Code (java file)

78 | Page
Mobile Application Development (4350703)

J. Output:

79 | Page
Mobile Application Development (4350703)

K. Practical related Quiz.


1. Which interface is used to handle button click events in Android?
a) OnClickListener
b) OnTouchListener
c) TextWatcher
d) SensorEventListener
2. Which method of the TextWatcher interface is called before the text is
changed?
a) onTextChanged()
b) beforeTextChanged()
c) afterTextChanged()
d) beforeTextChange()
3. How do you set an OnClickListener on a Button in Android?
a) button.setClickListener()
b) button.setOnClickListener()
c) button.setOnClick()
d) button.setListener()
4. How do you handle item click events in a ListView in Android?
a) listView.setOnItemClickListener()
b) listView.setItemClickListener()
c) listView.setClickListener()
d) listView.setOnClickItemListener()
5. Which event handling mechanism is used to handle touch events in
Android?
a) OnClickListener
b) OnTouchListener
c) TextWatcher
d) SensorEventListener
L. References / Suggestions ( lab manual designer should give)
https://developer.android.com/topic/architecture/ui-layer/events
https://www.geeksforgeeks.org/event-handling-in-android/
https://www.tutorialspoint.com/android/android_event_handling.htm
https://data-flair.training/blogs/android-event-handling/
M. Assessment-Rubrics
Assessment Criteria Obtained
Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

80 | Page
Mobile Application Development (4350703)

Practical No.8
Develop code to demonstrate Event handling of CheckBox and RadioButton
selection.

A. Objective:

After performing the practical, students will be able to implement event


handling of the Checkbox and RadioButton.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Apply Event Handling in Android application to perform user actions.

E. Practical Outcomes (PROs)


• To implement Event handling of CheckBox and RadioButton

81 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

Event handling for CheckBox and RadioButton in Android involves capturing


and responding to changes in the checked state of these UI components.
Here's how you can handle events for CheckBox and RadioButton:

1. CheckBox:
• Identify the CheckBox view in your layout XML file or programmatically
create an instance of the CheckBox class.
• Set an OnCheckedChangeListener on the CheckBox object using the
setOnCheckedChangeListener() method.
• Implement the onCheckedChanged() method of the
OnCheckedChangeListener to handle changes in the checked state of the
CheckBox.

CheckBoxmyCheckBox = findViewById(R.id.my_checkbox);
myCheckBox.setOnCheckedChangeListener(new
CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged
(CompoundButtonbuttonView, Boolean isChecked) {
// Actions to be performed when the checkbox is
checked/unchecked
if (isChecked) {
// Checkbox is checked
} else {
// Checkbox is unchecked
}
}
});

2. RadioButton:
• Create a RadioGroup in your layout XML file and add RadioButton views as
child elements.
• Set an OnCheckedChangeListener on the RadioGroup object using the
setOnCheckedChangeListener() method.
• Implement the onCheckedChanged() method of the
OnCheckedChangeListener to handle changes in the checked state of the
RadioButtons.

RadioGroupradioGroup = findViewById(R.id.radio_group);
radioGroup.setOnCheckedChangeListener(new
RadioGroup.OnCheckedChangeListener() {
@Override

82 | Page
Mobile Application Development (4350703)

public void onCheckedChanged(RadioGroup group, int


checkedId) {
// Actions to be performed when a radio button
is checked
if (checkedId == R.id.radio_button1) {
// RadioButton 1 is checked
} else if (checkedId == R.id.radio_button2) {
// RadioButton 2 is checked
}
// Add more conditions for other RadioButtons
if needed
}
});

In the case of a RadioButton, it is essential to enclose them within a


RadioGroup to enforce the single-selection behavior.

By implementing these event handling mechanisms, you can perform specific


actions when a CheckBox is checked or unchecked, or when a RadioButton is
selected within a RadioGroup.

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

I. Application Code:

Layout Code (xml file)

83 | Page
Mobile Application Development (4350703)

84 | Page
Mobile Application Development (4350703)

Source Code (java file)

85 | Page
Mobile Application Development (4350703)

J. Output:

86 | Page
Mobile Application Development (4350703)

K. Practical related Quiz.


1. Which listener interface is used to handle changes in the checked state of
a CheckBox in Android?
a) OnCheckedChangeListener
b) OnClickListener
c) OnTouchListener
d) TextWatcher
2. How do you set an OnCheckedChangeListener on a CheckBox in Android?
a) checkBox.setClickListener()
b) checkBox.setOnClickListener()
c) checkBox.setOnCheckedChangeListener()
d) checkBox.setListener()
3. Which method is invoked when the checked state of a CheckBox changes
using an OnCheckedChangeListener?
a) onCheckedChanged()
b) onClick()
c) onTouch()
d) afterTextChanged()
4. How do you handle changes in the selected RadioButton within a
RadioGroup in Android?
a) radioGroup.setClickListener()
b) radioGroup.setOnCheckedChangeListener()
c) radioButton.setOnClickListener()
d) radioButton.setOnCheckedChangeListener()
L. References:
https://developer.android.com/develop/ui/views/components/radiobutton
https://www.geeksforgeeks.org/radiobutton-in-android/
https://data-flair.training/blogs/android-radiobutton/
https://www.studytonight.com/android/radiogroup-radiobutton-checkbox
https://www.javatpoint.com/android-radiobutton
M. Assessment-Rubrics
Assessment Criteria Obtained
Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date


87 | Page
Mobile Application Development (4350703)

Practical No.9
Develop code to navigate between different activities and pass the data from one
activity to other activity using Intent.

A. Objective:

After performing the practical, students will be able to implement the


navigation from one activity to another as well as passing data between them.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Apply Event Handling in Android application to perform user actions.

E. Practical Outcomes (PROs)


• To navigate between different activities and pass the data between
activities using Intent.

88 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

To navigate between different activities and pass data from one activity to
another in Android, you can use the Intent mechanism. Here's an example
that demonstrates how to achieve this:

1. Create two activities: ActivityA and ActivityB.

2. In ActivityA, when a button is clicked or any other event occurs that


triggers the navigation to ActivityB, create an Intent and pass any
necessary data as extras.
Intent intent = new Intent(ActivityA.this, ActivityB.class);
intent.putExtra("key", value); // Pass the data as extras
(key-value pairs)
startActivity(intent); // Start ActivityB

Here, "key" represents the key under which the data is passed, and "value"
represents the actual data you want to pass. You can use different keys for
different data items.

3. In ActivityB, retrieve the passed data from the Intent in the onCreate()
method.
Intent intent = getIntent();
if (intent != null) {
String data = intent.getStringExtra("key"); // Retrieve
the data using the key
// Use the retrieved data as needed
}

Here, "key" should match the key used in ActivityA to pass the data.

4. You can also pass other data types using different methods such as
getIntExtra(), getBooleanExtra(), etc., depending on the data type you
want to retrieve.
int intValue = intent.getIntExtra("intKey", defaultValue);
booleanboolValue = intent.getBooleanExtra("boolKey",
defaultValue);
// Retrieve other data types as needed

Make sure to provide default values that will be used if the data is not found
or if there is an issue with the data type.

89 | Page
Mobile Application Development (4350703)

H. Resources/Equipment Required

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

I. Application Code:
ActivityA:
Layout Code (xml file)

90 | Page
Mobile Application Development (4350703)

91 | Page
Mobile Application Development (4350703)

Source Code (java file)

ActivityA Output:

92 | Page
Mobile Application Development (4350703)

ActivityB:
Layout Code (xml file)

93 | Page
Mobile Application Development (4350703)

Source Code (java file)

ActivityB Output:

94 | Page
Mobile Application Development (4350703)

J. Practical related Quiz.


1. Which mechanism is used to navigate from one activity to another in
Android?
a) OnClickListener
b) Intent
c) Bundle
d) BroadcastReceiver

2. How do you pass data from ActivityA to ActivityB using an Intent?


a) activityB.putData("key", value)
b) intent.putExtra("key", value)
c) activityB.getData("key")
d) intent.getData("key")

3. How do you retrieve the passed data in ActivityB?


a) getIntent().getStringExtra("key")
b) getPassedData().getStringExtra("key")
c) getActivityData().getStringExtra("key")
d) getIntent().getExtra("key")

4. What should you do if the retrieved data is not found or if there is an issue
with the data type?
a) Ignore the data and continue execution.
b) Throw an exception and terminate the application.
c) Provide default values or handle the error gracefully.
d) Retry retrieving the data until it is available.
K. References:
https://developer.android.com/guide/components/intents-filters
https://www.geeksforgeeks.org/what-is-intent-in-android/
https://www.tutorialspoint.com/what-is-an-intent-in-android
https://www.javatpoint.com/android-intent-tutorial
L. Assessment-Rubrics
Assessment Criteria Obtained
Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

95 | Page
Mobile Application Development (4350703)

Practical No. 10
Develop an android application to store data locally using SharedPreferences and
access, modify in different activities.

A. Objective:

After performing the practical, students will be able to understand the


SharedPreferences and implement it to store data locally, and access, modify
these stored data in different activities.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs):


• Apply Event Handling in Android application to perform user actions.

E. Practical Outcomes (PROs):


• To managelocal data using SharedPreferences of the Application.

96 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs):


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

In android, data can be stored locally and stored data can be access, modify in
different activities using SharedPreferences.

1. Storing Data:
• In the activity where you want to store the data, create an instance of
SharedPreferences using the getSharedPreferences() method.
• Retrieve the SharedPreferences editor using the edit() method.
• Use the editor's methods e.g., putString(), putInt(), putBoolean() to store
the data.
• Call the apply() or commit() method to save the changes.

// Storing data in ActivityA


SharedPreferences sharedPreferences =
getSharedPreferences("MyPrefs",
Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("username", "John");
editor.putInt("age", 25);
editor.apply();

2. Accessing/Modifying Data:
• In another activity e.g., ActivityB where you want to access or modify the
stored data, retrieve the SharedPreferences instance using
getSharedPreferences().
• Use the SharedPreferences object to retrieve the stored data using
methods like getString(), getInt(), getBoolean().
• Modify the data if needed using the editor obtained from the
SharedPreferences object.
• Call apply() or commit() to save the modifications.

// Accessing/modifying data in ActivityB


SharedPreferences sharedPreferences =
getSharedPreferences("MyPrefs",
Context.MODE_PRIVATE);
String username = sharedPreferences.getString("username", "");
int age = sharedPreferences.getInt("age", 0);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("username", username + " Doe");
editor.putInt("age", age + 1);
editor.apply();

97 | Page
Mobile Application Development (4350703)

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

I. Application Code:
ActivityA:
Layout Code (xml file)

98 | Page
Mobile Application Development (4350703)

Source Code (java file)

ActivityA Output:

99 | Page
Mobile Application Development (4350703)

ActivityB:
Layout Code (xml file)

100 | Page
Mobile Application Development (4350703)

Source Code (java file)

ActivityB Output:

101 | Page
Mobile Application Development (4350703)

J. Practical related Quiz.


1. Which method is used to obtain an instance of SharedPreferences in
Android?
a) getSharedPreferences()
b) getIntent()
c) startActivity()
d) getApplicationContext()

2. How data can be stored in SharedPreferences?


a) sharedPreferences.saveData(key, value)
b) sharedPreferences.edit().putString(key, value).commit()
c) sharedPreferences.putString(key, value)
d) sharedPreferences.storeData(key, value)

3. How data can be retrieved from SharedPreferences?


a) sharedPreferences.getData(key)
b) sharedPreferences.retrieveString(key)
c) sharedPreferences.getString(key, defaultValue)
d) sharedPreferences.getStoredData(key)

4. How the stored data in SharedPreferences can be modified?


a) sharedPreferences.putData(key, newValue)
b) sharedPreferences.edit().putString(key, newValue).apply()
c) sharedPreferences.modifyData(key, newValue)
d) sharedPreferences.updateString(key, newValue)
K. References:
https://developer.android.com/training/data-storage/shared-preferences
https://www.geeksforgeeks.org/shared-preferences-in-android-with-
examples/
https://www.tutorialspoint.com/android/android_shared_preferences.htm
https://www.javatpoint.com/android-preferences-example
L. Assessment-Rubrics
Assessment Criteria Obtained
Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

102 | Page
Mobile Application Development (4350703)

Practical No.11
Develop the code to implement the ListView and the Spinner views, perform add,
update, remove items operations, and implement the item selection event handling
over ListView and Spinner for appropriate example.

A. Objective:

After performing the practical, students will be able to understand and


implement the ListView and the Spinner views, perform add, update, remove
item operations and implement the event handling on these views.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving
D. Expected Course Outcomes (COs):
• Apply Event Handling in Android application to perform user actions.

E. Practical Outcomes (PROs):


• To implement the ListView and the Spinner views, perform add, update,
remove items operations and implement the item selection event handling
over ListView and Spinner.

103 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs):


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

1. ListView :

Android ListView is a ViewGroup that is used to display the list of items in


multiple rows and contains an adapter that automatically inserts the items
into the list. Using adapter, items are inserted into the list from an array or
database. For displaying the items in the list setAdaptor() method is used.
• Attributes of ListView:
Attribute Description
android:divider A color or drawable to separate list items.
android:dividerHeight Divider’s height.
android:entries Reference to an array resource that will
populate the ListView.
android:footerDividersEnabled When set to false, the ListView will not
draw the divider before each footer view.
android:headerDividersEnabled When set to false, the ListView will not
draw the divider before each header
view.

public class MainActivity extends AppCompatActivity


{
ListView l;
String tutorials[] = { "C", "C++", "Java", ".Net"};
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
l = findViewById(R.id.listview);
ArrayAdapter<String>arr;
arr = new ArrayAdapter<String>(this,
R.layout.support_simple_spinner_dropdown_item
,tutorials);
l.setAdapter(arr);
}
}

104 | Page
Mobile Application Development (4350703)

• Adding an item:
String newItem = "Android";

// Add the new item to the ArrayList


arr.add(newItem);

// Notify the adapter that the data set has changed


adapter.notifyDataSetChanged();

• Updating an item:
// Get the position of the item you want to update
int position = 2;

// Update the item in the adapter's data set


arr.getItem(position) = updatedItem;

// Notify the adapter that the data set has changed


arr.notifyDataSetChanged();

• Removing an item:
// Get the position of the item you want to remove
int position = 2;

// Remove the item from the adapter's data set


arr.remove(adapter.getItem(position));

// Notify the adapter that the data set has changed


arr.notifyDataSetChanged();

2. Spinner:

Android spinner is like the drop down menu with multiple values from which
the end user can select only one value.Android spinner is associated with
AdapterView. So you need to use one of the adapter classes with spinner.
• Attributes of Spinner:
Attributes Description
android:id Used to specify the id of the view.
android:textAlignment Used to the text alignment in the dropdown list.
android:background Used to set the background of the view.
android:padding Used to set the padding of the view.
android:visibility Used to set the visibility of the view.
android:gravity Used to specify the gravity of the view like center, top,
bottom, etc.

105 | Page
Mobile Application Development (4350703)

// Main Activity implements Adapter view


public class MainActivityextends AppCompatActivity
implements AdapterView.OnItemSelectedListener {

// create array of Strings


// and store name of courses
String[] courses = { "C", "C++", "Java", ".Net"};

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// Take the instance of Spinner and


// apply OnItemSelectedListener on it which
// tells which item of spinner is clicked
Spinner spin = findViewById (R.id.coursesspinner);
spin.setOnItemSelectedListener(this);

// Create the instance of ArrayAdapter


// having the list of courses
ArrayAdapter ad= new
ArrayAdapter(this,
android.R.layout.simple_spinner_item, courses);

// set simple layout resource file


// for each item of spinner
ad.setDropDownViewResource(android.R.layout.simple_spi
nner_dropd

own_item);

// Set the ArrayAdapter (ad) data on the


// Spinner which binds data to spinner
spin.setAdapter(ad);
}

// Performing action when ItemSelected


// from spinner, Overriding onItemSelected method
@Override
public void onItemSelected(AdapterView<*> arg0, View
arg1,int position, long id)
{
// make toastof name of course
// which is selected in spinner
Toast.makeText(getApplicationContext(),
courses[position],
Toast.LENGTH_LONG)
.show();
}

@Override
public void onNothingSelected(AdapterView<*> arg0)
{
// Auto-generated method stub
}
}

106 | Page
Mobile Application Development (4350703)

• Adding an item:
Spinner spinner = findViewById(R.id.coursesspinner);
ArrayAdapter<String> adapter = (ArrayAdapter<String>)
spinner.getAdapter();

// Add a new item to the adapter


adapter.add(newItem);
// Notify the adapter that the data set has changed
adapter.notifyDataSetChanged();

• Updating an item:
Spinner spinner = findViewById(R.id.coursesspinner);
ArrayAdapter<String> adapter = (ArrayAdapter<String>)

spinner.getAdapter();

// Get the position of the item you want to update


int position = 2;

// Update the item in the adapter's data set


adapter.getItem(position) = updatedItem;

// Notify the adapter that the data set has changed


adapter.notifyDataSetChanged();

• Removing an item:
Spinner spinner = findViewById(R.id.coursesspinner);
ArrayAdapter<String> adapter = (ArrayAdapter<String>)
spinner.getAdapter();

// Get the position of the item you want to remove


int position = 2;

// Remove the item from the adapter's data set


adapter.remove(adapter.getItem(position));

// Notify the adapter that the data set has changed


adapter.notifyDataSetChanged();

H. Resources/Equipment Required

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

107 | Page
Mobile Application Development (4350703)

I. Application Code:
ListView:
Layout Code (xml file)

108 | Page
Mobile Application Development (4350703)

109 | Page
Mobile Application Development (4350703)

Source Code (java file)

110 | Page
Mobile Application Development (4350703)

Output:

111 | Page
Mobile Application Development (4350703)

Spinner:
Layout Code (xml file)

112 | Page
Mobile Application Development (4350703)

113 | Page
Mobile Application Development (4350703)

Source Code (java file)

114 | Page
Mobile Application Development (4350703)

Output:

115 | Page
Mobile Application Development (4350703)

J. Practical related Quiz.


1. Which adapter is commonly used to populate data in a ListView?
a) ArrayAdapter
b) RecyclerViewAdapter
c) BaseAdapter
d) ListAdapter
2. Which method is used to handle item click events in a ListView?
a) setItemClickListener()
b) setOnItemSelectedListener()
c) setOnItemClickListener()
d) setOnItemLongClickListener()
3. Which method is used to customize the appearance of items in a ListView?
a) setItemView()
b) setItemLayout()
c) setItemStyle()
d) setAdapter()
4. Which method is used to set an adapter for a Spinner in Android?
a) setAdapter()
b) setSpinnerAdapter()
c) setAdapterSpinner()
d) setSpinner()
5. How can you retrieve the selected item from a Spinner in Android?
a) spinner.getSelectedItem()
b) spinner.getSelectedValue()
c) spinner.getSelectedText()
d) spinner.getSelectedIndex()
K. References:
https://developer.android.com/reference/android/widget/ListView
https://www.geeksforgeeks.org/android-listview-in-java-with-example/
https://www.tutorialspoint.com/android/android_list_view.htm
https://developer.android.com/develop/ui/views/components/spinner
https://www.geeksforgeeks.org/spinner-in-android-using-java-with-example/
https://www.tutorialspoint.com/android/android_spinner_control.htm
M. Assessment-Rubrics
Assessment Criteria Obtained
Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

116 | Page
Mobile Application Development (4350703)

Practical No.12
Develop the code to manage permission using manifest file and run time from
activity, and toggle state of Wi-Fi and Bluetooth.

A. Objective:

After performing the practical, students will be able to understand the


requirement of permission in android application as well as implementation
of the permission using manifest file and run time from activity.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Apply Event Handling in Android application to perform user actions.

E. Practical Outcomes (PROs)


• To manage permission to access and toggle state of Wi-Fi and Bluetooth.

117 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

1. Managing permission using AndroidManifest.xml:

Permission in android can be managed using the Manifest file as described


below:
• Open the AndroidManifest.xml file of your Android project.
• Inside the <manifest> tag, add the necessary <uses-permission> elements
for the permissions you require. Each <uses-permission> element
represents a specific permission.
• For example, to request access to the device's camera, wi-fi, bluetoothyou
would add the following line:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

• Save the AndroidManifest.xml file.

2. Request runtime permissions from the user in your Activity:


• Check if the necessary permissions are granted before performing any
operations that require them.
• If the permissions are not granted, request them from the user using the
requestPermissions() method.
private static final int REQUEST_BLUETOOTH_PERMISSION = 1;
private static final int REQUEST_WIFI_PERMISSION = 2;

// Request Bluetooth permissions


if (ContextCompat.checkSelfPermission(this,

Manifest.permission.BLUETOOTH) != PackageManager.PERMISSION_GRANTED
|| ContextCompat.checkSelfPermission(this,
Manifest.permission.BLUETOOTH_ADMIN) !=
PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(this, new String[]{
Manifest.permission.BLUETOOTH,
Manifest.permission.BLUETOOTH_ADMIN},
REQUEST_BLUETOOTH_PERMISSION);
}
// Request Wi-Fi permissions
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_WIFI_STATE) !=
PackageManager.PERMISSION_GRANTED ||
ContextCompat.checkSelfPermission(this,

118 | Page
Mobile Application Development (4350703)

Manifest.permission.CHANGE_WIFI_STATE) !=
PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(this, new String[]{
Manifest.permission.ACCESS_WIFI_STATE,Manifest.permission.CHAN
GE_WIFI_STATE}, REQUEST_WIFI_PERMISSION);
}

H. Resources/Equipment Required

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

I. Application Code:

Layout Code (xml file)

119 | Page
Mobile Application Development (4350703)

120 | Page
Mobile Application Development (4350703)

Source Code (java file)

121 | Page
Mobile Application Development (4350703)

J. Output:

122 | Page
Mobile Application Development (4350703)

K. Practical related Quiz.


1. Which file is used to declare the required permissions for an Android
application?
a) MainActivity.java
b) styles.xml
c) AndroidManifest.xml
d) build.gradle
2. What is the purpose of permissions in an operating system like Android?
a) To restrict access to sensitive user data and device features.
b) To optimize the performance of the application.
c) To enhance the user interface design.
d) To enable multi-threading in the application.
3. Which permission is required to access the device's camera in an Android
application?
a) ACCESS_FINE_LOCATION
b) READ_EXTERNAL_STORAGE
c) CAMERA
d) INTERNET
4. What is the purpose of the <uses-permission> tag in the manifest file?
a) To define a custom permission for the application.
b) To request a permission required by the application.
c) To specify the protection level of a permission.
d) To declare a group of related permissions.
L. References:
https://developer.android.com/guide/topics/permissions/overview
https://developer.android.com/training/permissions/requesting
https://www.geeksforgeeks.org/android-how-to-request-permissions-in-
android-application/
https://www.tutorialspoint.com/how-to-add-manifest-permission-to-an-
application-in-android
M. Assessment-Rubrics
Assessment Criteria Obtained
Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

123 | Page
Mobile Application Development (4350703)

Practical No.13
Develop android applications to demonstrate user interaction with the application
using Options Menu, Context Menu and Popup Menu.

A. Objective:

After performing the practical, students will be able to understand and


implement Options Menu, Context Menu and Popup Menu.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Develop Android Applications using Menu, Dialog, and Databases.

E. Practical Outcomes (PROs)


• To develop an application for user interaction with the application using
Options Menu, Context Menu and Popup Menu.

124 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

1. Options Menu

An options menu is a standard component that provides a set of actions or


options for the user. It typically appears at the top of the screen as a
dropdown or a set of icons, depending on the device and Android version.
• Create a new XML file in your project's "res/menu" directory. For example,
if you want to name it "menu_main.xml", you can add the following code:
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_option1"
android:title="Option 1"
android:icon="@drawable/ic_option1"
android:showAsAction="ifRoom" />
<item
android:id="@+id/action_option2"
android:title="Option 2"
android:icon="@drawable/ic_option2"
android:showAsAction="ifRoom" />
<!-- Add more items as needed -->
</menu>

• Open the activity where you want to display the options menu.
• Override the onCreateOptionsMenu() method in your activity, and inflate
the menu resource file you created.
@Override
public booleanonCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

• Optionally, you can handle the selection of menu items by overriding the
onOptionsItemSelected() method.
@Override
public booleanonOptionsItemSelected(MenuItem item) {
int id = item.getItemId();

if (id == R.id.action_option1) {
// Handle option 1 selection
return true;
} else if (id == R.id.action_option2) {
// Handle option 2 selection

125 | Page
Mobile Application Development (4350703)

return true;
}
return super.onOptionsItemSelected(item);
}

• When you run your app, and the options menu should appear in the
activity you specified. When the user selects an item, the corresponding
code in the onOptionsItemSelected() method will be executed.

2. Context Menu

A context menu is a type of menu that appears when the user performs a long
press or a contextual action on a view or item. It provides a set of actions
relevant to the selected view or item.
• Register the view or item for which you want to create a context menu.
This is typically done in the onCreate() method of your activity. For
example, if you want to register a TextView with the ID "textView":
TextViewtextView = findViewById(R.id.textView);
registerForContextMenu(textView);

• Create a new XML file in your project's "res/menu" directory to define the
items in the context menu. For example, if you want to name it
"context_menu.xml", you can add the following code:
<menu xmlns:android=
"http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_edit"
android:title="Edit" />
<item
android:id="@+id/action_delete"
android:title="Delete" />
</menu>

• Override the onCreateContextMenu() method in your activity. This


method is responsible for creating the context menu.
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenu.ContextMenuInfomenuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
getMenuInflater().inflate(R.menu.context_menu, menu);
}

• Override the onContextItemSelected() method in your activity to handle


the selection of context menu items.
@Override
public booleanonContextItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_edit) {
// Handle edit action
return true;
} else if (id == R.id.action_delete) {

126 | Page
Mobile Application Development (4350703)

// Handle delete action


return true;
}
return super.onContextItemSelected(item);
}

• When you run your app, and when the user performs a long press or
contextual action on the registered view or item, the context menu will
appear. When the user selects an item, the corresponding code in the
onContextItemSelected() method will be executed.

3. Popup Menu

A popup menu is a type of menu that appears as a floating window anchored


to a specific view. It provides a set of actions or options for the user to choose
from.
• Create a new XML file in your project's "res/menu" directory to define the
items in the popup menu. For example, if you want to name it
"popup_menu.xml", you can add the following code:
<menu xmlns:android=
"http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_option1"
android:title="Option 1" />
<item
android:id="@+id/action_option2"
android:title="Option 2" />
<!-- Add more items as needed -->
</menu>

• In your activity, create an instance of PopupMenu and associate it with a


view that will trigger the popup menu. For example, if you have a button
with the ID "popupButton":
Button popupButton = findViewById(R.id.popupButton);
PopupMenupopupMenu = new PopupMenu(this, popupButton);

• Inflate the popup menu by calling the inflate() method and providing the
menu resource file you created.
popupMenu.getMenuInflater().inflate(R.menu.popup_menu,
popupMenu.getMenu());

• Optionally, you can handle the selection of menu items by setting an


OnMenuItemClickListener on the popup menu.
popupMenu.setOnMenuItemClickListener(new
PopupMenu.OnMenuItemClickListener() {
@Override
public booleanonMenuItemClick(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_option1) {
// Handle option 1 selection

127 | Page
Mobile Application Development (4350703)

return true;
} else if (id == R.id.action_option2) {
// Handle option 2 selection
return true;
}
return false;
}
});

• Show the popup menu by calling the show() method:


popupMenu.show();

• When you run your app, and when the user taps the associated view (e.g.,
button), the popup menu will appear. When the user selects an item, the
corresponding code in the OnMenuItemClickListener will be executed.

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

I. Application Code:
Options Menu Example:
Layout Code (xml file)

128 | Page
Mobile Application Development (4350703)

129 | Page
Mobile Application Development (4350703)

Source Code (java file)

130 | Page
Mobile Application Development (4350703)

Options Menu Output:

131 | Page
Mobile Application Development (4350703)

Context Menu Example:


Layout Code (xml file)

132 | Page
Mobile Application Development (4350703)

Source Code (java file)

133 | Page
Mobile Application Development (4350703)

Context Menu Output:

134 | Page
Mobile Application Development (4350703)

Popup Menu Example:


Layout Code (xml file)

135 | Page
Mobile Application Development (4350703)

Source Code (java file)

136 | Page
Mobile Application Development (4350703)

Popup Menu Output:

J. Practical related Quiz:

137 | Page
Mobile Application Development (4350703)

1. What is the purpose of the onCreateOptionsMenu() method in an android


activity?
a) It inflates the menu resource file to create the options menu.
b) It handles the selection of options menu items.
c) It defines the layout of the options menu.
d) It registers the activity or fragment for receiving options menu events.
2. Which method should be overridden to handle the selection of options
menu items in an Android activity or fragment?
a) onCreateOptionsMenu()
b) onOptionsItemSelected()
c) onContextItemSelected()
d) onMenuSelected()
3. What event typically triggers the display of a context menu in Android?
a) Single tap on a view
b) Double tap on a view
c) Long press on a view
d) Swipe gesture on a view
4. Which method is used to register a view for a context menu in an Android
activity?
a) registerForContextMenu()
b) setContextMenuView()
c) attachContextMenu()
d) enableContextMenu()
5. How can you handle the selection of items in a popup menu?
a) implementing OnMenuItemClickListener interface.
b) overriding the onMenuItemSelected() method.
c) implementing PopupMenu.OnMenuItemClickListener interface.
d) overriding the onContextItemSelected() method.
K. References:
https://developer.android.com/develop/ui/views/components/menus
https://www.geeksforgeeks.org/android-menus/
https://www.javatpoint.com/android-option-menu-example
https://www.tutorialspoint.com/android-popup-menu-example
L. Assessment-Rubrics:
Assessment Criteria Obtained
Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

138 | Page
Mobile Application Development (4350703)

Practical No.14
Develop Android Applications to demonstrate different AlertDialogs and the Custom
Dialog.

A. Objective:

After performing the practical, students will be able to understand the


concept of the dialog in android and implement the dialogs using AlertDialog
and custom dialog.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Develop Android Applications using Menu, Dialog, and Databases.

E. Practical Outcomes (PROs)


• To demonstrate AlertDialog and Dialog.

139 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

1. Alert Dialog

AlertDialog in Android is a class that belongs to the Android framework and is


used to display a modal dialog box with a title, message, and buttons. It
provides a simple way to prompt users for input or to display important
information.
// Create an AlertDialog.Builder instance
AlertDialog.Builder builder = new AlertDialog.Builder(context);

// Set the title and message for the dialog


builder.setTitle("Alert");
builder.setMessage("This is an example alert dialog.");

// Set the positive button and its click listener


builder.setPositiveButton("OK", new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// Handle the button click
// You can perform any action here or dismiss the dialog
}
});

// Set the negative button and its click listener


builder.setNegativeButton("Cancel", new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// Handle the button click
// You can perform any action here or dismiss the dialog
}
});

// Create the AlertDialog object and show it


AlertDialogalertDialog = builder.create();
alertDialog.show();

In this example, context refers to the current context or activity where you
want to display the dialog. You can replace "Alert" and "This is an example
alert dialog" with your desired title and message. The positive and negative
buttons are specified with their labels ("OK" and "Cancel") and click listeners
to handle button clicks.

This code demonstrates a basic usage of AlertDialog, but you can customize it
further by adding other options like neutral buttons, custom views, and more.

140 | Page
Mobile Application Development (4350703)

2. Custom Dialog

Custom dialog in android can also be implemented using, Dialog class.


• In your project's res/layout directory, create a new XML file (e.g.,
custom_dialog.xml).
• Design the layout of your custom dialog by adding views and specifying
their properties.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="This is a custom dialog"
android:textSize="18sp"
android:textColor="@android:color/black"/>

<!-- Add other views as needed -->

</LinearLayout>

• In your activity or fragment where you want to show the custom dialog,
create an instance of the Dialog class, set its custom view, and handle any
necessary interactions.
// Create a Dialog instance
Dialog dialog = new Dialog(context);

// Set the custom layout for the dialog


dialog.setContentView(R.layout.custom_dialog);

// Set any additional properties or buttons as needed


Button okButton = dialog.findViewById(R.id.ok_button);
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Handle the button click
dialog.dismiss();
}
});

// Show the dialog


dialog.show();

In this example, context refers to the current context or activity where you
want to display the custom dialog. Replace R.layout.custom_dialog with the
appropriate resource ID if your XML layout file has a different name or
location.

141 | Page
Mobile Application Development (4350703)

You can customize the dialog further by accessing the views inside the custom
layout using findViewById() and setting listeners or performing actions
accordingly.

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No.
/Components/Trainer kit
Processor: x86_64 CPU architecture
1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

I. Application Code:
AlertDialog Example:
Layout Code (xml file)

142 | Page
Mobile Application Development (4350703)

143 | Page
Mobile Application Development (4350703)

Source Code (java file)

144 | Page
Mobile Application Development (4350703)

AlertDialog Output:

145 | Page
Mobile Application Development (4350703)

Custom Dialog Example:


Layout Code (xml file)

146 | Page
Mobile Application Development (4350703)

147 | Page
Mobile Application Development (4350703)

Source Code (java file)

148 | Page
Mobile Application Development (4350703)

Custom Dialog Output:

149 | Page
Mobile Application Development (4350703)

J. Practical related Quiz:


1. What is an AlertDialog?
a) A class used for displaying notifications.
b) A class used for creating dialogs with buttons and messages.
c) A class used for displaying images.
d) A class used for creating custom layouts.
2. Which method is used to create an AlertDialog?
a) showDialog()
b) createDialog()
c) buildDialog()
d) AlertDialog.Builder()
3. What is the purpose of the setPositiveButton() method in AlertDialog?
a) Adds a positive button to the dialog.
b) Sets the dialog title.
c) Sets the dialog message.
d) Adds an image to the dialog.
4. How can you set a custom layout for a dialog in Android?
a) using the setCustomLayout() method.
b) calling the setContentView() method.
c) using the setDialogLayout() method.
d) calling the setCustomView() method.
5. Which class is the base class for creating dialogs in Android?
a) AlertDialog
b) DialogFragment
c) Dialog
d) PopupWindow
K. References:
https://developer.android.com/develop/ui/views/components/dialogs
https://www.geeksforgeeks.org/how-to-create-an-alert-dialog-box-in-
android/
https://www.javatpoint.com/android-alert-dialog-example
https://www.tutorialspoint.com/android/android_alert_dialoges.htm

L. Assessment-Rubrics:
Assessment Criteria Obtained
Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

150 | Page
Mobile Application Development (4350703)

Practical No.15
Develop Android Application for local database connectivity and performing basic
database operations (select, insert, update, delete) using SQLiteDatabase and
SQLiteOpenHelper Classes.

A. Objective:

After performing the practical, students will be able to implement the


database operations like select, insert, update and delete with SQLite
database.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Develop Android Applications using Menu, Dialog, and Databases.

E. Practical Outcomes (PROs)


• To develop code for Database operations

151 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

In Android, you can perform various database operations using the built-in
SQLite database. SQLite is a lightweight, embedded relational database that is
widely used in Android applications. Here's an overview of the common
database operations you can perform:
• Creating a Database: To create a database, you need to subclass the
SQLiteOpenHelper class and override the onCreate() method. Inside this
method, you can execute SQL statements to create tables and define the
database schema.
// Creating a Database
public class MyDatabaseHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME =
"mydatabase.db";
private static final int DATABASE_VERSION = 1;

public MyDatabaseHelper(Context context) {


super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

@Override
public void onCreate(SQLiteDatabasedb) {
// Create tables and define schema using db.execSQL()
}

@Override
public void onUpgrade(SQLiteDatabasedb, int oldVersion,
int newVersion)
{
// Perform database schema upgrades if needed
}
}

• Opening and Closing the Database: To open a database, create an


instance of your SQLiteOpenHelper subclass using its constructor. It will
handle opening the database connection. To close the database, call the
close() method on the SQLiteOpenHelper instance.
// Opening and Closing the Database
MyDatabaseHelperdbHelper = new MyDatabaseHelper(context);
SQLiteDatabasedb = dbHelper.getWritableDatabase();
// Perform database operations...
db.close();

152 | Page
Mobile Application Development (4350703)

• Inserting Data: To insert data into a table, use the SQLiteDatabase class
and its insert() method. Provide the table name, column values, and
optional nullColumnHack parameter if necessary.
// Inserting Data
ContentValues values = new ContentValues();
values.put("column_name", "value");
long newRowId = db.insert("table_name", null, values);

• Querying Data: To retrieve data from a table, use the query() method of
the SQLiteDatabase class. It allows you to specify the table name, columns
to retrieve, selection criteria, sort order, and more.
// Querying Data
String[] projection = {"column1", "column2"};
String selection = "column3 = ?";
String[] selectionArgs = {"value"};
String sortOrder = "column4 ASC";
Cursor cursor = db.query("table_name", projection, selection,
selectionArgs,
null, null, sortOrder);
if (cursor != null &&cursor.moveToFirst()) {
// Iterate over the cursor to retrieve data
cursor.close();
}

• Updating Data: To update existing data in a table, use the update()


method of the SQLiteDatabase class. Specify the table name, new values,
selection criteria, and optional arguments.
// Updating Data
ContentValuesnewValues = new ContentValues();
newValues.put("column_name", "new_value");
String whereClause = "column_name= ?";
String[] whereArgs = {"value"};
int rowsUpdated = db.update("table_name", newValues,
whereClause,
whereArgs);

• Deleting Data: To delete data from a table, use the delete() method of the
SQLiteDatabase class. Provide the table name, selection criteria, and
optional arguments.
// Deleting Data
String whereClause = "column_name= ?";
String[] whereArgs = {"value"};
int rowsDeleted = db.delete("table_name", whereClause,
whereArgs);

153 | Page
Mobile Application Development (4350703)

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No. /Components/Trainer kit

Processor: x86_64 CPU architecture


1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

I. Application Code:

Layout Code (xml file)

154 | Page
Mobile Application Development (4350703)

155 | Page
Mobile Application Development (4350703)

Source Code (java file)

156 | Page
Mobile Application Development (4350703)

157 | Page
Mobile Application Development (4350703)

J. Output:

158 | Page
Mobile Application Development (4350703)

K. Practical related Quiz:


1. What is SQLite in the context of Android development?
a) A programming language used for Android app development.
b) A database management system used to store data in Android apps.
c) A user interface toolkit for creating Android app layouts.
d) An Android emulator for testing apps on different devices.

2. Which class is used to manage the creation and versioning of SQLite


databases in Android?
a) SQLiteDatabase
b) SQLiteOpenHelper
c) SQLiteManager
d) SQLDatabaseManager

3. Which method is used to execute a SQL query in Android's SQLite


database?
a) executeQuery()
b) executeSQL()
c) query()
d) execute()

4. In Android's SQLite, which method is used to insert data into a table?


a) insertData()
b) addData()
c) insert()
d) addRecord()

5. What is the purpose of the SQLiteOpenHelper class in Android?


a) It provides methods to interact with the SQLite database.
b) It manages the creation and versioning of the database.
c) It handles the querying of the database.
d) It performs data encryption for the database.

L. References:
https://developer.android.com/reference/android/database/sqlite/SQLiteDat
abase
https://www.geeksforgeeks.org/how-to-create-and-add-data-to-sqlite-
database-in-android/
https://www.javatpoint.com/android-sqlite-tutorial
https://www.tutorialspoint.com/android/android_sqlite_database.htm

159 | Page
Mobile Application Development (4350703)

M. Assessment-Rubrics:

Assessment Criteria Obtained


Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

160 | Page
Mobile Application Development (4350703)

Practical No.16
Develop an Android Application to demonstrate the use of RecyclerView and
CardView for displaying list of items with multiple information.

A. Objective:

After performing the practical, students will be able to understand and


implement the RecyclerView and CardView in android application.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Develop Android Applications using Menu, Dialog, and Databases.

E. Practical Outcomes (PROs)


• To demonstrate CardView and RecyclerView

161 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

1. RecyclerView:

RecyclerView is a view container in android that is used to display large sets of


data in a scrollable list or grid format. It is an improved version of the older
ListView and GridView, providing better performance and flexibility.

To implement the RecyclerView in android follow below step:


• Add the RecyclerView dependency to your app-level build.gradle file.
Replace <version> with the latest version of the RecyclerView library.
Ensure you have the AndroidX dependencies enabled in your project.
implementation 'androidx.recyclerview:recyclerview:<version>'

• Define the RecyclerView in your XML layout file where you want to display
the list.
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>

• Create a custom item layout XML file for each item in the list. This file will
define the appearance of each item in the RecyclerView.
• Create a CustomViewHolder class that extends RecyclerView.ViewHolder.
This class will hold references to the views within each item layout and
provide a way to access and update them.
public class CustomViewHolder extends
RecyclerView.ViewHolder {
// Declare views within the item layout
public TextViewtextView;
public CustomViewHolder(View itemView)
{
super(itemView);
// Initialize views
textView =
itemView.findViewById(R.id.textView);
}
}

162 | Page
Mobile Application Development (4350703)

• Create an adapter class that extends RecyclerView.Adapter


<CustomViewHolder>. The adapter is responsible for inflating the item
layout, binding data to the views, and managing the data set. Override the
necessary methods, such as onCreateViewHolder, onBindViewHolder,
and getItemCount.
public class CustomAdapter extends
RecyclerView.Adapter<CustomViewHolder>
{
private List<String>dataList;

public CustomAdapter(List<String>dataList)
{
this.dataList = dataList;
}

@Override
public CustomViewHolderonCreateViewHolder(ViewGroup
parent, int viewType)
{
View view = LayoutInflater.from(

parent.getContext()).inflate(R.layout.item_layout,
parent, false);
return new CustomViewHolder(view);
}

@Override
public void onBindViewHolder(CustomViewHolder holder, int
position)
{
String data = dataList.get(position);
holder.textView.setText(data);
}

@Override
public int getItemCount()
{
return dataList.size();
}
}

• In your activity, initialize the RecyclerView and set the adapter.


RecyclerViewrecyclerView = findViewById(R.id.recyclerView);
// Pass your data to the adapter

CustomAdapter adapter = new CustomAdapter(dataList);


recyclerView.setAdapter(adapter);

163 | Page
Mobile Application Development (4350703)

// Choose a layout manager (e.g., LinearLayoutManager,


GridLayoutManager)
recyclerView.setLayoutManager(new
LinearLayoutManager(this));

2. CardView:

CardView is a UI component provided by the Android Support Library that


allows developers to display information or content in a card-like format. It
provides a consistent and customizable layout for displaying elements such as
text, images, buttons, or other views.

To implement the CardView in android follow below step:


• Add the CardView dependency to your app-level build.gradle file. Replace
<version> with the latest version of the CardView library. Ensure you have
the AndroidX dependencies enabled in your project.
implementation 'androidx.cardview:cardview:<version>'

• Use the CardView in your XML layout file by wrapping your content inside
the <androidx.cardview.widget.CardView> tags. Here, TextView is
wrapped inside as shown below:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayoutxmlns:android="http://schemas.android.com/
apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context=".MainActivity">

<androidx.cardview.widget.CardView
android:id="@+id/cardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:cardBackgroundColor="#FFFFFF">

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is a CardView"
android:textSize="16sp"
android:padding="16dp" />

</androidx.cardview.widget.CardView>
</RelativeLayout>

164 | Page
Mobile Application Development (4350703)

• In Java class (e.g., MainActivity.java), associate the XML layout with the
activity and initialize the CardView.
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity


{ private CardViewcardView;

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

cardView = findViewById(R.id.cardView);

cardView.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v)
{
// Perform actions on card click
Toast.makeText(MainActivity.this,
"Card clicked!",
Toast.LENGTH_SHORT).show();
}
});
}
}

• In this example, the CardViewis initialized in the onCreate method of the


activity. An OnClickListeneris set to the CardView to perform actions when
the card is clicked. In this case, a simple Toast message is displayed when
the card is clicked.

165 | Page
Mobile Application Development (4350703)

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No. /Components/Trainer kit

Processor: x86_64 CPU architecture


1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

I. Application Code:
RecyclerView Example:
Layout Code (xml file)

166 | Page
Mobile Application Development (4350703)

167 | Page
Mobile Application Development (4350703)

Source Code (java file)

168 | Page
Mobile Application Development (4350703)

RecyclerView Output:

169 | Page
Mobile Application Development (4350703)

CardView Example:
Layout Code (xml file)

170 | Page
Mobile Application Development (4350703)

171 | Page
Mobile Application Development (4350703)

Source Code (java file)

172 | Page
Mobile Application Development (4350703)

CardView Output:

173 | Page
Mobile Application Development (4350703)

J. Practical related Quiz:


1. What is the purpose of RecyclerView in Android?
a) It is used for displaying a list of items in a vertically scrolling manner.
b) It is used for capturing user input events.
c) It is used for playing audio and video content.
d) It is used for displaying images in a grid layout.
2. What is the purpose of the RecyclerViewAdapter in RecyclerView?
a) It holds the data for each item in the RecyclerView.
b) It defines the layout for each item in the RecyclerView.
c) It handles user input events for each item in the RecyclerView.
d) It binds the data to the views in each item of the RecyclerView.
3. What is the purpose of CardView in Android?
a) It is used for capturing user input events.
b) It is used for displaying images in a grid layout.
c) It is used for creating visually appealing cards with rounded corners and
shadows.
d) It is used for playing audio and video content.
4. How can you set a click listener on a CardView in Android?
a) Use the setOnClickListener() method on the CardView itself.
b) Implement the OnClickListener interface in the activity or fragment.
c) Define click listeners within the layout XML file of the CardView.
d) All of the above.

K. References:
https://developer.android.com/develop/ui/views/layout/recyclerview
https://www.geeksforgeeks.org/android-recyclerview/
https://developer.android.com/develop/ui/views/layout/cardview
https://www.geeksforgeeks.org/cardview-in-android-with-example/

L. Assessment-Rubrics:

Assessment Criteria Obtained


Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

174 | Page
Mobile Application Development (4350703)

Practical No.17
Develop a simple application to display “Hello <Application Name>” using Kotlin.

A. Objective:

After performing the practical, students will be able to implement the


application code of android application using Kotlin language instead of Java.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Develop Android applications using Kotlin Language.

E. Practical Outcomes (PROs)


• To develop basic application using Kotlin programming language.

175 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

In Android, its also possible to write your application code in Kotlin in place of
Java. Kotlin file has “.kt” extention as java file has “.java” extention. The
sample code to display the application name in the TextView is shown below:

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView

class MainActivity : AppCompatActivity() {

private lateinit var textView: TextView

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

textView = findViewById(R.id.textView)
valapplicationName = getString(R.string.app_name)
val message = "Hello $applicationName"
textView.text = message
}
}

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No. /Components/Trainer kit

Processor: x86_64 CPU architecture


1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

176 | Page
Mobile Application Development (4350703)

I. Application Code:

Layout Code (xml file)

177 | Page
Mobile Application Development (4350703)

Source Code (java file)

J. Output:

178 | Page
Mobile Application Development (4350703)

K. Practical related Quiz:


1. What is Kotlin?
a) A programming language for Android development
b) A database management system
c) A mobile operating system
d) A UI design framework
2. What is the default file extension for Kotlin source files?
a) .kotlin
b) .kt
c) .k
d) .kot
3. Which file extension is used for Kotlin class files in the compiled form?
a) .kotlin
b) .kt
c) .k
d) .class

L. References:
https://developer.android.com/kotlin
https://developer.android.com/codelabs/build-your-first-android-app-kotlin
https://kotlinlang.org/docs/android-overview.html

M. Assessment-Rubrics:

Assessment Criteria Obtained


Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

179 | Page
Mobile Application Development (4350703)

Practical No.18
Develop an android application using Kotlin having a Button “Click” and upon clicking
on that Button a Toast message “Button Clicked” should be displayed on screen
through Toast Message.

A. Objective:

After performing the practical, students will be able to implement the


button’s click event in android using Kotlin.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Design/development of solutions (PO3): Design solutions for well-defined
technical problems and assist with the design of systems components or
processes to meet specified needs.
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Engineering practices for society, sustainability and environment (PO5):
Apply appropriate technology in context of society, sustainability,
environment and ethical practices.
• Project Management (PO6): Use engineering management principles
individually, as a team member or a leader to manage projects and
effectively communicate about well-defined engineering activities.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs)


• Develop Android applications using Kotlin Language.

E. Practical Outcomes (PROs)


• To implement basic Action listener of Button using Kotlin programming
language

180 | Page
Mobile Application Development (4350703)

F. Expected Affective domain Outcomes (ADOs)


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

Button’s click event in android can be handled using Kotlin as shown below:
val button = findViewById<Button>(R.id.button)
button.setOnClickListener
{
Toast.makeText(this, "Button clicked!",
Toast.LENGTH_SHORT).show()
}

Note that, here setOnClickListener method in Kotlin does not have an onClick
method. Instead, it uses a lambda expression to define the click behavior
directly.

H. Resources/Equipment Required:

Sr. Instrument/Equipment
Specification
No. /Components/Trainer kit

Processor: x86_64 CPU architecture


1. Computer System RAM: 8 GB Recommended
Operating System: Windows 10

2. Android Studio Version : Latest Version

I. Application Code:

Layout Code (xml file)

181 | Page
Mobile Application Development (4350703)

Source Code (java file)

182 | Page
Mobile Application Development (4350703)

J. Output:

183 | Page
Mobile Application Development (4350703)

K. Practical related Quiz:


1. How can you assign a click listener to a button in Kotlin?
a) Using the setOnClickListener() method.
b) Using the onClickListener() method.
c) Using the setOnClick() method.
d) Using the clickListener() method.

2. Which method is commonly used to handle button click events in Kotlin


for an Android application?
a) onClick()
b) onButtonClick()
c) onClickListener()
d) setOnClickListener()

3. How do you define a click listener using a lambda expression in Kotlin?


a) button.setOnClickListener { onClick() }
b) button.onClick { onClick() }
c) button.setOnClickListener { onClick }
d) button.onClick { onClick }

L. References:
https://www.javatpoint.com/kotlin-android-button
https://www.digitalocean.com/community/tutorials/android-button-using-
kotlin
https://www.geeksforgeeks.org/handling-click-events-button-android/

M. Assessment-Rubrics:

Assessment Criteria Obtained


Marks
Rubric (RB1): Problem analysis and proposing/designing solution /5
Rubric (RB2): Program Completeness/ Correctness /8
Rubric (RB3): Code efficiency /5
Rubric (RB4): Readability and Documentation of the program /5
Rubric(RB5): Viva/Sample question answering /2
Total Obtained Marks /25

Sign with Date

184 | Page
Mobile Application Development (4350703)

Practical No.20
Publish android application on Playstore.

A. Objective:

The students will be able to generate their Android .APK and publish the
application on google playstore.

B. Expected Program Outcomes (POs):


• Engineering knowledge (PO1): Apply knowledge of basic mathematics,
science and Engineering fundamentals and engineering specialization to
solve the engineering Problems.
• Problem analysis (PO2): Identify and analyse well-defined engineering
problems using codified standard methods
• Engineering Tools, Experimentation and Testing (PO4): Apply modern
engineering tools and appropriate technique to conduct standard tests
and measurements.
• Life-long learning (PO7): Ability to analyse individual needs and engage in
updating in the context of technological changes.

C. Expected Skills to be developed based on competency:

The practical is expected to develop the following skills for Android mobile
application development.
• Programming Skills
• Debugging Skills
• Critical thinking and Problem-solving

D. Expected Course Outcomes (COs):


• Develop Android applications using Kotlin Language.

E. Practical Outcomes (PROs):


• To publish the android application on google Playstore successfully.

F. Expected Affective domain Outcomes (ADOs):


• Work as an Android Application Developer.
• Demonstrate working as a team leader/member.
• Apply good Coding Practices using Coding Standards and Documentation.

G. Prerequisite Theory:

Android requires that all APKs be digitally signed with a certificate before they
are installed on a device or updated. When releasing using Android App
Bundles, you need to sign your app bundle with an upload key before
uploading it to the Play Console, and Play App Signing takes care of the rest.

185 | Page
Mobile Application Development (4350703)

For apps distributing using APKs on the Play Store or on other stores, you
must manually sign your APKs for upload.

Sign your app for release to Google Play:

When you are ready to publish your app, you need to sign your app and
upload it to an app store, such as Google Play. When publishing your app to
Google Play for the first time, you must also configure Play App Signing. Play
App Signing is optional for apps created before August 2021. This section
shows you how to properly sign your app for release and configure Play App
Signing.

Generate an upload key and keystore:

If you don't already have an upload key, which is useful when configuring Play
App Signing, you can generate one using Android Studio as follows:
1. In the menu bar, click Build > Generate Signed Bundle/APK.
2. In the Generate Signed Bundle or APK dialog, select Android App
Bundle or APK and click Next.
3. Below the field for Key store path, click Create new.
4. On the New Key Store window, provide the following information for
your keystore and key, as shown in figure.
5. Keystore
• Key store path: Select the location where your keystore should be
created. Also, a file name should be added to the end of the location
path with the .jks extension.
• Password: Create and confirm a secure password for your keystore.
6. Key
• Alias: Enter an identifying name for your key.
• Password: Create and confirm a secure password for your key. This
should be the same as your keystore password. (Please refer to
the known issue for more information)
• Validity (years): Set the length of time in years that your key will be
valid. Your key should be valid for at least 25 years, so you can sign
app updates with the same key through the lifespan of your app.
• Certificate: Enter some information about yourself for your
certificate. This information is not displayed in your app, but is
included in your certificate as part of the APK.
7. Once you complete the form, click OK.
8. If you would like to build and sign your app with your upload key,
continue to the section about how to Sign your app with your upload
key. If you only want to generate the key and keystore, click Cancel.

186 | Page
Mobile Application Development (4350703)

Sign your app with your key

If you already have an upload key, use it to sign your app. If instead your app
is already signed and published to the Google Play store with an existing app
signing key, use it to sign your app. You can later generate and register a
separate upload key with Google Play to sign and upload subsequent updates
to your app.

To sign your app using Android Studio, follow these steps:


1. If you don’t currently have the GENERATE Signed Bundle or
APK dialog open, click Build > Generate Signed Bundle/APK.
2. In the Generate Signed Bundle or APK dialog, select either Android
App Bundle or APK and click Next.
3. Select a module from the drop down.
4. Specify the path to your keystore, the alias for your key, and enter the
passwords for both. If you haven't yet prepared your upload keystore
and key, first generate an upload key and keystore and then return to
complete this step.

Figure: Sign your app with your upload key.

187 | Page
Mobile Application Development (4350703)

Note: For increased security, Google Play is introducing a new process


to upload signing keys, and the option Export encrypted key in
Android Studio is being deprecated. If you're signing an app with an
existing app signing key, and you'd like to opt your app in to Play App
Signing, see Opt in an existing app for the process to encrypt and
export your signing key.
5. Click Next.
6. In the next window (as shown in figure), select a destination folder for
your signed app, select the build type, choose the product flavor(s) if
applicable.

Figure: Generate a signed version of your app for the selected product flavors.

7. If you are building and signing an APK, you need to select


which Signature Versions you want your app to support. To learn
more, read about app signing schemes.
NOTE: Google Play supports APK Signature Scheme v3 for APKs that
aren't already published with an existing signing certificate lineage.
8. Click Finish.

After Android Studio finishes building your signed app, you can
either locate or analyse your app by clicking on the appropriate option in the
pop-up notification, as shown in figure.

Figure: Click the link in the popup to analyse or locate your app bundle.

Now you’re ready to opt your app in to Play App Signing and upload your app
for release. If you’re new to the app publishing process, you may want to read
the Launch overview. Otherwise, continue to the page about how to Upload
your app to the Play Console.

188 | Page
Mobile Application Development (4350703)

Upload the Application on Play Store:

Step 1: Create a Google Developer account

This is something you can do at the beginning of the app development


process. Without registering a Google Developer Account, you can’t publish
your app on Google Play. You can use any of your current Google accounts or
create another one to sign up for a Google Developer Account. It doesn’t
matter whether it’s a private or corporate account. You may easily transfer
your app to another one in the future. The creation process includes signing
the Google Play Developer distribution agreement, adding some personal
information, and paying a one-time registration fee of $25. There is nothing
complicated. Just follow the instructions.

Usually, it takes no more than two days to get approval from Google. Don’t
worry if you forget to add some information. You can edit your account later.

Figure: Google Play Developer distribution agreement

Step 2: Add a Merchant Account

If you plan to sell paid apps or in-app purchases, you have to create a Google
Merchant Account. There you can manage app sales and your monthly
payouts, as well as analyse sales reports.

Once you finish creating the Merchant profile, the developer account gets
automatically linked to it.

189 | Page
Mobile Application Development (4350703)

Step 3: Prepare the Documents

Paperwork always requires much effort, especially when it comes to any kind
of legal documents. Based on our experience, we highly recommend starting
to prepare the End User License Agreement (EULA) and Privacy Policy in
advance.

You can take the documents from similar apps as references and create your
own based on them, or ask a lawyer to make everything from scratch.

EULA is an agreement between you as an owner and a user of your product.


In brief, it contains:
• What the users can do with the app, and what they aren't allowed to do
• Licensing fees
• Intellectual property information, etc.

Terms of Use or Terms and Conditions explain what services you offer the
users and how you expect them to behave in return. Though Google doesn’t
demand Terms of Use, it’s better to publish them. You can create one
document, adding there Privacy Policy and Terms of Use chapters.

Pay special attention to include in the Privacy Policy the following


information:
• A complete list of personal data that is collected, processed and used
through the app
• Technical information that is collected about the device and the
installed OS
• Functional features of the app, its paid and free functionality
• Place of registration of the company and/or location of the copyright
holder of the application
• The chosen legal system and legislation that will be applied in resolving
disputes and regulating legal relations
• The terms of subscription
• Citizenship (residence) of the overwhelming majority of application
users
• Age criteria, the presence of specific content

Create A new application on Play Store:

Store listing:

Once you click on it a pop up will be shown as below where you have to
choose your Default language and Title of your app. Then click on the CREATE
button.
190 | Page
Mobile Application Development (4350703)

Add high-resolution icon images: you have to add the Hi-res icon of your
app.

191 | Page
Mobile Application Development (4350703)

Then you have to provide the Screenshots of your app.

Next thing you have to provide is the Feature Graphic of your app. Note that
this graphic is then used everywhere your app is featured on Google Play.

Then come to Categorization part, where you have to provide


your Application type and Category of your app.

Then come to Contact details part, where you have to provide your Website
(if any), email, and Phone of yours.

192 | Page
Mobile Application Development (4350703)

Finally when you click on SAVE DRAFT button you can see that STORE
listing tab is now become turned to green and you are done for Store listing.

Step 4: App Release

After completing step 3 go to App releases then scroll down to Production


track and click on MANAGE button.

After redirecting to the next page click on the CREATE RELEASE button.

193 | Page
Mobile Application Development (4350703)

After that on the next page, you have to upload your APK file in Android App
Bundles and APKs to add section.

After that simply click on the SAVE button.

STEP 5: Content rating

Now after completing step 4 go to Content rating and click


on CONTINUE button.

194 | Page
Mobile Application Development (4350703)

After that fill your email address as well as confirm the email address.

And then Select your app category.

After selecting your app category make sure that you read all of these and
answer them correctly.

After answering them correctly don’t forget to click on SAVE


QUESTIONNAIRE button.

195 | Page
Mobile Application Development (4350703)

Once you saved all those things then click on CALCULATE RATING button.

When you redirected to another page scroll down and click on APPLY
RATING button. And you are done for Content rating section. Don’t forget to
notice that Content rating section is now become turned to green.

STEP 6: Pricing & distribution

Then go to the Pricing & distribution section. Then select the country in which
you want to available your app.

196 | Page
Mobile Application Development (4350703)

Then go down and down and check out the Content guidelines and US export
laws section by marking them tick mark. Click on the SAVE DRAFT button.
Don’t forget to notice that Pricing & distribution section is now become
turned to green tick.

STEP 7: App content

Then come to the App content section. And in the Privacy policy section click
on the Start button.

Then provide a valid Privacy policy URL. Note that google will check this.

197 | Page
Mobile Application Development (4350703)

Then go back and continue further steps by clicking start button


in Ads section.

Then select does your app contain ads or not? And click on SAVE button.

Then again go back and continue further steps by clicking start button
in Target audience and content section.

In the next page select the Target age group and scroll down and click on
the Next button.

198 | Page
Mobile Application Development (4350703)

Then check the Appeal to children section. And click on the Next button.

On the next page click on the Save button and you are done for App content
section.

STEP 8: App releases

Again go back to the App releases section. And in the Production track click
on the EDIT RELEASE button.

Then on the next page go down and down and click on the REVIEW button.

199 | Page
Mobile Application Development (4350703)

And finally, on the next page click on the START ROLLOUT TO


PRODUCTION button to send your app to review. And you are finally done.

After usually 4 to 5 days they will review your app and let you know to either
approve or reject your app.

200 | Page

You might also like