MY mENU


Saturday 11 February 2012

File Structure of Android Application


Let us look into the file structure. The Master folder is same as Application name it is as we Define. It contains four subfolders including src, gen, res and Android SDK files.

src – It contains the source packages and Java source files. In our src folder it currently contains the package or.hello.HelloAndroid. The package further contains the Java file “HelloAndroid.java”. Like Below example:

package org.hello.HelloAndroid;
import android.app.Activity;
import android.os.Bundle;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

gen – It contains the auto generated java files. As these files you should make any changes in them. If you make changes in source code the code in this folder will get modified automatically.

Android  – It contains the particular SDK libraries being used for the current project.

res – It is one of the other important content folders. It contains three subfolders for images namely      drawable –hdpi, drawable –ldpi, drawable –mdpi. The other two subfolders are  layout and values. The layout contains the main.xml . The strings.xml contained in the values folder is used to define strings to be used within the applications.

No comments:

Post a Comment