First revision

So far the app is very basic. It has a main page from where you can start your ironing or view the results.
It just times each of your shirts and stores the result in seconds in a SQLite database. This is the first database access stuff that I have done. It is pretty straightforward. I used the first of the Notepad tutorials as a guide.

This is the ironing page. I used a Chronometer to do the timing. This is a Chronometer example from the Android site, which is useful, but does not really tell you how to get the elapsed times. This is of course what you need for any stopwatch type activity. This is  how I did that. 







Here is the onClick() code from my Next Shirt button:
            @Override
            public void onClick(View v) {
                long elapsedMillis = SystemClock.elapsedRealtime()
                        - mChronometer.getBase();

                DataAccess data = new DataAccess(getApplicationContext());
                data.open();
                data.createTimeEntry((int) (elapsedMillis / 1000));
                mChronometer.setBase(SystemClock.elapsedRealtime());

            }




When I first set up the Chronometer in the onCreate method of my IroningActivity I set its
base to the SystemClock.elapsedRealtime(). Each time the Next Shirt button is clicked
the number of milliseconds that have elapsed since the last click are calculated. The base
of the Chronometer is then reset to the SystemClock.elapsedRealtime.

My results page is pretty bad so far, but in as much as it reads the results from the database and sort of displays them, I have happy enough. It needs a bit of work, but it will do for now. 
The results that you see are the time of a shirt along with the id of the record. They are concatenated. I have not figured out how to format them properly yet, but I am getting there. 











Things still to do:
  • The results just keep piling up. There is no idea of this weeks ironing session vs last weeks. They just pile up. Like the shirts if you don't get to them. Need to Fix this so that week to week can be compared, averages computed etc. 
  • Formatting of the results ListView.
  • Pause button in case you need to answer the phone or something. For competitive ironers who would otherwise miss that call from their Ma. 
  • Some way of allowing comparison of users stats with each other. 


Comments

Popular posts from this blog

Building a choropleth map for Irish agricultural data

Early Stopping with Keras

AutoCompleteTextView backed with data from SQLite in Android