29 December 2011

Post Christmas update!

I haven't had much time to dive back in to the driver tools project yet, with all of the social events going on over the Christmas holidays. This is going to change by tomorrow. Either later on tonight or tomorrow morning, I'm going to figure out how to get google analytics working properly, and I'll be looking in to setting up some app data with regards to the car that a user will select. I'll have an update soon

18 December 2011

Deadline status update.

Today is the deadline I set for a releasable version of this project. The app is divided in to four parts. It has a tool for logging fuel transactions, a tool for picking and displaying information about your car, a tool for displaying information graphically about a user's driving habits and a tyre section for optimising wheel size and tyre pressure for maximum performance and economy. So far I have a beta version of the transaction and graphing tools and as as of tonight I can say that the car picker tool is now out of alpha and in to beta. The tyre pressure calculator can be done at a later point, and I'm not all that concerned about that for the minute.

The app in it's current state could be released on the market, however the styling of the app is not currently at the level of that which was originally envisaged and as a result of this fact I will not release the app to the market yet.

Currently all of the core functionality for in the beta version of the app has been implemented, but before I release it I would like to include google ads and goolge analytics and then clean up the interface to make it look as good as it can. So to summarise, the app functionality requirements have mostly been met but I will not be releasing the app just yet.

14 December 2011

Checklist update

I've added most of the functionality to the database adapter for pulling out and inserting the data to and from the database. There's still a bit of testing that needs to be done, and there are a number of tables that I just haven't bothered implementing yet. I'll update these at a later point.

I've also modified the car picker tab to now display all of the cars in a table format, much in the same way the fuel transactions are displayed. I may change this to a relative layout which would look a lot better. The basic functionality is there. I also still need to test this class fully.

I've also identified a number of short cuts I can take now, such as the car manufacturer and model tables in the database because I won't actually be using them yet. I've taken out the blob column in the car database until I can research if there's a better way of storing such images. But I can knock off two and a half items from my check list. More will be done tomorrow.

Structured development time and to do list

I saw this blog post on linkedin there and I can see how a number of the things mentioned in the article hinder productivity. In particular multi tasking. Multi-tasking is bullshit.

I'm going to list out a number of different things I'd like to get done tonight and tomorrow night. These will be small steps of implementation which will lead me towards completing the integration of the new database schema and hopefully it will get put me on time for release on Sunday night. Also, I'm going to try and code in blocks of an hour at a time, then go do something else for a bit, and come back. I always thought it was a good idea to go and take a break, which usually consisted of a cigarette break in college, and by the time I came back to my computer I would practically have the problem solved. When you look at something after taking a break, sometimes the solution just jumps out at you and it appears so obvious that you feel embarrassed you had a problem with it in the first place. I can definitely see structuring my time like this benefiting my development.

  • Add method to database adapter for getting all cars as a list of cars, similar to the way transactions are retrieved.
  • Add view for displaying cars in cars tab.
  • Add method of adding, editing and deleting cars.
  • Add session data so that app can store which car is selected. To be used for adding relating car to transactions.
  • Fix transactions so that only those for the car that's selected for the session are displayed.

If I get half of these done tonight I'll be doing well. I'll try get a mix of the more complex and more simple ones done tonight, and do the same again tomorrow night.

12 December 2011

Database changes and plans to save the state of the app.

It's been a while since I've touched anything databases related but I've made a number of changes to the database structure so that now it includes the following tables.

Brand
  • Brand ID - primary key
  • Brand Name
Model
  • Model ID - primary key
  • Brand ID - foreign key
  • Model name
User Cars
  • Car ID - primary key
  • Model ID - foreign key
  • Mileage
  • Car Picture

I'm eventually going to add more columns to the Model table for some of the specifications for each model. I'll need to make a number of changes to the database adapter in order to store transactions with the new schema, so that when data is added to the database it adds it to conform with the new foreign keys.

In updating the database, the previous database was wiped and as a result I discovered that when viewing the stats tab when there was nothing in the database it would cause a null pointer exception. I amended the method for formatting the database results in to a Androidplot compatible data structure to only do so if there was data being returned.

The fact that the database wiped on an update to the schematics of the database got me thinking that I really need to look in to a way of converting the data that's currently in the database to form what ever the new schema is during an app update if the original schema is changed. There could well be an easy solution for all of this but as I stated above, it's been a while since I've got in to some solid database design.

Currently nothing is being done with these new tables, but I'm going to work on modifying the existing classes and their methods to fit the new schema this week, and I want to change up the car tab so that the main tab displays a list of the user's cars that he's added to their app (i.e. what will be stored in the UserCars table). The user can select which car the app uses which can be saved as part of the app's settings. This will link in to the transactions so that the mileage being displayed is for the selected car's mileage and the stats being displayed will have a relationship with individual cars in the user cars table too. I just need to change the user_id column in the transactions table to be a foreign key from the UserCars table.

11 December 2011

Graphs implemented

I've finished implementing the other graphs on the stats page for now. Currently it graphs MPG over time, Price over time and Distance between transactions. I need to seed the database for testing purposes with some fake data that might look like it has been entered over the course of a couple of months so that I can take a better look at how that data looks over longer periods of time, but I'll work on that maybe tomorrow or the next day. It might also be a good idea to implement the car picker part of the app. I want to include the ability to take a picture of your car and store it. This will require an amendment to the database and probably an amendment to the database adapter to get all transactions by a user id.

