How Android Gives Developers the Tools to Succeed

From a developer’s standpoint, one of the best things about working with Android is that you do not have to rewrite new code with every application. There are all sorts of developer’s tools to make certain that your application runs its activity or activities well.

Let’s say you want an application that can take a picture, and then send that picture with a geotag location all across your social network. It’s simple if you are programming with Android. Well, actually, it’s not quite simple, but not as difficult as writing all of the programming code yourself.

Android has a lot of widgets—advanced UI elements—that you can use to make your application simple and user-friendly. All of this is done in a basic UI element called a view. There are also various other hardware tools that an Android developer should become familiar with in order to create applications that can do more. Examples of these tools include the camera, accelerometer, GPS radio, and proximity sensor.

The Android developer also has the option of grabbing more tools from phone manufacturers themselves. For example, Sony Ericsson has an application known as Timescape that is the central hub for most social activities on its Android phones. The company offers an extension development kit (EDK) so that users can create their own extensions of Timescape, and it is available at the Sony Ericsson site. Obtaining such development kits is often very simple and generally free of charge.

In addition to this, the Android developer should be able to access other application programming interfaces (APIs) in order to allow programs to work together with other programs. There is a terrific list of many of them at http://developer.android.com/reference/packages.html.

So right now, you’re probably looking at the Android toolkit like a wide-eyed kid who looks at a large LEGO set. The challenge and the fun is all about finding what you can build, and you are not limited by the amount of pieces. You can also build on some projects that are already constructed. Figure 2-1 is something quick that I was able to use simply by accessing the SDK samples.

images

Figure 2-1. The code for a simple Android application that leads to playing the Lunar Lander game, as seen from Eclipse

The program in Figure 2-1 is Lunar Lander—just one of the sample programs available in the SDK. It is based on a video game that was made by Atari in 1979. That game was made with black-and-white vector graphics, and the player was a spaceship that had to land softly on an alien world. Controls were from left to right, and there was the occasional thrust to slow descent. The challenge was to land in the right space or crash the ship.

If you want to change the game so the lander looks different, or change the sound effects, it is actually a simple matter of altering the code. (Just make certain that you follow the software license that you see in Figure 2-1.)

For example, the Commodore 64 had a similar game in the 1980s called Jupiter Lander with exactly the same premise. You could easily make a version of Jupiter Lander by altering the code. However, you should check on who owns the rights to Jupiter Lander before you release it to the Android Market.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.64.126