ACADEMIC YEAR 2024-25
MCA II – SEMESTER III
Course Code: IT-31
Course Name: Mobile Application Development
Assignment
Name: Amisha Rajendra Chindarkar
[Link]
Date:26/10/2024
CO mapping of Marks:
CO1 CO2 CO3 CO4 CO5 TOTAL
Q1 25
25
[Link] Record Generation App Development
This case study explores the development of a mobile app for students’ records creation.
1. Planning and Requirement Gathering:
1. Identification Information
• Student ID: Unique identifier for each student.
• Name: Full name (First Name, Middle Name, Last Name).
• Date of Birth: To calculate age or for age-based groupings.
• Gender: Male, Female, Other.
• Profile Picture (optional): For easy recognition.
2. Academic Information
• Course/Program: Current course or program name (e.g., BSc Computer Science).
• Year of Study: E.g., 1st year, 2nd year.
• Department: Specific department within the institution.
• Enrollment Year: The year the student enrolled in the course.
3. Contact Information
• Address:
o Street Address
o City o
State/Province
o Postal/ZIP
Code
• Phone Number: Primary contact number.
• Email Address: For communication and updates.
4. Optional Fields (Depending on Needs)
• Nationality: Useful for institutions with international students.
• Emergency Contact: Name, relationship, and contact number.
• Enrollment Status: Active, Graduated, On Leave, etc.
Identify Key Features:
1. Show (search) Students
Keyword show: Enable show by name, student ID, or other keywords.
2. Saving (Adding) Records
• Data Entry Forms: A clear, organized form to enter student details (ID, name,
course, address, etc.).
• Form Validation: Ensure mandatory fields are filled in (e.g., ID, name) and validate
field formats (e.g., email, phone number).
• Data Storage: Save records to a local or cloud database with encryption, if necessary,
to protect student data.
3. Updating Records
• Edit Functionality: Allow existing records to be edited with up-to-date information,
like new addresses or contact information.
• Version Tracking (Optional): Maintain a history of changes for future reference if an
institution requires it.
• Confirmation Prompts: Ask for confirmation before saving changes to prevent
accidental updates.
4. Deleting Records
• Delete Option: Enable record deletion with a single action, accessible from search
results or within each record.
• Soft Delete (Optional): Archive deleted records instead of completely removing
them, allowing for recovery if needed.
• Confirmation Pop-up: Include a confirmation dialog to avoid accidental deletions.
2. Design and Prototyping:
1. Main Dashboard
• Top Navigation Bar: Include the app’s name, user profile, and essential icons (like
settings or logout).
• Primary Actions: Use large, distinct buttons for major actions:
o Add New Record o show Student
o View All Records
2. Add/Update Record Form
• Sectioned Form Layout: Divide the form into sections with clear headings, like
Personal Info, Academic Info, and Contact Details.
• Visual Cues for Mandatory Fields: Mark required fields with asterisks and use
placeholders for guiding information (e.g., “Enter Student ID”).
• Save & Cancel Buttons: Place these at the bottom, ensuring they are well-spaced,
distinct, and easy to access on all device sizes.
• Error Messages: Display clear, specific error messages for invalid entries, close to
the field in question.
3. Record Viewing Screen
• Profile Overview at the Top: Display a student’s name, ID, and profile picture (if
applicable).
• Tabbed Interface for Details: Organize information into tabs like Personal Info,
Academic Info, and Contact Details.
• Edit and Delete Options: Place Edit and Delete buttons prominently, possibly in the
top right, for quick access.
4. Visual Hierarchy and Design Principles
• Consistent Color Coding: Use colors to differentiate action buttons and form
sections (e.g., blue for primary actions, gray for secondary).
• Font and Text Size: Use larger, bold fonts for headers, and smaller, readable fonts for
details.
• Spacing and Alignment: Ensure adequate spacing between elements to avoid clutter,
and align fields and buttons for a neat look.
• Icons for Quick Identification: Use icons for actions like edit, delete, and search to
make navigation more intuitive.
3. Coding:
[Link] –
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
EditText editTextPRN, editTextName, editTextEmail, editTextPhone, editTextCourse;
Button btnAdd, btnShow, btnUpdate, btnDel;
DBHelper dbHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
editTextPRN = findViewById([Link]);
editTextName = findViewById([Link]);
editTextEmail = findViewById([Link]);
editTextPhone = findViewById([Link]);
editTextCourse = findViewById([Link]);
btnAdd = findViewById([Link]);
btnShow = findViewById([Link]);
btnUpdate = findViewById([Link]);
btnDel=findViewById([Link]);
dbHelper = new DBHelper(this);
[Link](new [Link]() {
@Override
public void onClick(View v) {
int prn = [Link]([Link]().toString());
String nm = [Link]().toString();
String email = [Link]().toString();
String ph = [Link]().toString();
String crc = [Link]().toString();
boolean result = [Link](prn, nm, email, ph, crc);
if (result)
[Link]([Link], "Record added successfully",
Toast.LENGTH_SHORT).show()
else
[Link]([Link], "Sorry Some error",
Toast.LENGTH_SHORT).show();
}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
int prn = [Link]([Link]().toString());
Cursor result = [Link](prn);
if ([Link]() != 0) {
[Link]();
[Link]([Link](1));
[Link]([Link](2));
[Link]([Link](3));
[Link]([Link](4));
} else {
[Link]([Link], "Record not found",
Toast.LENGTH_SHORT).show() }}
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
int prn = [Link]([Link]().toString());
String nm = [Link]().toString();
String email = [Link]().toString();
String ph = [Link]().toString();
String crc = [Link]().toString();
boolean result = [Link](prn, nm, email, ph, crc);
if (result)
[Link]([Link], "Record Updated successfully",
Toast.LENGTH_SHORT).show();
else
[Link]([Link], "Sorry Some error in updating record",
Toast.LENGTH_SHORT).show(); }
});
[Link](new [Link]() {
@Override
public void onClick(View v) {
int prnno=[Link]([Link]().toString());
boolean result=[Link](prnno);
if(result)
[Link]([Link], "Record deleted successfully",
Toast.LENGTH_SHORT).show();
else
[Link]([Link], "Some error in deletion",
Toast.LENGTH_SHORT).show();
} });
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Students Data"
android:textSize="25sp"
android:layout_gravity="center"
android:layout_marginTop="25dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Student PRN No."
android:id="@+id/etPRN"
android:inputType="number"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Student Name"
android:id="@+id/etName"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Email Id"
android:id="@+id/etEmail"
android:inputType="textEmailAddress"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Phone No. "
android:id="@+id/etPh"
android:inputType="phone"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Course"
android:id="@+id/etCourse"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/btnAdd"
android:text="Add"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/btnUpdate"
android:text="Update"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/btnDelete"
android:text="Delete"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/btnShow"
android:text="Show"/>
</LinearLayout>
</LinearLayout>
[Link] –
package package [Link];
Import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class DBHelper extends SQLiteOpenHelper {
private static final String dbname = "mydb";
private static int VERSION = 1;
SQLiteDatabase sqLiteDatabase;
private final String TAG = "DBHelper";
public DBHelper(Context context) {
super(context, dbname, null, VERSION);
Log.i(TAG, "Dbhelper constructor called");
}
@Override
public void onCreate(SQLiteDatabase db) {
[Link]("create table student(prnno int primary key,sname varchar(30) not null,
"+
"email varchar(30), phone varchar(10), course varchar(3))");
Log.i(TAG, "Table created");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
boolean addRecord(int prn, String sn, String mail, String ph, String crc) {
sqLiteDatabase = getWritableDatabase();
ContentValues contentValues = new ContentValues();
[Link]("prnno", prn);
[Link]("sname", sn);
[Link]("email", mail);
[Link]("phone", ph);
[Link]("course", crc);
long i = [Link]("student", null, contentValues);
if (i > 0) {
Log.i("DBHelper", "Record added");
return true;
} else {
Log.i(TAG, "Some error in adding");
return false; }
}
Cursor showRecord(int prn) {
sqLiteDatabase = getReadableDatabase();
Log.i(TAG, "inside show record");
Cursor cursor = [Link]("select * from student where " +
" prnno=" + prn, null);
return cursor; }
boolean updateRecord(int prn, String nm, String mail, String ph, String crc) {
sqLiteDatabase = getWritableDatabase();
String p = [Link](prn);
ContentValues contentValues = new ContentValues();
[Link]("prnno", prn);
[Link]("sname", nm);
[Link]("email", mail);
[Link]("phone", ph);
[Link]("course", crc);
long i = [Link]("student", contentValues, "prnno = ?", new
String[]{p});
if (i > 0) {
Log.i(TAG, "Record updated");
return true;
} else {
Log.i(TAG, "Record not updated");
return false;
}}
boolean deleteRecord(int prn) {
sqLiteDatabase = getWritableDatabase();
String p = [Link](prn);
long i = [Link]("student", "prnno=?", new String[]{p});
if (i > 0)
return true;
else
return false; }
Output – Add page
Update page
Delete Page