0% found this document useful (0 votes)
6 views42 pages

Anddd

The document outlines a series of weekly projects aimed at developing Android applications, starting with the installation of Android Studio and culminating in creating a GPS location retrieval app. Each week includes specific aims, descriptions, and detailed steps for implementing various features such as UI design, database management, alarm settings, and location services. The projects are designed to enhance skills in Android app development through practical application of concepts and tools.

Uploaded by

durgamaripi2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views42 pages

Anddd

The document outlines a series of weekly projects aimed at developing Android applications, starting with the installation of Android Studio and culminating in creating a GPS location retrieval app. Each week includes specific aims, descriptions, and detailed steps for implementing various features such as UI design, database management, alarm settings, and location services. The projects are designed to enhance skills in Android app development through practical application of concepts and tools.

Uploaded by

durgamaripi2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Week-1

Aim :- To install Android Studio (Ladybug version) and set up the development
environment for Android app development.

Description :-
Android Studio is the official Integrated Development Environment (IDE) for Android
development, providing powerful tools for building, testing, and debugging applications.
This setup ensures the system is ready for Android app development.

Steps to Install Android Studio (Ladybug Version) :-


1. Download Android Studio – Visit the official Android Developer website and
download the Ladybug version installer.

2. Run the Installer – Open the downloaded .exe (Windows) or .dmg (Mac) file and
start the installation.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
3. Accept License Agreement – Read and accept the terms and conditions to
proceed.

4. Choose Installation Location – Select the destination folder where Android


Studio will be installed.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
5. Select Components – Choose the required components, including Android SDK,
Emulator, and additional tools.
6. Complete Installation – Click "Install" and wait for the process to finish.

7. Launch Android Studio – Open Android Studio and configure the initial setup,
such as selecting the UI theme and SDK.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
8. Verify Setup – Create a new project or open an existing one to ensure the
installation is successful.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week-2

Aim:-
To develop an Android application with a TextView and buttons that change the text
color and font size dynamically.

Description:-
This project involves creating a simple Android app where users can modify the text size
and color of a TextView using two buttons. The font size increases until a limit is
reached, then resets, and the color cycles through multiple predefined colors.

Steps to Implement:

Create a New Android Project – Open Android Studio, create a new project, and select
an Empty Activity.

Design the UI (activity_main.xml) – Define a TextView and two Button elements inside
a LinearLayout.

xml

<TextView

android:id="@+id/textView"

android:text="Hello World!"

android:textSize="25sp"

android:textStyle="bold" />

Implement Logic in MainActivity.java – Handle button clicks to modify text size and
color.

java

TextView textView = findViewById(R.id.textView);

Button buttonChangeFont = findViewById(R.id.button1);

Button buttonChangeColor = findViewById(R.id.button2);

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Set Click Listeners – Change text size and cycle through colors.

java

buttonChangeFont.setOnClickListener(v -> {

textView.setTextSize(fontSize);

fontSize = (fontSize > 50) ? 30 : fontSize + 5;

});

buttonChangeColor.setOnClickListener(v -> {

int[] colors = {Color.RED, Color.GREEN, Color.BLUE, Color.CYAN, Color.YELLOW,


Color.MAGENTA};

textView.setTextColor(colors[colorIndex++ % colors.length]);

});

Run and Test the App – Install the app on an emulator or device to verify functionality.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Output:

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week-3

Aim:
The goal of this project is to create a Water Intake Calculator Android application that
estimates the daily water consumption required based on a user's weight, activity level,
and weather conditions.

Steps to Implement:
1. Setting Up the Project

• Open Android Studio and create a new Empty Activity project.

• Set the package name as com.example.mycalci.

• Ensure minSdkVersion is compatible with the target devices.

2. Create UI Layout (activity_main.xml)

• Add an EditText for weight input.

• Add two Spinner elements for selecting Activity Level and Weather Condition.

• Add a Button for calculating water intake.

• Display the result in a TextView.

3. Define String Resources (res/values/strings.xml)

