Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Execution Flow of Android Application

As a Beginner You need to know the execution flow of your android application. to understand the basic execution flow of android  we are  considering the hello world example.

When you create the android project in eclipse lots of folder are created such as "src" ,"gen" , "Android 1.5"  , "assets" and "res" folder.
To understand android flow we are starting with the "res" folder. In "res" folder there is a file called "AndroidManifest.xml".
These below is the content of AndroidManifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest
      package="com.example"
      android_versionCode="1"
      android_versionName="1.0">
    <uses-sdk android_minSdkVersion="3" />
    <application android_icon="@drawable/icon" android_label="@string/app_name">
        <activity android_name=".HelloWorldDemo"
                  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>

In the Above Xml code we have an activity called "HelloWordDemo" listed in activity tag this activity will be launched first. if you have multiple activity in your android application you must have to register all your activity in AndroidManifest.xml file.
you can specify your child activity by just <activity android_name=".xyz"></activity> adding as many tag as many activity you have in your android application. Make sure you specify "." (dot) before each activity.
Activity name ".HelloWorldDemo" will call HelloWorldDemo.java file.
package com.example;
import android.app.Activity;
import android.os.Bundle;
public class HelloWorldDemo extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}
When HelloWorldDemo Activity is created by default onCreate method will be executed. inside onCreate Method we have an setContentView which execute the android application design file whose name is main.xml  because we have R.layout.main as an argument.
In Brief  AndroidManifest.xml file execute the Launcher Activity class and from the launcher activity onCreate method will execute the Design View file by using setContentView method.


Android Apk
Read More..

Android Hello World Application Example For Beginners

Create “Hello World” application. That will display “Hello World” in the middle of the screen in the
red color with white background.

Click Below Link to download Hello World Application. Although i recommend you to read below steps to understand how to develop Android Application

Download Hello World Android Application

Create Hello World Application follow these basic steps. Below Steps are after the configuration of SDK Manager and eclipse.
STEP 1
Start Eclipse and Choose Workspace where you want to save your project

STEP 2 
Click on the file menu -> Select New -> Choose Android Project
 New Android Project Dialog will displayed and fill the required information and click on the finish button



Here In Above Dialog box Create Activity is the name of class you want to specify for your default Activity which will be loaded first when Hello World Example will be executed.


STEP 3
From the Project explorer click on the HelloWorld  -> res - > layout. it will show the main.xml inside layout folder. double click on the main.xml. By clicking on main.xml it will show something like.

Drag the Text View Control from  left panel to black box. and click on the main.xml tab show bottom left near Graphical Layout. now the main coding or designing part starts.

Main.xml file content for Hello World Example

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android_orientation="vertical"
    android_layout_width="fill_parent"
    android_layout_height="fill_parent"
    android_background="#999">
 
    <TextView
        android_layout_height="fill_parent"
        android_text="Hello World"
        android_textColor="#900"
        android_id="@+id/textView1"
        android_layout_width="fill_parent"
        android_gravity="center_vertical|center_horizontal">
    </TextView>


</LinearLayout>

STEP 4
When you drag  control to Graphical Layout  in background it will generate the xml code appropriate to those control. In our Example we have dragged TextView Control so here we can see the TextView tag. and LinearLayout tag. LinearLayout is the default layout which hold the View Control as well other Layout if you want to specify for your design.



TextView

We have android:text = "Hello World"  attribute which show the text to screen. here we have specified "Hello World".

android:textColor="#900"  you can specify the Text Color in RGB format RED , GREEN and BLUE.
android:layout_height="fill_parent"  TextView Control Height would be equal to the height of its parent control. in our example parent is LinearLayout. same thing would be applied to android:layout_width

android:gravity="center_vertical|center_horizontal"   you can specify the alignment of the control

LinearLayout

android:background="#999"   We have Specified the Background color of LinearLayout to White Color

STEP 5
Click on the run  to execute our Hello World Application Example.


Download Hello World Android Application


Android Apk
Read More..

Google Now Application accept the award for Innovation of the Year



Google Now one neat feature that was first buried in Android 4.1 Jelly Bean has received the award for Innovation of the Year from Popular Science.

In the Popular Science publications praised Google Now as the first virtual assistant who actually answered the needs of users.

Google Now, an expansion of the service in which Google Search has pinned many intelligent capabilities that will help the user to monitor the weather, show the location, and provide recommendations of places that should be visited by the user.

Advanced application Google Now can also be accessed from the lockscreen or via the Google Search widget, then the user will be given a simple search engine that is ready to receive questions or voice commands.

So, unlike that Siri uses Wolfram Alpha as the brain, the application Google Nowmaximize the functionality of the search engine Google to answer and provide information needed by users of Android devices.
Read More..