My first proper Android app

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.

Spinner and switch inputsI 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 …

keypad entry for the cost of wine… and a numeric keypad entry box for the cost of the wine – the first time I’ve used any of these input methods. (I am very much an Android beginner.)

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.

App outputsWhen 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.


About yorkshirecrafter

I live and work in West Yorkshire.  I've always enjoyed crafts of all types, from woodwork to lace-making.  I also enjoy anything mathematical, which makes knitting a favourite pastime, especially complicated designs.  I've been advising businesses and industry on environmental matters for 30 years and also have an interest in green living, especially where it saves me money. I live with my husband and our Maine Coon in a 100-year-old cottage that constantly needs something doing to it.  Fortunately, I enjoy DIY too.
This entry was posted in Android, learning, wine and tagged , . Bookmark the permalink.

Please leave a reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.