Tuesday, August 21, 2012

Creating New Application in Android ICS..


Creating a new Application in Android through Eclipse IDE is very Simple... Just some points to be remembered of are listed below.

For Development, I'm using following,
Eclipse Juno,
Android 4.0.3 (API Level 15)
Ubuntu OS

After all the configurations done to setup Android In your system, To Start Creating a New Application,

Start Eclipse, Select File > New > 'Android Application Project',

If In New Selection, If 'Android Application Project' do no appear then,

Select Other > Android > Android Application Project.

Now Following Dialog / Wizard opens to Create New Project,

Fill in the Entries for Application Name, Project Name and Package Name.
Application Name will be shown in Playstore when you host your application, as well as in the Manage Applications Menu in Settings option in your Phone when application is Installed.

Project Name is used by Eclipse, it should be unique in the workspace meaning that no other application in the Eclipse workspace should have the same name.
Typically Application Name and Project Name will be the Same, Here I have kept as 'HelloApplication'

Now comes the package name, i.e. Base package name in which the first class / Java File corresponding to Main Launcher Activity will be created. It should be a valid java package name.

Also check that 'Create custom Launcher Icon' option is by default checked, If this option is checked, in the next wizard it will ask for the custom, icon, text etc for Launching your Android Application, If you dont want a custom Icon and want to go with the default ones you can unckeck this option. I will keep this option as checked.

After above entries is filled in, Go for 'Next' Option, you will get the following wizard, To Customize your Launcher Icon,

In the foreground Option, Select Image, Browse the Icon which you wish to keep it as launcher Icon for your application, I have selected the Image of Computer here, Also for the Shape option, select 'None'. ( by default, Shape selection will be circle which will have a white spaced circle around your Icon)

Select Next, and wizard will have two options to create Activity, as shown, 

As you are creating first project select BlankActivity And Press Next,

Next, Wizard will as to fill in your first Launcher Activity Parameters as follows,

Fill In the ActivityName, LayoutName and the Title t the Application,

ActivityName will be the name of the JavaFile/Class File for the Main Launcher Activity.

LayoutName will be the name of the Android XML layout file for the Main Launcher Activity where your UI elements will be defined.

Next is the Title of the Application which will be seen in Launcher as well as the Title of the Activity.

Fill in the Required values as press Finish which will create the default Hello World Application with your filled parameters values as follows,

Now create a new Android Emulator to test this new Application created as follows,

When you run the Application by right clicking on the Application name in Eclipse, Select Run As > Android Application, Emulator will be launched with your Application running as shown

In the Above Image notice the Title 'Hello' and the Custom Icon i.e. The Computer Image we used as parameters in create new application wizard.

Also If you go in to browse the applications in your Emulator, In the Applications Listing you will see your Application with your custom Title and Custom Icon as follows

Notice the Application Named 'Hello' with the computer Image in the Application list.

So here you are...!! Done with creating a fresh new Application in Android with your own Custom Icon and App Name.!!

I hope this article helped the beginers to create new Application.

Happy coding!


1 comment:

hiren said...

its 2 good for start up......very helpful....

Animated Container in Flutter

Please check this flutter video tutorial for detailed example and implementation of Animated Container in Flutter.