Monday, October 13, 2014

Tutorial 3 : Android Activity, Layout and Manifest

In this tutorial, we would discuss about the three main elements for Android application development: Android Activity, Android XML Layout and Android Manifest. Each of them plays different role in the Android application, if without one of them, the application will not work perfectly.

1. Android Activity (*.java)

The Activity class is an important part of Android application's overall life cycle and the way of activities are launched. Besides, it also is a fundamental part of the platform's application model. If you want to know more how the activities behave, please read the application fundamentals and tasks and back stack developer guides.

Figure 3.1


2. Android Layout XML

Android layout XML is a platform which let you edit and design your android layout files with a drag and drop interface. This layout editor is user friendly which offering you a preview for your design layouts. For more information, you can see graphical layout editor.

Figure 3.2

Besides by using drag and drop interface to design your Android XML layout, you also can hard code it by typing the code in the *.xml file.

Figure 3.3

3. Android Manifest

All of the Android application must have an AndroidManifest,xml file in its root directory. The manifest file contains a lot of essential information about your application to Android system.  These important information must have before it can run any of the application's code. To get more information about this you can refer to this link.

The picture below shows the general structure of the Android manifest file and every element that it contain.  Each of the element come along with its attributes and documented in a separate file. If you want to know more about it, please click here.

Figure 3.4

Now you should have a well understanding for all the important elements in Android application. Proceed to next tutorial to explore more in the Android application world.

No comments:

Post a Comment