: Follow us
Blog Ocean
  • Home
  • Blog
    • Technology
    • Women >
      • Contest
    • Fiction
    • Personal / Daily Life
    • News and Media
    • Sports
    • Religion
  • Guestbook
  • Contact

Android Project Structure

20/1/2014

0 Comments

 
Android app development - Android project structure 1
Apps and game development in android is a very promising profession now-a day. One must know Android project structure if they want to develop the career in Android based development.

Create a new project:

First, we would create a new project using eclipse. In different steps of project creation, we will configure the application which will affect some of our project configuration files.

 Step 1: File->new->project->android application project

Here, we have namedour application, package name under which the application will run; build sdk version and minimum sdk version. Minimum sdk version is required to make your application backward compatible, i.e. to run into previous android OS based device.

Android app development - Android project structure 2
Step 2: Configure launcher icon.

Android app development - Android project structure 3
Step 3: Create an activity


Picture
Step 4: Configure new activity

Here, you have to name and title the activity, name the layout for this activity.

Android project structure - Android app development
Basic Structure

Let’s look at the basic structure after creating the project.
After creating new android project, the following folders are created in your project path.

src/:  This directory contains the source code of the application. All the activities and java classes reside here. The folder structure is:

            src
              |
              |-----> package name
                               |
                               |-----> source files


gen/: Contains the file generated by ADT. Two common files of this folder are:

            BuildConfig.java : Contains build configuration information.
            R.java: Contains a unique hexadecimal numbers for each of the UI element.

            The folder structure is:

            gen
              |
              |-----> 
package name
                               |
                               |----->
 generated files

Build SDK version:  A folder named by build sdk version(in our example, named with Android 4.1) of the project contains the android jar folder. This folder consists of the default packages of this build SDK.

Android dependencies: Contains the JAR files on which the project depends.

assets/: generally it is empty. It is used for strong texture and game data.

bin/: This is build output directory. The apk file of the project is generated here.

libs/: Contains third-party library.

res/: It is the resource storage of the project. Application resources like Icon, images, layout, menu, strings are stored here. These resources reside in some specified folders which are as below:

            drwable-hdpi: It contains high dpi images of the application.

            drwable-ldpi:  It contains low dpi images of the application.

            drwable-mdpi: It contains medium dpi images of the application.

            drwable-xhdpi: It contains extra high dpi images of the application.

            layout: Android application UI are defined in XML format. This folder contains the layout files that are                          projected in the screen.

            menu: It contains the xml files that define the application menus.

AndroidManifest.xml: This file is the heart of your application. It describes the configuration of the application. Some important information that the file describes are:

            Package: The package name of the application. 

            Uses-sdk: Minimum sdk version to run the application and target sdk version.

            Resources: Application’s icon, name, theme path.

            Activity: List of activities and their configuration.

Let’s look at the manifest file of the application that we have created earlier.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.anexamplepro"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


proguard-project.txt: It optimizes the application code. It also makes your application harder to reverse engineering and thus enhances security of the application.

project.properties: It is generated automatically by android tools and target android version is written here.

Here, the project structure of a simple app has been discussed. This would help the developers to initiate their works on android.


Also get to know Guess Who? image apps are created in android Android Apps Development : Working with bitmap image and Create SqlLite Database and Table in Android which is helpful in creating app and games in android.


0 Comments



Leave a Reply.

    RSS Feed

    Author

    Vaibhav O Yadav - Top IT professional. Worked with Fortune 100 company. I like to spread the knowledge. Analyse situation and environment with long term vision and solution. Firm believer of sustainable development for earth. Apart from from being geeky also like to play multitude variety of video games on greater stretch of time with favorite being economic simulation

    Categories

    All
    Android
    Android App Development
    App Development
    Apple
    Cloud
    Data Virtualization
    Data Warehouse
    Virtualization
    Wordpress

    Archives

    October 2014
    March 2014
    January 2014
    December 2013

    Tweets by @BlogOcean
Powered by Create your own unique website with customizable templates.