Homework 5 – Content Provider

Due Date: June 21th, Friday, at 11:59pm
Second Deadline: June 23th, Sunday, at 11:59pm
Submission: ,
Note: I will give you a rubric which specifies the spec that works and not. It also needs to tell me what extra credits you implemented. Please submit the rubric.txt file along with your .zip file.
Title: Mobile Programming Homework 5
I will reply to your submission email with “Got it” when I see it

Check back to this document later in case there are updates

Your objective for this homework is to build the back-end database to Homework 2! You

will be creating a SQLite Database to handle this task.

REQUIREMENTS

1  Android version: make it work on any flavor of Android that you want. Make it work on your development device if you can

2  If you got a minus on Homework 2, then you need to fix the issues in Homework 2 before you continue, otherwise you still won’t get full credit

Create a ContentProvider that will manage access to your data

a  Your CREATE TABLE statement should of course create the necessary table with the appropriate columns

i  | fname | lname | pnumber | … | country |

b  You will need an inner class that extends SQLiteOpenHelper

i  You can name your database whatever you want

c  You need have implementation for these ContentProvider methods

i  onCreate()

ii  insert()

iii  delete()

iv  query()

d  The form checking should be the same as HW2.

i  You shouldn’t allow duplicate usernames

e  Instead of making the TextView background red, you may alert the user of an error however you want to, just make sure that its user-friendly (don’t do a million Toasts back to back!)

GRADING

To get a check plus on this assignment, choose one of the following

Create a separate Activity that houses a ListView with the contents of the database

●  Use a SimpleCursorAdapter to map the contents of the database to a custom row

■  i.e. create your own row.xml file that will represent each row in the list

●  Allow for deleting a user from the database

■  you can handle this how you like, just make it user-friendly, e.g.

●  A long press shows a context menu with the option to delete

Create a separate Activity that can navigate between the contents of the database

●  The Activity should show all details of a single user, starting with the first contact

●  TextViews

■  TextViews showing ALL contact information

●  First name

●  Last name

●  Username

●  Phone number

●  Email

●  Password

●  Gender

●  Country

●  EditTexts

■  Record Number EditText

●  allows the user to enter an integer

●  Buttons

■  Go Button

●  navigate to the record number indicated by the number in the EditText

■  Next Button

●  advances the cursor and shows the details of the next contact

●  if you’re already at the end of the list, then the “next contact” in this case will be the first contact

■  Previous Button

●  shows the details of the previous contact

●  if you’re already at the beginning of the list, then the “previous contact” in this case will be the last contact

■  Delete Button

●  remove the current user

●  after removing the user, you can handle this how you wish, e.g.

○  go to either the next user in the list or the previous user in the list

○  if all users have been deleted, then go back to the Activity with the form

If you have a different idea that requires extra work, email me about it before you implement it, then I will let you know if you can get a check-plus