Friday, June 8, 2012

Editing Base Layout



An android project is basically divided into 2 categories. They are * Source code and * Resources. Lets keep it that simple for now. The resources are classified into text(strings), images, sound, layout etc.. Images are placed under the folder "drawable". Layout is placed under "layout" folder. Colors and Strings are placed under the folder "values". These resources are defined using XML files. The layout of the base screen (the screen that appears when an app is opened) is defined in the file "main.xml" under layout folder. Check out the main.xml file of my project.







Check out the colors.xml file mentioned in the main.xml file...



strings.xml is given below....





Check out some of the snaps below:

1. Our App with red background (#ffff0000) in the AVD:







2. Our App with background as "pic.jpg":






3. A snapshot of main.xml in Graphic Layout mode:




------------> Download Project here <---------------


Thats all for now guys! This post explains how to create the components in a layout and how to customize it. In the next post, we'll try to make these components (buttons, text fields, etc.) to work by adding event listeners to them. Stay tuned for more....



2 comments: