$30
In this assignment you will begin development of the Wildlife Tracking application (Animal Tracker). The application will store data within a SQLite database (http://www.sqlite.org/) and present the user with the functionality to add a new sighting, update an existing siting, and delete a sighting.
At this point, the database will consist of a single table, called “ANIMALS”, which is shown below.
Table Name: ANIMALS
_id INTEGER PRIMARY KEY AUTOINCREMENT
animal_type_cd INTEGER FOREIGN KEY TO ANIMAL TYPE TABLE. THE
ANIMAL TYPE TABLE WILL BE CREATED IN THE
FUTURE. THE DEFAULT VALUE IS 0.
count_no INTEGER THE NUMBER OF ANIMALS SEEN DURING THE
SIGHTING
seenon_dtm TEXT THE DATE AND TIME OF THE SIGHTING
comments_txt TEXT FREE FORMAT COMMENTS
In SQLite, TEXT is a reasonable data type to store date, time, and datetime values. See http://www.sqlite.org/lang_datefunc.html for details.
Create a class that interacts with the SQLite database to perform the following operations:
ADD, UPDATE, DELETE (physical), LIST (select all records), and INQUIRE (select one record, by key).
Figure 1 (below) shows the overall flow of the complete the wildlife sightings application. The application will allow the user to view the list of all animal sightings, add a new sighting, view details on a single sighting, modify a sighting, and remove a sighting.
Start Animal Sighting List
View Update
Add
Remove
Exit
Develop the Animal Sighting List activity and the Add activity so that new animal sightings may be created and stored in the database. Only the List and Add activities need to be completed for this assignment.
All literal string data must be contained within the strings files (SQL/DML/DDL strings are exempt).
The application must not crash due to invalid or missing input.
CISP340 – Assignment #6
In this assignment you will complete the Animal Tracker application and extend the SQLite database to include a table that indicates the type of animal what was seen. The ANIMALTYPE
table is shown below.
ANIMALTYPE Table (new)
animal_type_cd INTEGER PRIMARY KEY PRIMARY KEY
animal_type_nm TEXT Contains the name of the animal
Populate the ANIMALTYPE table with the data given below.
animal_type_cd animal_type_nm
1 Squirrel
2 Rabbit
3 Deer
4 Fox
5 Skunk!
6 Bald Eagle
This database version will be version 2. Ensure that the database class is properly coded to support a database upgrade from version 1 to version 2.
Complete the wildlife sightings application so that the user can view the list of all animal sightings, add a new sighting, view details on a single sighting, modify a sighting, and remove a sighting. Figure 1 (below) shows the overall flow of the program.
Start Animal Sighting List
View Update
Add
Remove
Exit
Figure 1
The animal sighting List screen should only contain the type of animal and the date.
The View activity should display all the fields in the database for the specific sighting in readonly controls, while the update screen should show the same information, but only allow the count and the comments to be changed and saved back to the database. After the record is updated return the List screen. If the user cancels the update, return to the View screen.
The remove (delete) functionality from the View screen is an option menu that utilizes and Alert dialog to ask the user if the current record should be deleted. If the answer is ‘no’, then remain on the View screen. If the answer is ‘yes’, then delete the record and return to the List screen.
The add activity should allow a new animal sighting to be added to the database. Upon completion, the user should be returned to the list activity.
All literal string data must be contained within the strings files (SQL/DML/DDL strings are exempt).
.