Pr.Pg Next Pg

Android Package Explorer tutorials

Android Package

  • When the Android Project is made, the Package Explorer in eclipse will how the project and its components.

 

 

Different Package Folders

 

Src

  • Contains all the classes specified by the user, including the defualt activity class.

 

gen

  • This contains the file that are automatically generated by the ADT, when the project is first created. R. java in this folder contains the references to all the resources present in the res folder so they can be easily and dynamically referenced from the Java code. It is advised not to modify the contents of R.java manually.

 

res

  • A res folder contains all the resources for the project: icons, images,st rings, and layouts. Having a separate resource folder keeps non-source code resources external to the code and resources can be dynamically

  • selected based on hardware, language, orientation, and location.

  • It consists of the following:

 

  • drawable folders for the images in hdpi (high density), ldpi (low density) and mdpi (medium density).

  • Layout folder Meant for the layouts specifying the UI screens for the activities, in the form of XML code. Main.xml is automatically generated. This folder pertains to the default portrait layout. For representing some UI in the landscape layout (when an Android device is turned 90 degrees), create a layout-land folder and put your layout XML file there. The main.xml file has a nice UI representation, as shown in Figure 3. You can drag and drop different layouts and views onto a blank screen to build the UI components for the activity.

  • values folder Meant for all the name-value pairs (the strings your application is going to define).

 

AndroidManifest.xml

  • AndroidManifest.xml is also an important part of the project. It's the equivalent of a plugin.xml file for plug-ins. It basically defines the activities in the applications and specifies the actions that have been specified for each. It also lists out the permissions that the application requires to perform various actions.

 

Pr.Pg border                                              Next Pg