Question
public class DatabaseHandler extends _________________________ //(1) // Database Version private static final int DATABASE_VERSION = 1 ; // Database Name private static final String DATABASE_NAME
public class DatabaseHandler extends _________________________ //(1)
// Database Version private static final int DATABASE_VERSION = 1 ; // Database Name private static final String DATABASE_NAME = "seu";
// Contacts table name private static final String TABLE_CONTACTS = "Contacts";
// Contacts Table Columns names private static final String KEY_ID = "id"; private static final String KEY_FIRST_NAME = "first_name"; private static final String KEY_LAST_NAME = "last_name"; private static final String KEY_MOBILE_NUMBER = "mobile_number"; private static final String KEY_EMAIL_ID = "email_id"; private static final String KEY_USER_ID = "user_id"; private static final String KEY_PASSWORD = "password"; private static final String KEY_ROLE = "user_role"; public DatabaseHandler(Context context) {
________________________________________ //(2) }
// Creating Table Contacts @Override
public void onCreate(SQLiteDatabase db) { //(3)
Consider that you are a developing an app for your university that stores the contacts details for all faculty members.
Complete the DatabaseHandler class
Complete the missing code (1) & (2)
Create the Contacts table (3). The static variables in the code represent the column names for the table to store the information.
Complete the DataSource class
Complete the missing code (4) & (5)
Insert a record into the Contacts table. Use any values for each table column (6)
Retrieve the contact last_name of a specific id (passed as parameter) (7)
Update the contact mobile phone of a specific user_id (8)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started