A few weeks ago, I set myself the task of producing an Android app that would work out all the payments at the end of the fortnightly wine group meetings I attend. I’m pleased to say I’ve achieved a usable app, although refinements are still needed, especially to the layout.
Strictly speaking, this isn’t my first unaided app, but I’m not counting the row counter I made because that is so simple. I intend to refine that app too, in due course.
I learnt a lot from this wine kitty exercise. Working out how to lay out all the information, not to mention how to take the various inputs and display the necessary outputs, is a lot harder than simply following the instructions to produce an app when working through an online Java course.
I’ve incorporated a spinner (called a number picker in Android) to choose the number of attendees, a slider switch to select whether a single person or a couple are hosting the tasting …
The challenges were getting everything to work, in the right order, and dealing with unintended situations such as the user forgetting to enter a wine cost. What is great is the wealth of information that is out there on the internet for Android noobies such as me. I’m finding the official Java documentation rather opaque most of the time – no way is it aimed at the uninitiated – but fortunately there are some very good forums where learner developers like myself can ask dumb questions and some kind soul will answer them.
When the OK button is tapped, the app displays the input figures and also the three outputs: how much cash the organiser needs to collect in (everyone but the hosts pays £12 a head), how much is due to the hosts to cover their expenditure on wine plus £3 a head for coffee, cheese, etc, and how much will be left over to go into the kitty, or else how much needs to be taken from the kitty. It even displays a different message depending on whether the kitty is augmented or depleted.
As well as making the layout and overall design prettier, before I can claim this app is completely finished I want to:
- make the slider switch button (“thumb”) bigger – surprising difficult to achieve, for some reason.
- enable the app to deal with a wine cost in whole pounds properly. At present, it prints just one zero after the decimal point if the user hasn’t entered pence, which annoys me. Again, this looks to be a lot harder than it ought to be.
- keep a running total of the kitty balance that persists when the app is not in use.
I’m not going to publish the app when it’s in final form. I can’t imagine that it will be of much use or interest to anyone else, as the calculations within it are peculiar to our wine group and how we do things. I’ve hard-coded in certain items, like the £12 charge, on the basis that they aren’t going to change any time soon – we raised the charge from £10 not long ago, the first increase since circa 2000, so I think I can assume it’ll stay at that level for a while. This makes the app a long way from being universally applicable, even for other wine groups who operate the same way we do. I don’t care though, the object of the exercise was to come up with an app that would be useful for me, and possibly other members of the group who have Android devices too, and to learn while I was doing it. Mission accomplished.