Monday, October 22, 2012

Inside Android Project



In this post I will share that what is inside the android project. When you open android project you will see many files and folder in it.

Src
In this folder you will see java files. Whatever you will work in java you will do in this folder.

Gen
This is generated java file and you will see R.java file in this folder. There is nothing to do with this file when you open this file you will see on the top it says that DO NOT MODIFY. Whenever you will add components or anything in android using XML then it will added in this folder ( source code will be generated In this file) and after adding component to this folder you can easily bind that component with java (through R.java file) and can do whatever you like to do with that component.

Assets
A folder that holds other static files you wish packaged with the application for deployment onto the device.

Res
In this resource folder you will see drawable-hdpi, drawable-ldpi, drawable-mdpi, layout and values folder. Let’s talk about layout first.  You will see main.xml file in layout and in this file you can make layout or you can say UI of android using XML. In Values folder there is string.xml file. This file help to make anything global ( means it can be use everywhere in application). If your project name is ABC and you want to use it anywhere in your project just add you project name ( p_name = ABC) now whenever you will call p_name you will see ABC and can easily change it(no need to change this name everywhere). Now let talk about drawable. If you want to add any picture in you project you will insert in this folder. But why three folder of drawable? High resolution pictures goes in hdpi, medium resolution in mdpi and low in ldpi.

Manifest.xml
An XML file describing the application being built and which components—activities, services, and so on—are being supplied by that application.

Default.properties and local.properties
Property files used by the Ant build script.

Res/drawable/:For images (PNG, JPEG, etc.).
Res/layout/:For XML-based UI layout specifications.
Res/menu/:For XML-based menu specifications.
Res/raw/:For general-purpose files (e.g., a CSV file of account
information).
Res/values/:For strings, dimensions, and the like.
Res/xml/:For other general-purpose XML files you wish to ship.

No comments:

Post a Comment