Posted by : Unknown Monday, July 29, 2013


Hello everyone! On my last post, I configured a new Android application project in Eclipse. The view in Eclipse was like this after creating it:

HelloAndroid Application


Now, I want to build and run the application. Before I do that, I am going to take a closer look at the Project Explorer view in Eclipse. 

Eclipse Project Explorer View


By configuring a new Android application project, it created various folders and subdirectories. The first subdirectory shown in the Project Explorer view of Eclipse is called src. The source folder has a package and a Java class. The package name is chosen in one of the first windows while creating a new Android application. In my case, the Java class name is MainActivity.java. 

MainActivity.java


The name depends on the name given while creating a new blank activity. An Android application needs at least one activity and it can have more than one. The following subdirectory in the Project Explorer view is called gen. The folder has a package with two Java classes. The first Java class is called BuildConfig.java and it is an automatically generated file which shouldn’t be modified. The second Java class is called R.java. 

R.java


It is also an automatically generated file which shouldn’t be modified. This class is generated by the aapt tool from the resource data that was found in the application. These classes will automatically change as modifications are done in the project. The following part in the Project Explorer is a set of libraries. The version of Android depends on what you chose while creating the Android application project. Another important folder called res in the Project Explorer contains several subdirectories. The first few folders in the resource folder begin with the word drawable. These folders have the launcher icon file that was selected while creating the Android application project. In my case, it contains the graphic file ic_launcher.png which is the green android logo in a black box. 

ic_launcher.png


This graphic file can be changed for another graphic by adding the specific size in each of drawable folders. The following folders in the Project Explorer have XML files. 

Eclipse Project Explorer
The files on these folders have the configuration for the screens in the application. An important file after the resource folder is the AndroidManifest.xml file. 

AndroidManifest.xml

This XML file contains information about the application like the android version, minimum SDK version, target SDK version, and activity. It also contains permissions for the device like for example to allow an application to access information about networks or to allow an application to access the camera.




Leave a Reply

      

Followers

Powered by Blogger.

Translate

Google Search

Support Blog

- Copyright © Learning Android Development -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -