Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Important Anatomy of an Android App

Before you run your app, you should be aware of a few some important directories and files in the Android project as follows:




Name
Description
1. Manifest.xml
This is a main file, that describes the fundamental characteristics of the Application project

2. Java
This contains the .java source files for your project. By Default, it includes an MainActivity.java source file

3. drawable
This contains all .png images that included in your project

4. layout
This is a Directory for files that define your app's user interface.

5. values
This is a directory for other various XML files that contain a collection of resources, such as strings and colors definitions.

6. build.gradle
This is an auto generated file which contains compileSdkVersion, buildToolsVersion, applicationId, minSdkVersion, targetSdkVersion, versionCode and versionName, etc.


 Following are important brief overview of the important above files:

The Manifest File

This file resides at the root of the application project directory. This file works as an interface between Android OS and your application, then it will not be considered by the OS. For example, a default manifest file :-
xml version="1.0" encoding="utf-8"?>
 xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.exam.myworld.hello">
   
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/AppTheme">
     
       android:name=".MainActivity">
         
             android:name="android.intent.action.MAIN" />
             android:name="android.intent.category.LAUNCHER" />
         
      
   


Main  Activity File

This is a Java file MainActivity.java. Following is the default generated source code of application wizard for Hello World! application :-

package com.myworld.hello;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
   }
}












This post first appeared on Android Technology, please read the originial post: here

Share the post

Important Anatomy of an Android App

×

Subscribe to Android Technology

Get updates delivered right to your inbox!

Thank you for your subscription

×