Practical tasks to perform and ensure that the basis of the chapter has been understood.
The assignment is mandatory for a passing grade in the course.
Store in SharedPreferences
Add persistant storage to previous assignments Summarizer and Conversion using SharedPreferences. You must perform both of the following tasks to complete the assignment.
Add persistant storage to the previous mandatory assignment from chapter 1 called Summarizer. Use the SharedPreferences API on Android to store the current total in the application, and read it back when the application starts.
Add persistant storage to the previous mandatory assignment from chapter 3 called Conversion. Use the SharedPreferences API to store the current value of the SeekBar, and read it back when the application starts (and set the position of the SeekBar accordingly).
Perform this optional assignment to get one (1) extra credit.
Create an application that stores products and prices in a SQLite databas and displays them in a ListView. Note that this assignment has been changed to include a SQLite database. If you've already created or started on it using the previous specification of storing in a ArrayList<HashMap<String,String>> object, that is ok too!
Create a layout with a ListView, two EditText elements and a Button. The two EditText elements shall be used to specify a product name and a product price. The Button shall be used to add new products to the list.
Organize the elements in any way you like and feel free to add TextViews to show a label for the EditText elements if you like. Style them and use any kind of nested LinearLayouts in order to show them nicely in the user interface. The ListView should be set to extend to whatever height remains in the application after the other elements have been layed out.
Create code for storing all products and their prices in a SQLite database table.
When the user presses the Button, a new product object should be created and have its name and price set from the EditText elements. Add the new object to the database table that you created in the previous step.
Use a SimpleCursorAdapter for the ListView to display the products. Choose any layout xml that you like to display the individual items/rows in the list. You can use the built-in android.R.layout.simple_list_item_1 if you like.
Note that your app does NOT have to support editing or deleting of products. Just adding and displaying the products is enough to complete the assignment.