Pageviews

Monday 28 October 2013

Introduction to Android files

by Unknown  |  in Android at  Monday, October 28, 2013

Android files:     Android is a Linux based Operating System,it uses a big collection of files in order to develop Applications for our Android phones.Below is a small but useful overview of each and every file used in creating an Android Application:





As you see in the image ,I had created a new project named 'Kodingpoint',which has by default the following files and folders in it.

1src-- stands for Source it contains the files that contains our source code,all the java codes which we write in our project are in this folder.All the files are saved with .java extension automatically.
2.gen- stands for Generated.This contains all the java files which will be automatically generated during project,it contains the most important file of the project named R.java,this files includes all the unique Id's we assign to our textfields,button,edittext etc.If R.java is deleted or modified,you will not be able to run your project.

3.Android 4.3 and Android Private Libraries :consists of collection of all the packages of Android,we will use in our App development.It contains all the packages like Bluetooth,Wi-fi etc.

4.Assets: It is the folder in which we can keep our different types of files like we can keep our HTML,PHP,Javascript files etc. 

5.Bin- In this folder,we have our .apk file of our application,whenever we want to install any app on our file,we simply need to go to bin folder and send appname.apk to our device.
                                                                                                                        It further consists of another important files and folder like res,which will be explained later.

6. Libs: It stands for libraries,all the libraries which consists of .jar files comes under this folder.By default it consists of android-support.jar file,we can add further jar files according to the requirement of our project.

7.res: It stands for Resolution, under this folder all the resolutions supported by our app is given here,it further consists of drawable folder,values,Manifest etc.

8.Drawable: It consists of drawable resolution sizes supported by our app,it consists of :

drawable hdpi(high dots  per inch)
drawable mdpi(medium dots per inch)
drawable ldpi(lower dots per inch)
drawable xhdpi(Extra high dots per inch)
drawable xxhdpi(Extra Extra high dots per inch)


Whenever we are developing applications for multiple screens we need to draw different layouts for each screen.

9.layout: Layout consists of the designing we wish to give to our app,it consists of .xml files all the designing part comes under this folder.

10.menu: This folder also consists of xml files,here we define all the menu items,we want to get in our application.

11.values: This folder consists of three files i.e. dimens.xml,string.xml,styles.xml.

1.dimens.xml:Basically this file is used for 2 purposes:

1.If you want to use multiple layouts to use the same value,then you can paste them in this file.
2.It can also be used for assigning static dimensions,it allows you to get a scaled value in Java code.

2 strings.xml: This is the file where we define our strings of text we want to display in our application.

3.styles.xml: This file basically defines the style of your application.It includes various options such as textcolor,background color etc.

12.Android Manifest:It is one of the most important file in our project.All the classes we have created is defined in this file,if want to add Splash screen,that too is given in this file,but the problem with manifest file is that even a single word change can cost you high,so you need to carefully write code in manifest.

A sample manifest.xml file looks like:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.kodingpoint"
    android:versionCode="1"
    android:versionName="1.0" >

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

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

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


13.Project properties :It defines your properties of the project.























0 comments:

Proudly Powered by Blogger.