Styling and implementing AndroidPlot graphs

I've been back working on my driver tools app this evening and I've been messing about with the graph styling. So far I've had a look through the XYPlot class to see what's available for styling the graphs and I've added '€' as a prefix to the range increments and I've also corrected how they were being displayed so that now they display to the correct number of decimal places. Other changes to the way in which the fuel price over time graph include setting the domain boundary to a fixed minimum of 0 and setting the maximum range boundary to 50 which can grow should the data exceed this boundary.

Finally I've added a couple of new methods to the stats display activity class for pulling data the from the database, calculating the data required and then adding them to data structures that can be used to plot graphs. I've changed where the function is called from within the activity to the onResume() method, so that the graphs will update every time the activity is popped from the activity stack. This means that the graphs will always update when the focus returns to the stats GUI because the only way of invoking a change to the way in which stats is through other activities which will push the stats activity to the activity stack.

The next steps involve calculating the distances between each transaction which should be easy enough, as it's a simple subtraction. The distance between transactions is going to have to be calculated from the first transaction onwards for now, until when picking your car you can initially set the odometer.

The fuel economy is going to be more difficult to calculate, although the actual formula is easy, the MPG is going to result in issues due to the fact that if someone decides to refill their tank when it's not empty they will get a very low fuel economy rating. I'll implement it anyway and think of a solution later as the solution will probably involve adding a check at the point where a user enters the transaction details.

10 December 2011

Android market update

First of all, my lotto checker app has surpassed 3000 downloads.

Secondly, I saw the following image posted on the Android development blog. It appears that the number of apps downloaded from the android market place has almost doubled since June. That's some pretty impressive growth

7 December 2011

Deadline pushed back by one week

I've decided to push back the deadline that I gave myself by one week due to a number of factors. The first being that I was out of action last Saturday and then on Sunday I only had the guts of half a day to work on the project whilst I re-set up my development environment on a new laptop. Also, this week I've been busy taking on three separate web development projects, two of which involved teaching basic HTML and CSS to some web-dev students who were falling way behind, and the third being a website I'm currently working on for a swimming club. I'm currently finished with the web dev tutoring, and only the third project remains

The swimming club project only involves installing, configuring and styling Joomla, however there are some configuration issues with the web server the clients have which is a shared hosting solution. The issues that I'm having stem from the fact that they don't have the right version of php installed, which means I'll have to get on to their support team to maybe see if they can install php version 5.3 or later. If they can't do that I'm looking at some major work in trying to get Joomla 1.5 set up, and I haven't even begun trying to solve that bundle of problems.

Anyway, I'll be focusing on the joomla project for the remainder of the week, and possibly this weekend I'll get back in with some solid development on the driver tools app. Hopefully by the 18th December I'll have something to publish, or maybe before. There's not all that much left to do for the first level of functionality, so who knows.

4 December 2011

An update and review of the deleting transactions functionality

I've managed to complete the functionality of deleting specific transactions with a neat little algorithm. There's an item click listener for each row of the list and I then have an array of booleans of the size of the number of list items which are all initialised to false. When the click listener recognises a click on that particular list item, it sets the array of booleans to true at the index of the list item was recognised from. Once the user selects delete, it iterates through the list of transactions whilst incrementing through the array of booleans and if that particular boolean index equals to true, it grabs the transaction ID from that current transaction in the list and passes it through to be deleted using the database adapter class.

Having completed this component, I then decided to move on to re-structuring the way in which transactions are displayed and it occurred to me that bringing up a list to select which transactions to delete offers more or less the same functionality that the actual fuel tab offers.

I guess that the fuel tab offers a lot more detail at the minute, with database entries such as the date, the userid(this may be car id at a later point), the total cost of the transaction, the total volume of the fuel for the transaction, the mileage at the time of the transactions, the fuel type and any comments a user might wish to leave. The delete shows the number of the transaction and the date on which the transaction occurred.

I guess for now I'll leave it since its a more or less fully functional component. But while I re-design the fuel tab display so that clicking on each transaction will add another row to display more detail and some calculated data, I'll be thinking coding with the idea of adding more functionality to that display. Functionality such as check boxes to allow items to be deleted with out bringing up a second list of transactions in a dialogue, or the ability to edit transactions.

New Laptop

I've finally got a working computer of my own again. I've been sharing a computer since I spilled coffee on my laptop during the last week of college, and after that I had been using a number of old PC's that were seriously useless for developing on. After getting eclipse set up on my new machine, installing the Android sdk, installing the ADT plugin and then transferring all of the projects in the workspace I had before, I was able to get back to work.

With a week left until the deadline I had set myself and being unable to work on this project yesterday due to a serious hangover, I've set myself a mini goal for tonight.

My goal for tonight is simply to finish off the functionality for deleting transactions from the list. After that if I have time I'm going to work on an expandable graphical user interface for viewing more data about each transaction, which should make the GUI much prettier and less congested.

When transferring the projects from one pc to another, I had an issue with there being no data in the database on the new emulator. When it came to drawing data on a graph, the whole app started to hang, so I'm either going to have to include some check to make sure there is data to draw if an attempt is made by a user to graph something. I also might include some kind of initial process for a user to follow where by the user has to select their car and add information about the mileage upon opening the app up for the first time. I'll come up with a more solid plan and design for doing this later on in the week. It's now time to get coding.