Homework 5 Content Provider

blareweyrΛογισμικό & κατασκευή λογ/κού

13 Δεκ 2013 (πριν από 3 χρόνια και 10 μήνες)

110 εμφανίσεις

Homework 5



Content Provider



Due Date
:

June 21
th
, Friday, at 11:59pm

Second Deadline
: June 23
th
, Sunday, at 11:59pm


Submission
:

gt10e@my.fsu.edu
,


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 w
ith “Got it” when I see it







C桥捫c扡c欠to t桩s 摯捵m敮t l慴敲 i渠捡獥 t桥re 慲攠異摡t敳

Y潵r 潢j散瑩e攠for t桩猠桯m敷潲欠i猠to 扵il搠d桥 扡捫
-
敮搠摡t慢慳a to e潭敷潲o 2! Y潵

will 扥 捲敡ting a Sn䱩te D慴慢慳a t漠桡湤l攠t桩猠t慳欮


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

3

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 o
f 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


1

Crea
te 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

2

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

3

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