Access Millions of academic & study documents

AddressBook ModificationClass ScheduleChange the Address Book ap

Content type
User Generated
Showing Page:
1/5
AddressBook Modification
Class Schedule
Change the Address Book application to keep track of the
classes already taken by student. Each Class has a
Department, coursenumber, number of credits, Subject (M-
Math, C-Computer,E-English,P-Psychology), and the final
grade.
Your solution should change the database and all relevant
labels. The Host Activity should list all the course numbers
of the classes in the database
https://github.com/anistark/AddressBook
Solution
package com.stark.addressbook;
ContentValues newContact = new ContentValues();
newContact.put(\"name\", name)\'
newContact.put(\"dept\", dept);
newContact.put(\"credits\", credits);
newContact.put(\"courseNo\", courseNo);
package com.stark.addressbook;import
android.content.ContentValues;import
android.content.Context;import
android.database.Cursor;import

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/5
android.database.SQLException;import
android.database.sqlite.SQLiteDatabase;import
android.database.sqlite.SQLiteOpenHelper;import
android.database.sqlite.SQLiteDatabase.CursorFactory;pu
blic class DatabaseConnector{// database nameprivate
static final String DATABASE_NAME =
\"UserContacts\";private SQLiteDatabase database; //
database objectprivate DatabaseOpenHelper
databaseOpenHelper; // database helper// public
constructor for DatabaseConnectorpublic
DatabaseConnector(Context context){// create a new
DatabaseOpenHelperdatabaseOpenHelper =new
DatabaseOpenHelper(context, DATABASE_NAME, null,
1);} // end DatabaseConnector constructor// open the
database connectionpublic void open() throws
SQLException{// create or open a database for
reading/writingdatabase =
databaseOpenHelper.getWritableDatabase();} // end
method open// close the database connectionpublic void
close(){if (database != null)database.close(); // close the
database connection} // end method close// inserts a new
contact in the databasepublic void insertContact(String
name, String email, String phone,String state, String city){
ContentValues newContact = new ContentValues();
newContact.put(\"name\", name)\'

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/5

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 5 pages?
Access Now
Unformatted Attachment Preview
AddressBook Modification Class Schedule Change the Address Book application to keep track of the classes already taken by student. Each Class has a Department, coursenumber, number of credits, Subject (M Math, C-Computer,E-English,P-Psychology), and the final grade. Your solution should change the database and all relevant labels. The Host Activity should list all the course numbers of the classes in the database https://github.com/anistark/AddressBook Solution package com.stark.addressbook; ContentValues newContact = new ContentValues(); newContact.put(\"name\", name)\' newContact.put(\"dept\", dept); newContact.put(\"credits\", credits); newContact.put(\"courseNo\", courseNo); package com.stark.addressbook;import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteDatabase.CursorFactory;pu blic class DatabaseConnector{// database nameprivate static final String DATABASE_NAME = \"UserContacts\";private SQLiteDatabase database; // database objectprivate DatabaseOpenHelper databaseOpenHelper; // database helper// public constructor for DatabaseConnectorpublic DatabaseConnector(Context context){// create a new DatabaseOpenHelperdatabaseOpenHelper =new DatabaseOpenHelper(context, DATABASE_NAME, null, 1);} // end DatabaseConnector constructor// open the database connectio ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4