Assignment 4 – Car Maintenance 0.2

Car Maintenance

Version: 0.2

By: James Burton

This program implements a database that keeps track of maintenance for your various vehicles. It can be used by an individual, a family, or a fleet/motor pool.

Add information into the tables on the screen. Each screen corresponds to a table in the schema.

This is an updated and enhanced version of Car Maintenance 0.1.

Database Schema

Assignment4

Vehicle: Vehicle (e.g. Batmobile)

Item: Maintenance Item (e.g. Change the oil every 5000 miles or 6 months.)

Location: Service shop. (e.g. Jiffy Lube)

Receipt: All work done at a location, and date (e.g. Service at Jiffy Lube on 2/22/2014)

Work: Work performed (e.g. Change the oil as part of service done at Jiffy Lube on 2/22/2014 for Batmobile).

(Note: The menu option Create Data on the main screen creates a sample database for testing purposes.)

MySQL database schema:

SQLite database schema:

Changes for 0.2:
Timestamps were added, but not used. Also mileage was moved from Receipt table to Work table because of it’s association with a Vehicle.

This schema applies to both the internal and the external database. Data is stored on the external database and mirrored on the internal database for caching purposes. The only difference between the schemas is that are indices are only automatically generated on the external database.

Currently, the app assumes the external data is always right and the internal data is expendable. Data integrity is maintained by the internal SQLite database not being updated unless the external MySQL database has been successfully updated. A menu option on the main screen will force a refresh of the internal database from the external database.

Download

Source: https://github.com/jdburton/CarMaintenance

Latest Binary: https://github.com/jdburton/CarMaintenance/blob/master/bin/CarMaintenance.apk

Screenshots

New Functionality:

Home screen with Preferences button and Menus

Home screen with Preferences button and menus

Screen Shot 2014-03-09 at 1.01.59 PM

Preferences screen

Work Screen with Autosave enabled. Notice Detail Icon and no Save icon.

Work Screen with Autosave enabled. Notice Detail Icon and no Save icon.

Work detail screen with receipt image.

Work detail screen with receipt image.

Receipt screen with image

Receipt screen with image

Receipt Detail screen with image and camera icon.

Receipt Detail screen with image and camera icon.

Image capture screen to take pictures of receipt images. Receipts are automatically removed on receipt delete.

Image capture screen to take pictures of receipt images. Receipts are automatically removed on receipt delete.

Select with green color theme.
Select with green color theme.

Preferences

Autosave

  • Should App automatically save changes or require you to press save button?

Color Theme

  • Color for table selection highlighting. Default is Blue.

BaseURL

  • URL location of scripts to access external database. Be sure to include trailing /

Cool Stuff

Version 0.2

  • Multiple color select on table screens.
  • Detail screens for Work and Receipt tables.
  • Image capture.
  • File I/O. Receipt images are saved in Application directory on the external SD card.
  • Database synchronization.

Version 0.1

  • Date Picker Dialog
  • Image Selection from Android gallery
  • Dynamically generated spinners
  • Dynamic table generation
  • HTML about page
  • Multiple action bars

Acknowledgements

In addition to all the help I received from Car Maintenance 0.1.

Images

Started with this http://developer.android.com/training/camera/photobasics.html BUT, the tutorial has an error. See http://stackoverflow.com/questions/13912095/java-lang-nullpointerexception-on-bundle-extras-data-getextras

Android Hive working with Camera API: http://www.androidhive.info/2013/09/android-working-with-camera-api/

Rotating images from http://www.higherpass.com/Android/Tutorials/Working-With-Images-In-Android/3/

Dialog to pick image from camera: http://stackoverflow.com/questions/10165302/dialog-to-pick-image-from-gallery-or-from-camera

How to delete a file: http://www.mkyong.com/java/how-to-delete-file-in-java/

Detail Screens

Passing an object in an intent: http://www.tutorialspoint.com/java/java_serialization.htm

Preferences

Preferences from http://developer.android.com/guide/topics/data/data-storage.html

Settings dialog derived from information at http://developer.android.com/guide/topics/ui/settings.html

Radio button in preferences: http://stackoverflow.com/questions/6148952/how-to-get-selected-text-and-value-android-listpreference and http://stackoverflow.com/questions/4966816/how-to-create-radiobutton-group-in-preference-xml-window

Database

Everything you need to know about connecting an Android application to a MySQL database via PHP. BEST. TUTORIAL. EVER. http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

Testing http POST/GET with curl http://stackoverflow.com/questions/1087185/http-testing-tool-easily-send-post-get-put

Workaround for truncating table that is a foreign key in MySQL: http://stackoverflow.com/questions/5452760/truncate-foreign-key-constrained-table

Other

Eclipse PTI-PHP Tool integration plugin. Available in the Eclipse Marketplace. Update site is at http://www.phpsrc.org/eclipse/pti/

MacOS Mavericks built-in Apache server. Great for development testing.

Advertisements
Tagged with:
Posted in Android Development

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: