Answer My Question Game Show: Getting to Familiar with Android Development Part 1

Hopefully, we can create something like this.
_Check out the other parts [here]( "AMS Tutorials"), description, status and source code [here]( "Info and source code"). Click on an image to enlarge (or use [this]( "Hover Zoom in Chrome") Chrome Extension to hover zoom)._

In the past couple of weeks, I messed around with Android. I thought I'd share some of what I learned. So in this n* number series of posts, I'll share how to create a basic application in Android. Hopefully it will get you started and most importantly interested in making an app.

n = unknown for now.
Note: If you find an error or would like to suggest something, comment or hit me an email.

What makes mobile development interesting?

What's most unique about mobile development is being able to release an application rapidly. It's also not that difficult to get up and running. There is a low barrier unlike in the iOS environment (Developer fee and Mac requiremented for example). All you need to get started is a little knowledge on Java (an understanding of Swing would be useful). Smartphone adaptation has seen a very rapid growth in the past few years so even if you don't end up making the next Angry Birds it's still a great opportunity to make a program that people may actually find useful.

What will I cover?

I want to go through making a basic application. A "Quiz" type of sorts. Why? It would get to cover basic uses of the user interface (UI) in input and output. It can also be extended easily to add more features like getting the questions from the database or adding sounds or some other feature you desire.

The tutorial would hopefully give you and idea of how to work with XML and the basics concepts in an applications frameworks (intents, activities, etc). Let's start!

Setting everything up

If you haven't done so you can head over to my previous post which discusses (or really just links) how to setup your environment to start coding. If you don't want to read that post basically what you would need is (a) Eclipse (b) Android SDK (c) Emulator or phone. I would recommend using a phone so that you could play around with more complex features (like sensors) later on. Also, the emulator isn't as fast as an actual phone. Setting up Eclipse with the SDK is relatively easy if you don't run in to problems on installing plugins.

If you're having trouble installing the plugin (which would prevent much headache) and you're running Windows 7 and Eclipse Indigo, try running Eclipse in administrator mode.

Design Mock ups

Before we start coding it's good to have a plan of what we want to achieve. It's easy to slowly add features but we need to have clear idea first on what the program will look like. I made some sample looks in Photoshop to help me get through this. Based on my idea, we'll have 3 screens. The screens are the main menu, game and game over. We'll have options after we can get the initial program running. The "sketches" are below.

Main Menu.
Game Screen.
End game screen.


As you can see from the not-so-great mockups, we're aiming for something simple. The main screen hosts the menu to start the game, see the highscore or configure options. The second screen is for the actual game and where most of the action (or lack of) will happen. Finally, the last screen will display the current session's score and the current highscore. It will also have the option to go back to the menu or directly jump to another game. I think most of the basic elements needed (score, highscore) are covered.

We still have a couple of questions in terms of game design like "Will he show the correct answer after the player submits the answer?. We will! We'll show it when we get in depth with each part. The good thing is for now, we have an idea of the main parts we'll make.

If you've coded before (and I'm sure you have), you'll already have an idea of the technical aspects we'll cover. We'll have drawing the UI elements, customizing the look and feel, inserting objects (logo), getting input, showing data and saving data. Hopefully, you (and I) will get a good start in mobile development.

In part 2, we'll setup the project and create the main menu. See you then!