The author of the following text is formazon , the text is published at his request, as he lacks the karma to write on the Android blog, and the desire to write is huge.
In this article we will try to talk about how to program for future Android devices, to interest those who are far from hardcore programming, but want to touch the sacrament. Guru - leave the right to correct. Any UI (User Interface) is a collection of any elements. For example, a screen with two input fields and a button is a user interface. Activity - this is a specific UI that is currently displayed. The Activity class creates a single window for you where you can place your UI. We connect for this class Activity:
import android.app.Activity; ')
Next, we need to create a Class that extends the Activity class:
public class ShowClock extends Activity { }
The main function that belongs to the Activity class is the onCreate () function, and we write to it what we want to display when loading our application. Let's display the simple watches that are available in the widgets package. This is done like this:
Override public void onCreate (Bundle icicle) { super.onCreate (icicle); AnalogClock cl = new AnalogClock (this); setContentView (cl); }
About the function super.onCreate (icicle); I'll tell you a little later, and with the rest I think it is clear. Do not forget to connect the class of hours:
public class WriteData extends Activity { Override public void onCreate (Bundle icicle) { super.onCreate (icicle); AnalogClock cl = new AnalogClock (this); setContentView (cl); } } Run and ...
Other articles on Android can be found at gglphone.com .