Saturday 22 February 2014

Android Programming: Day 3… Bright Colours

Yesterday morning I was pretty delighted by my progress and intended to make my humble app a little more functional. This morning I’m just exhausted. Yesterday was crazy ambitious even by my standards of blindly leaping into things without quite knowing what I’m doing.

The problem began when I tried to implement at file open dialog box. Whoa, I hear you cry and I agree! I’m moving into the exciting stuff really quickly but I have things to do and my file open dialog box was where I left off yesterday.

You know the sort of thing I’m talking about: you click ‘load’ and a window appears asking you to select a file. I thought it would be easy. Usually one of the easiest things to program is the file open dialog box and that’s because you don’t actually write software using a programming language. Well, you do but using a ‘programming language’ is like saying that the entirety of your speech is made up of English and it contains words and grammar which you understand. It is true that programming involves knowing that language but much of the basic functionality of any piece of software is actually created by using something called the API, which is the application programming interface. To continue the English analogy, it’s like saying that a writer has lots of newspaper articles that are already written for them and which they can quote. In software terms, these are libraries of functions that provide many of the basic building blocks of the app. For example, somebody has usually created a simple-to-use building block which displays a file open dialog box. You tell the computer to go and create the dialog box and you wait for it to come back with the name the user selected. You don’t actually know anything that happens – the ‘new folder’ option or ‘sort files by name’. You simply say ‘I need a file name, get one for me’ and the computer's demon returns with a ‘as you requested, master’ and lays both the directory and file name at your feet.

So, adding my file open dialog box was my next step. Except one of the very few things that Android is currently missing is a built-in file open dialog.

Yesterday, after writing my enthusiastic and critically acclaimed blog update (nearly three people read it) I clearly faced a dilemma. Write my own file open dialog, find one somebody had already created, or do something else.

Writing file open dialog boxes is miserable and I wasn’t going to spend my day worrying about one of the ideas I had for my App which wasn’t actually necessary. I decided instead that what my app needed was more whiz bang. I decided to look at the graphic functions of Android. I was hesitant at first because that’s heading into games programming, which I assumed would be really difficult. However, pretty quickly, I’d created a screen and had some things flying around.

By 4am this morning, I’d designed a new layout for the app, produced yet more things flying across the screen and a functioning button which makes a satisfying click noise. Today I intend to add another button, make my buttons indent when I click them, and then I want to produce more graphical magic before I then link the whole thing into a facility to interact with the wider world. For the first time, I actually think this app might have a future beyond my little world where it does something solely for my amusement and utility. I beginning to hope that others might enjoy it. In fact, I can see there being at least another ten or eleven people in the entire world who might want this app and that would be at least £5 or 6£ in my pocket if I sold if for fifty pence.

No comments:

Post a Comment