Free Newsletters

   All InfoWorld Newsletters
Strategic Developer | Martin Heller » Android SDK: It's a Java API

November 12, 2007 | Comments: (0)

Android SDK: It's a Java API

Android emulator

I guess I shouldn't be surprised, since Google has been advertising heavily for Java developers with device experience: the much-hyped Google Android Open Handset SDK is basically a Java API. In addition, it supports XML-based layout files, and contains a variety of development tools.

What tools? An emulator, an Eclipse plug-in, a debug monitor, a debug bridge, an asset packaging tool, an interface description language, SQLite, a trace visualizer, a disk image generator, a bytecode translator, and an Ant script creator.

What does "Hello, World!" look like as Android code? Basically this:

public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        TextView tv = new TextView(this);
        tv.setText("Hello, Android");
        setContentView(tv);
    }
}

There are four building blocks to an Android application:

  • Activity
  • Intent Receiver
  • Service
  • Content Provider

I'm oversimplifying, but an activity is a screen, and an intent moves from one activity to another. An intent receiver is an event handler. A service is long-lived non-UI code. A content provider is a class that implements a standard set of methods to let other applications store and retrieve the type of data that is handled by that content provider.

For more, read the Android documentation and download the SDK.

Posted by Martin Heller on November 12, 2007 11:33 AM


RATE THIS ARTICLE:





 

  •  
  • COMMENTS





Technology White Papers

 

InfoWorld Technology Marketplace

» Technology White Papers Library

Technology White Papers by Topic

Technology White Papers E-mail Alert

Find out when the latest white paper is available:
 
 
» BUY A LINK NOW

Sponsored Technology Links