Beginnings 2: Software and Tools

So now we know why I'm doing this, let's have a look at what I'm using to do it!

First off for any programming, it's good to have a solid Integrated Development Environment, or IDE. It is possible to write code using Notepad and then compile it with a standalone compiler, but that's like saying it's possible to write a novel without having proofreaders - you're making your life more difficult, and at the end of the day the results will be worse.

To compare code in an IDE with the same code hand-typed:

So here we have a Java "Hello World!" program.
You can see that there is colour-coding for common elements - the declarations are purple, comments are in green, and the string "Hello world!" is blue.

What you can't see is that Eclipse has automatically indented lines as they are typed; nor that when you open a brace { or parenthesis ( it closes them.

It will even, when you type System. show a list of possible continuations.

Then if you, say, forget the semi-colon to end a line, it will highlight that line as problematic and suggest you add it.
And here is the equivalent hand-typed.

There's no indentation, so it's harder to see what is going on; and with all the text the same colour doesn't help.

If I forget a piece of syntax, or misspell a command here, the first I know of it will be when the compiler throws an error. Not fun.

So, an IDE is essential - but which one to use?

I have chosen Eclipse. Primarily, this is because Eclipse is a very popular IDE for the Java family of languages - and Androids run on a form of Java. It is also because Eclipse is free (yay! says my wallet) and open source (yay! say my principles).
Eclipse can be found here.
Once you've installed Eclipse, you need to add the right attachments to make it work with Androids. It's like buying an electric drill - you need the right drill bit to do the job.
Specifically, you need the Android Development Tools (ADT), and the Android Software Development Kit (SDK). Fortunately, there's a very good tutorial on the whole process here to walk you through that.

Once you've done this, Eclipse doesn't just have the usual advantages of an IDE - you can also run virtual Android devices with a variety of specifications, to test your program on more phones than just the one in your pocket! (More testing is always good...)

So far so good. I've added two more bits'n'bobs which look as though they may be useful, and offer functionality which is lacking in Eclipse:
DroidDraw, which is a visual environment for laying out interfaces and screens. Hopefully when it comes to prettying up an app, this will make the process reasonably simple. DroidDraw is found at this site, which not only has the downloads, but also tutorials on how to get started with it.
SQLiteBrowser, which is a database manager, found (among other places) here. I've added this because it may help with handling storage and retrieval of data.

Last thing to mention:
Scrap paper and a pencil/whiteboard and a pen can also come in handy; especially for planning out the outline of a program before you jump in and start coding.

Next Steps: So what do we want an app for?

No comments:

Post a Comment