Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

More Books

Students also viewed these Databases questions

Question

Derive expressions for the rates of forward and reverse reactions?

Answered: 1 week ago

Question

Write an expression for half-life and explain it with a diagram.

Answered: 1 week ago

Question

What do you mean by underwriting of shares ?

Answered: 1 week ago

Question

Define "Rights Issue".

Answered: 1 week ago