
It can be an image, a piece of text, a button or anything that an android application can display. View can be considered as a rectangle on the screen that shows some type of content. View class extends Object class and implements Drawable.Callback, KeyEvent.Callback and AccessibilityEventSource. View refers to the class, which is the super class for all the GUI components like TextView, ImageView, Button etc. View is the basic building block of UI(User Interface) in android. Here in this tutorial, we are going to cover about various Views and ViewGroups and will try to explain how they can be used to design the User Interface of an android application. Android SDK Manager & required PackagesĪll the interaction of a user with the Android application is through the user interface(UI), hence it is very important to understand the basics about the User Interface of an android application.Use the Package Explorer to navigate to the Java file of the Activity you’ve created:įor this example you don’t have to change anything to the auto generated code so you can leave it as it is. You can preview the layout you’ve created in the Graphical Layout editor: Then we simply place a RelativeLayout between these two view using These properties will place our RelativeLayout with id content, representing the content area of our Layout, above the element with id footer and bellow the element with id header. We have two RelativeLayouts, one aligned at the top of the screen, using android:layout_alignParentTop="true" property, and one aligned at the bottom of the screen using android:layout_alignParentBottom="true" property. In our case the file res/layout/main.xml will be created. In the Layout Name text field you have to specify the name of the file that will contain the layout description of your app. You will be asked to specify some information about the new activity. This is optional as you can create a new activity after creating the project, but you can do it all in one step. In the next window make sure the “Create activity” option is selected in order to create a new activity for your project, and click Next.


You have to specify the Application Name, the Project Name and the Package name in the appropriate text fields and then click Next. Open Eclipse IDE and go to File -> New -> Project -> Android -> Android Application Project. So that’s what are we going to do in this example.įor this tutorial, we will use the following tools in a Windows 64-bit platform: The important bit is to try to make your layouts reusable and independent from one another, so you can use it anywhere in your application, not just in one Activity.

It is relatively easy to do that in the Android platform. In this article we are going to see how you can create a simple Android Layout that includes a header part, a footer part and the content area.
