Google Android - An introduction to development
2012-03-18 by
I am amazed by what the android development environment has to offer. It allows for ease of development like Windows Mobile, however it also allows for high preformance UI development. One other major benefit is the ability to publish applications without having to be "certified" by some at "Apple". This is truly the open source development program that we developers deserve.
So the next question is how do I install this development environment and do you have any samples? The answer is Of course we can help you out with this!
- First we start by installing the SDK as per the instructions provided by Google....Download Android SDK
- Now to start, lets try out the hello world application....Don't be scared and don't skip this step, if you are new to android development.....Android Hello World Tutorial
- Once you are comfortable that the dev environment is setup, lets now check out the code for a dialog box...Scroll Down
.java File
package com.PCIT.Android.Scoreboard;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
public class InitializeScoreboard extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public void SayHello(View v)
{
AlertDialog alert = new AlertDialog.Builder(this).create();
alert.setTitle("My Dialog");
alert.setMessage("I created this!!!!");
alert.setButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
alert.show();
}
}
main.xml
"1.0" encoding="utf-8"?>
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Welcome to the Sample Android Application"
/>