• Define string arrays for activity levels (Low Activity, Moderate Activity, High
Activity).

• Define string arrays for weather conditions (Normal, Hot).

4. Implement MainActivity.java

• Initialize UI Components:

o EditText, Spinner, Button, and TextView.

o Populate Spinner elements using ArrayAdapter.

o Set up a Button click listener to calculate water intake.

• Implement Calculation Logic:

Name: T.S.S.S.Manikanta
Rollno: 322103311051
java

private double calculateWaterIntake(double weight, String activityLevel, String


weatherCondition) {

double baseWaterIntake = weight * 0.033;

if (activityLevel.equals("Moderate Activity")) baseWaterIntake *= 1.2;

if (activityLevel.equals("High Activity")) baseWaterIntake *= 1.5;

if (weatherCondition.equals("Hot")) baseWaterIntake *= 1.1;

return baseWaterIntake;

• Display the Result in textViewResult.

5. Enhancements and Edge Cases Handling

• Validate weight input (ensure it is numeric and not empty).

• Display an error message if input is invalid.

• Improve UI responsiveness by preventing multiple calculations at once.

6. Testing and Debugging

• Run the application on an Android emulator or a physical device.

• Test different input values and verify correct calculations.

• Check UI responsiveness on various screen sizes.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Output:

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week-4

Aim:
To create and set up a SQLite database in an Android application for managing student
attendance, allowing operations such as inserting, updating, deleting, and viewing
records.

Description:
This project involves setting up an SQLite database within an Android application to
store student details such as roll number, name, and marks. The application provides a
user interface to perform CRUD (Create, Read, Update, Delete) operations on the
student database.

Steps to Implement:
Step 1: Create a New Android Project

• Open Android Studio and create a new project with an Empty Activity template.

• Set up the MainActivity.java file as the main activity.

Step 2: Define UI Layout in activity_main.xml

• Design the UI using EditText for roll number, name, and marks input.

• Add Button components for Insert, Update, Delete, View, and View All actions.

• Example UI code snippet:

xml

<EditText android:id="@+id/Rollno" android:hint="Enter Roll No" />

<EditText android:id="@+id/Name" android:hint="Enter Name" />

<EditText android:id="@+id/Marks" android:hint="Enter Marks" />

<Button android:id="@+id/Insert" android:text="Insert" />

<Button android:id="@+id/Delete" android:text="Delete" />

<Button android:id="@+id/Update" android:text="Update" />

<Button android:id="@+id/View" android:text="View" />

<Button android:id="@+id/ViewAll" android:text="View All" />


Name: T.S.S.S.Manikanta
Rollno: 322103311051
Step 3: Initialize SQLite Database

• Open or create a database and define a student table in MainActivity.java.

• Code snippet:

java

db = openOrCreateDatabase("StudentDB", Context.MODE_PRIVATE, null);

db.execSQL("CREATE TABLE IF NOT EXISTS student(rollno VARCHAR, name VARCHAR,


marks VARCHAR);");

Step 4: Implement Insert Operation

• Add functionality to insert student records when the Insert button is clicked.

• Code snippet:

java

db.execSQL("INSERT INTO student VALUES('" + Rollno.getText() + "', '" +

Name.getText() + "', '" + Marks.getText() + "');");

Step 5: Implement Delete and Update Operations

• Add functionality to delete and update records based on the roll number.

• Code snippets:
Delete:

java

db.execSQL("DELETE FROM student WHERE rollno='" + Rollno.getText() + "'");

Update:

java

db.execSQL("UPDATE student SET name='" + Name.getText() + "', marks='" +


Marks.getText() +

"' WHERE rollno='" + Rollno.getText() + "'");

Step 6: Implement View and View All Operations

• Fetch and display individual or all student records.

• View Record:

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Java

Cursor c = db.rawQuery("SELECT * FROM student WHERE rollno='" + Rollno.getText() +


"'", null);

if (c.moveToFirst()) {

Name.setText(c.getString(1));

Marks.setText(c.getString(2));

• View All Records:

java

Cursor c = db.rawQuery("SELECT * FROM student", null);

while (c.moveToNext()) {

buffer.append("Roll No: " + c.getString(0) + "\n");

showMessage("Student Details", buffer.toString());

Step 7: Test the Application

• Run the app on an emulator or physical device.

• Test all CRUD operations and verify the database functionality.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Output:

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week-5
Aim:
To create an Android application that allows users to set an alarm using a TimePicker
and activate or deactivate it using a ToggleButton.

Description:
This project involves setting up an alarm in an Android app using AlarmManager,
PendingIntent, and BroadcastReceiver. The user selects a time from the TimePicker, and
the alarm plays a ringtone when triggered.

Steps to Implement:
Step 1: Create a New Android Project

• Open Android Studio and create a new project with an Empty Activity template.

Step 2: Define UI Layout in activity_main.xml

• Add a TimePicker for selecting the alarm time and a ToggleButton for
enabling/disabling the alarm.

xml

CopyEdit

<TimePicker android:id="@+id/timePicker" android:layout_width="wrap_content"


android:layout_height="wrap_content"/>

<ToggleButton android:id="@+id/toggleButton" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:onClick="OnToggleClicked"/>

Step 3: Set Up AlarmReceiver.java

• Implement a BroadcastReceiver to trigger the alarm.

java

CopyEdit

public class AlarmReceiver extends BroadcastReceiver {

@Override

public void onReceive(Context context, Intent intent) {

Toast.makeText(context, "Alarm! Wake up!", Toast.LENGTH_LONG).show();


Name: T.S.S.S.Manikanta
Rollno: 322103311051
Ringtone ringtone = RingtoneManager.getRingtone(context,
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM));

ringtone.play();

Step 4: Configure Alarm in MainActivity.java

• Set up AlarmManager to trigger the alarm at the selected time.

java

CopyEdit

Calendar calendar = Calendar.getInstance();

calendar.set(Calendar.HOUR_OF_DAY, alarmTimePicker.getCurrentHour());

calendar.set(Calendar.MINUTE, alarmTimePicker.getCurrentMinute());

Intent intent = new Intent(this, AlarmReceiver.class);

pendingIntent = PendingIntent.getBroadcast(this, 0, intent,


PendingIntent.FLAG_IMMUTABLE);

alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
10000, pendingIntent);

Step 5: Enable and Disable Alarm

• Toggle the alarm on or off using ToggleButton.

java

CopyEdit

if (((ToggleButton) view).isChecked()) {

Toast.makeText(this, "ALARM ON", Toast.LENGTH_SHORT).show();

alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, time, 10000,


pendingIntent);

} else {

alarmManager.cancel(pendingIntent);

Toast.makeText(this, "ALARM OFF", Toast.LENGTH_SHORT).show();

}
Name: T.S.S.S.Manikanta
Rollno: 322103311051
Step 6: Run and Test the Application

• Select a time and toggle the button to activate the alarm.

• Verify that the ringtone plays when the alarm is triggered.

Output:

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week-6
Aim:
To create an Android application that demonstrates how an alert notification (Toast
message) works when a user inputs a message and clicks a button.

Description:
This project involves developing a simple Android app where users enter a message in
an input field and press a button to display the message as a Toast notification. The app
uses EditText for input and a Button for triggering the alert.

Steps to Implement:
Step 1: Create a New Android Project

• Open Android Studio and create a new project with an Empty Activity template.

• Name the project MyAlertApp.

Step 2: Define UI Layout in activity_main.xml

• Add an EditText for user input and a Button for triggering the alert.

xml

CopyEdit

<EditText android:id="@+id/inputField" android:hint="Enter your message"/>

<Button android:id="@+id/notifyButton" android:text="Notify"/>

Step 3: Implement Alert Notification in MainActivity.java

• Set up the button click event to show a Toast message.

java

notifyButton.setOnClickListener(v -> {

String message = inputField.getText().toString();

Toast.makeText(MainActivity.this, message.isEmpty() ? "Please enter a message." :


message, Toast.LENGTH_SHORT).show();

});

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Step 4: Run and Test the Application

• Enter a message in the input field and click the Notify button.

• A Toast notification should display the entered message.

Output:

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week-7
Aim:
Develop an Android application that retrieves and displays the user's current GPS
location using Google's Fused Location Provider API.

Steps to Implement
1. Setting Up the Project

• Create a new Android project with an Empty Activity in Android Studio.

• Set the package name as com.example.gps.

• Ensure minSdkVersion is at least 24 for compatibility.

2. Adding Dependencies

• Open build.gradle (Module: app) and add the required dependencies:

gradle

CopyEdit

dependencies {

implementation("com.google.android.gms:play-services-location:21.0.1")

• Sync the project after adding dependencies.

3. Requesting Location Permissions

• Declare the necessary permissions in AndroidManifest.xml:

xml

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>

• Handle runtime permissions in MainActivity.java:

java

private final ActivityResultLauncher<String> requestPermissionLauncher =

Name: T.S.S.S.Manikanta
Rollno: 322103311051
registerForActivityResult(new ActivityResultContracts.RequestPermission(),
isGranted -> {

if (isGranted) {

getLocation();

} else {

Toast.makeText(this, "Permission Denied", Toast.LENGTH_SHORT).show();

});

4. Building the UI

• Design activity_main.xml to include a TextView and Button:

xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:gravity="center"

android:orientation="vertical"

android:padding="16dp">

<TextView

android:id="@+id/locationText"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Fetching location..."

android:textSize="18sp" />

<Button

android:id="@+id/getLocationButton"

android:layout_width="wrap_content"

Name: T.S.S.S.Manikanta
Rollno: 322103311051
android:layout_height="wrap_content"

android:text="Get Location" />

</LinearLayout>

5. Implementing Location Fetching

• Initialize FusedLocationProviderClient and fetch location:

java

FusedLocationProviderClient fusedLocationClient;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

locationText = findViewById(R.id.locationText);

getLocationButton = findViewById(R.id.getLocationButton);

fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);

getLocationButton.setOnClickListener(v -> getLocation());

private void getLocation() {

if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) ==
PackageManager.PERMISSION_GRANTED) {

fusedLocationClient.getLastLocation().addOnCompleteListener(task -> {

Location location = task.getResult();

if (location != null) {

locationText.setText("Latitude: " + location.getLatitude() + "\nLongitude: " +


location.getLongitude());

} else {
Name: T.S.S.S.Manikanta
Rollno: 322103311051
locationText.setText("Location not available");

});

} else {

requestPermissionLauncher.launch(Manifest.permission.ACCESS_FINE_LOCATION);

6. Handling Edge Cases

• Check if location is null and handle permission denial.

• Add a fallback mechanism or display appropriate messages.

java

if (location == null) {

locationText.setText("Unable to retrieve location");

7. Testing and Debugging

• Run the app on a physical device (emulators may not always provide location).

• Enable location services and ensure permissions are correctly handled.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Output:

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week – 8
Aim:
The aim of this week was to integrate a Room Database into the Resume App to store and
manage user resume data effectively. The database stores essential information such as
personal details, job title, skills, experience, education, and activities, ensuring data
persistence across app sessions.

Description:
The Resume App was enhanced by incorporating a local Room Database to allow users
to store and retrieve their resume information. Room was chosen due to its ease of use
and ability to map Java objects to SQLite tables effortlessly. The app maintains a
database to store all relevant data, including the user’s name, contact information,
skills, experience, and other resume details. This feature ensures that the resume data
remains accessible even after the app is closed.

Implementation Steps:
1. Database Setup:

• Added necessary Room dependencies in the build.gradle.kts file.

• Created a Room database with one table named resume_table to store all
resume-related data.

• Defined the schema for the table and ensured the use of a PrimaryKey to
uniquely identify each resume.

2. Entity Definition:

• Created a Resume.java class annotated with @Entity to define the table schema.

• Added required fields such as name, jobTitle, email, phone, summary, skills,
experience, and education in the entity.

• Implemented getter and setter methods for each field.

3. DAO Implementation:

• Developed the ResumeDao.java interface with the following methods:

o insert() to add a new resume.

o update() to modify existing resume data.

o delete() to remove a specific resume.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
o getResume() to fetch stored resume data.

4. Database Configuration:

• Created ResumeDatabase.java, an abstract class annotated with @Database to


link the entity and DAO.

• Initialized the database in MainActivity.java using the Room.databaseBuilder()


method.

• Implemented an instance of the database that ensures a single access point.

5. CRUD Operations Implementation:

• Implemented the following methods in MainActivity.java to perform CRUD


operations:

o saveResume() to insert or update resume information.

o loadResume() to fetch the stored resume and populate the UI fields.

o deleteResume() to remove unwanted resume records.

• UI components (btnGenerate, btnLoad, btnDelete) were linked to these methods


for interaction.

6. UI and Data Binding:

• Linked data fields (EditText) to database operations.

• Updated the btnGenerate and btnLoad buttons to handle save and load
operations, respectively.

• Ensured that resume data is displayed dynamically based on stored values.

7. Testing and Debugging:

• Verified that data insertion, updating, and retrieval work as expected.

• Ensured that changes in resume data reflect accurately in the UI.

• Fixed minor UI issues to provide a seamless user experience.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Source Code (Sample):

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week -9
Aim:
The aim for Week 9 is to implement the core functionality of the Resume App by
developing the backend logic using Java and Room Database (SQLite ORM). This
includes storing, retrieving, updating, and deleting resume data to ensure a seamless
experience for users.

Description:
In Week 9, the focus was on developing Java code for handling the application's core
functionality. The app uses Room Database to store resume data persistently. The Java
code ensures that user inputs are correctly processed, stored, and retrieved when
needed. The backend logic is linked to the UI designed in Week 8, ensuring smooth
interaction between the interface and the database.

Implementation Steps:
1. Setup Room Database:

• Configured Room Database to store and manage resume data.

• Created an Entity Class (Resume.java) to define the structure of the data.

• Implemented a DAO Interface (ResumeDao.java) with methods for:

o Adding new resume entries.

o Retrieving all saved resumes.

o Updating existing entries.

o Deleting resumes.

2. Create Entity Class (Resume.java):

• Defined fields such as:

o name, jobTitle, email, phone, website, socialLinks

o summary, skills, experience, education, activities

• Annotated the class with @Entity and specified a Primary Key.

3. Define DAO Interface (ResumeDao.java):

• Added methods for basic CRUD operations:


Name: T.S.S.S.Manikanta
Rollno: 322103311051
o @Insert – Insert new resume data.

o @Query – Retrieve all resume records.

o @Update – Update existing resume data.

o @Delete – Delete resume entries.

4. Create Room Database (AppDatabase.java):

• Implemented the abstract class AppDatabase.java that extends RoomDatabase.

• Defined the database version and added the ResumeDao for accessing the
database.

5. Develop Java Code for CRUD Operations:

• Created methods in MainActivity.java to perform the following actions:

o Add Resume: Save user input into the database.

o Load Resume: Retrieve and populate previously saved data.

o Update Resume: Modify existing data entries.

o Delete Resume: Remove specific resumes from the database.

6. Implement Data Persistence:

• Used SharedPreferences to temporarily store user input before committing it to


the database.

• Ensured data consistency by validating input fields before storing.

7. Link Java Code with UI:

• Connected Java code to the XML layout files using findViewById() and
ViewBinding.

• Implemented onClickListeners for buttons to trigger CRUD operations.

8. Testing and Debugging:

• Run multiple tests on the emulator and physical device to validate:

o Resume data is correctly stored and retrieved.

o CRUD operations function without errors.

o UI elements display correct data based on user interactions.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Sample Source Code :

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week -10
Aim:
The aim for Week 10 is to design and implement the User Interface (UI) for the Resume
App using XML layout files. The UI will provide an intuitive and easy-to-navigate
experience for entering and managing resume details. The XML files will be linked to the
Java code developed earlier to ensure seamless interaction between the UI and Room
Database.

Description:
In Week 10, the focus is on creating XML layout files that define the structure and
appearance of the app's screens. These layouts include forms for entering personal
information, skills, experience, education, and additional activities. The UI is designed
to ensure that users can easily navigate and fill out their resume information. The XML
files are integrated with the Java code to enable dynamic data entry and interaction.

Implementation Steps:
1. Design the Main Activity Layout:

• Created activity_main.xml for the main screen of the app.

• Included:

o EditText fields for resume details (Name, Job Title, Email, Phone, etc.).

o Buttons for generating and loading the resume.

o ScrollView to ensure smooth scrolling on smaller devices.

2. Create Layouts for Resume Data Input:

• Designed activity_main.xml with the following fields:

o Personal Information: Name, Job Title, Email, Phone, Website, and Social
Links.

o Professional Summary: A summary section.

o Skills Section: Text area to enter multiple skills.

o Experience and Education Sections: Fields to enter work experience and


educational qualifications.

o Additional Activities: Area to input extracurricular activities.


Name: T.S.S.S.Manikanta
Rollno: 322103311051
3. Create Layout for Viewing Generated PDF:

• Created a layout (activity_view_resume.xml) to display the generated PDF.

• Added a WebView to render the generated PDF file dynamically.

4. Use RecyclerView for List Display:

• Implemented RecyclerView to dynamically load lists of:

o Previously saved resumes for quick retrieval.

o Sections such as skills, experience, and education.

5. Input Validation and Error Handling:

• Used TextInputLayout and TextInputEditText for input fields to ensure clean


design and proper validation.

• Implemented error messages to alert the user about invalid input or incomplete
forms.

6. Integrate XML Layouts with Java Code:

• Linked the XML layouts to their corresponding Java activities using findViewById()
and ViewBinding.

• Set up listeners for button clicks to trigger saving and loading of data.

7. Testing the UI:

• Run the app on an emulator and physical devices to test the UI.

• Verified that:

o Input forms load correctly and allow user interaction.

o Buttons and inputs provide the expected responses.

o The generated PDF can be successfully previewed and stored.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Output:

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week-11
Aim:
The aim for Week 11 is to implement PDF generation and storage functionality in the
Resume App using iText7 Library. The app will allow users to generate a professional
resume in PDF format with formatted sections and save the file in the device’s storage.

Description:
In Week 11, the focus was on generating a professionally formatted PDF document
containing resume information entered by the user. Using the iText7 Library, the app
dynamically compiles the user-provided data (name, job title, contact details, skills,
experience, education, and activities) into a well-structured document. The PDF is
saved either in the Downloads folder (for Android versions below Q) or in the
Documents folder (for Android Q and above).

Implementation Steps:
Integrate iText7 Library:

• Added the required iText7 dependency in the project’s build.gradle file.

• Ensured that the correct version of the library is included to support PDF
generation.

Request Required Permissions:

• Added READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE


permissions in the AndroidManifest.xml file.

• Handled permission requests dynamically for Android versions below Q (API 29).

• Implemented a permission request launcher to prompt the user for necessary


permissions.

Create PDF Generation Method:

• Developed a createPdf() method to collect and format the resume data entered
by the user.

• Defined sections like Personal Details, Summary, Skills, Experience, Education,


and Activities.

• Incorporated appropriate text formatting for headings, subheadings, and


content.
Name: T.S.S.S.Manikanta
Rollno: 322103311051
Define PDF Layout and Formatting:

• Used appropriate text styling to define different sections of the resume.

• Applied consistent formatting for headings and data.

• Ensured the resume maintains a clean and professional layout in the PDF.

Save PDF to Device Storage:

• Implemented logic to save the generated PDF to the appropriate directory.

• Saved the PDF to the Documents folder for devices running Android Q and above
using MediaStore.

• Saved the PDF to the Downloads folder for devices running below API 29 using
FileOutputStream.

Generate and Display Success Message:

• Provided feedback to the user after successful PDF generation.

• Displayed a confirmation message indicating that the PDF has been saved
successfully.

Add Error Handling and Debugging:

• Implemented try-catch blocks to gracefully handle exceptions.

• Ensured error messages are displayed to the user in case of any failures during
PDF creation or file write operations.

• Validated that file creation and storage processes are handled securely.

Test PDF Generation and Storage:

• Conducted tests on both older and newer Android versions to verify storage
functionality.

• Verified that the PDF is stored correctly in the appropriate location.

• Ensured that all resume details entered by the user appear correctly in the
generated PDF.

Optimize File Storage for Compatibility:

• Optimized the logic to differentiate between file storage paths for different
Android versions.

• Ensured that PDF files generated by the app are accessible for viewing and
sharing.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Sample Codes :

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Week -12
Aim:
The aim for Week 12 is to finalize the flow of the Resume App and conduct thorough
testing to ensure that all features, including generating and loading resumes, work as
expected. This involves verifying the integration between the UI and backend, ensuring
that resume data is stored and retrieved accurately, and preparing the project for final
review and deployment.

Description:
In Week 12, the focus was on completing the project by ensuring the final flow and
performing end-to-end testing. This involved:

• Ensuring that all screens and functionalities, such as generating a resume and
loading previously generated data, are seamlessly connected.

• Testing the app for functionality, usability, and performance.

• Fixing any bugs or issues identified during testing.

• Preparing the project for final submission and ensuring that all requirements
were met.

Implementation Steps:
1. Finalize App Flow:

• Ensured that all activities and XML layouts were correctly linked to the Java code.

• Verified that:

o Clicking the Generate Resume button creates and saves a resume as a


PDF.

o Clicking the Load Resume button retrieves and displays previously stored
data using SharedPreferences.

2. Test Resume Generation:

• Verified that the Generate Resume button:

o Collects input data correctly from all text fields.

o Creates a properly formatted PDF with the resume data.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
o Saves the PDF to the appropriate location (Downloads or Documents
folder).

• Checked different edge cases, such as:

o Empty fields triggering appropriate error messages.

o Proper handling of invalid or incomplete input data.

3. Test Data Loading:

• Ensured that clicking the Load Resume button:

o Retrieves previously stored resume data from SharedPreferences.

o Populates all relevant fields accurately.

o Displays a confirmation toast when data is loaded successfully.

4. Conduct Usability Testing:

• Conducted testing to ensure that the app is user-friendly and easy to navigate.

• Verified that:

o Input fields are clearly labeled.

o The app layout is clean and intuitive.

o Buttons and controls respond correctly to user actions.

o Users can navigate through the app seamlessly.

5. Perform Performance Testing:

• Tested the app for performance issues:

o Checked loading times when generating or loading resumes.

o Ensured that the app handled large amounts of input data without
crashing.

o Verified smooth interaction between the UI and backend functionality.

6. Fix Bugs and Issues:

• Addressed issues identified during testing, including:

o Incorrect data retrieval from SharedPreferences.

o UI inconsistencies and crashes when clicking buttons too quickly.

o Fixed any formatting issues with the generated PDF.

Name: T.S.S.S.Manikanta
Rollno: 322103311051
7. Prepare for Final Review:

• Documented the testing process and results, including any identified issues and
their resolutions.

• Prepared a final report summarizing:

o The app's features and functionalities.

o Outcomes of the testing process.

o Any remaining tasks or enhancements for future updates.

Output :

Name: T.S.S.S.Manikanta
Rollno: 322103311051
Name: T.S.S.S.Manikanta
Rollno: 322103311051

You might also like