Pages

Friday 8 April 2011

First Steps (2) Android Building Blocks

As a developer with a long background in Microsoft technologies (VB then .NET and C#) moving to Android Java development was initially a bit of a challenge. Not least because I was required to stray from the comforts of my Visual Studio environment.

Having already traversed (or perhaps transcended?!) the bridge I thought I would impart some knowledge that may make the transition easier for others.

Building Blocks

When first creating an app you have to deal with Activities. These are essentially blocks of code that deal with user interaction. Coming from a Windows background it is easy to think of these as your Forms.

The interaction between activities are dealt with by Intents. These are a request for a type of action (start a new activity, launch camera, start an SMS, etc) and can also contain a Bundle which in WinForms terms would be your argument array.

Figure 1: Android Activity and Intent usage
Foundation Block

The thing that binds your project together is the manifest file which resides in the project root and is named AndroidManifest.xml. This defines the requirements, components and permissions of your app.You can think of this as your .NET app/web.config. I will being covering this in details as well as the overall project structure in a separate post.

To Conclude

Once you understand these key terms you have a good starting point for approaching your first "Hello World" project. With the aim of keeping my posts concise I will tie it up there, but please continue to follow the series.

0 comments:

Post a Comment