Developing Android applications Part 2

Posted by in Mobile Development category on for Beginner level | Points: 250 | Views : 3492 red flag
Rating: 5 out of 5  
 2 vote(s)

After setting up your environment, your fingers might be itchy to start writing code. Hold on there, it is not yet time, Lets take a tour of the IDE itself. You will not see code in this Part 2.
Read Developing Android applications Part 1 before this article.


After setting up your environment, your fingers might be itchy to start writing code. Hold on there, it is not yet time, lets take a tour of the IDE itself. You will not see code in this Part 2.

The main objective is to get you familiar with the environment that you just prepared in the previous part of this article. This will be a tour that will guide you on where to get what you need once you start writing code.  

The IDE  
If you have been developing before, you have probably used IDE’s like Visual Studio most of the IDE’s are build the same way or built with the same objective, which is to make a development easy and seamless. Eclipse was not created only for Android, there are many things that are in the IDE but cannot be used for Android development. This article will try to give you the basics on what you need to know to get started other things will be learned as you explore the IDE. 

Menu Bar  

In the horizontal men bar there are different options that are presented to the developer, but they should not confuse you, as they are not all useful for an Android developer.  Menu bar is flipped to appear vertically so we can have a better and clearer view of the menu bar.  Diagrams are numbered so we can know which is we are referring to. 

Figure 1.1 

Below is the table that describe briefly what each button on the tool bar does. At the top of the menu bar, there is a menu which works the same way as other IDE’s you have used before, I will not explain that, it is just basics.

Create a New Android Project  
After you have installed all software needed to get started, once needs to do one last thing which does not take long to get started. If you start Clicking on a new Project button numbered 1 in figure 1.1, you will notice that there is no option to create an Android Project. As stated earlier in this and previous article that Eclipse is not out of the box an Android IDE , one need to add a few things to make it work. The next step you need to install the Android Plugin for Eclipse. This can be done by following the steps below.   

Step 1 
Select the Help menu item and choose “Install New Software” 

Figure 1.2  

A dialog box will appear. In the “Work with” box enter the following URL and below a list of plugins will appear. Select all of and click Finish and the Android plugins will be installed. After installation you will be prompted to restart Eclipse, agree to that you will be ready for our next Step which is to create a new Project

Figure 1.3 

Creating a New Project  
Now that we have installed all the necessary software and plugins our Eclipse development environment is ready for development.  The First thing to do is to click our first button which gives us an option to create different kinds of Projects as depicted in Figure 1.4  

Figure 1.4 

You will see an Android option will now appear, but with lots of Options. We will look into some of them because you will not use all of these options

 Other options are skipped as they are self-explanatory.  
You can select “Android Application Project” option and click next, a dialog box will appear as depicted in figure 1.5   

Figure 1.5 

The First requirement here, is the name of your application, Article has “HelloWorld” and the Project Name is the same as the app name. The Package name is the name of the Installation File. If you were to publish this to the market, this will be the name. The name start with com separated by a dot and followed by a Company name and lastly the name of the application.  If you don’t have a company, you can just add your name without spaces.  

In the part 1 of this series we were installation the sdk’ s that we wanted to target and here they play a big Role. There is a Minimum SDK that we want to target and also maximum which is selected in Target SDK. We have also theme which is irrelevant if one uses his own template.  
Click next and the dialog box will appear as depicted in Figure 1.6   

Figure 1.6 

Eclipse will create a workspace for you, where you can have multiple project that are not conflicting with each other,  it will also create an Activity , your MainActivity and also it can give you an Option to create this project as a library that can be reused in other Projects.  

Click Next to move on the screen where we generate the Drawables, which are the images and icons for the app as depicted in figure 1.7 

Figure 1.7  

Figure 1.8 depicts the option for the developer to upload the icon and the Eclipse will generate different sizes of that image. This is required when one need to install the app in different devices of difference sizes. Also every app is required to have this before it gets submitted to the stores.  
Click Next to choose the Type of Activity you want as depicted in Figure 1.8 

Figure 1.8  

Figure 1.9 gives a developer an Option to create a black Activity (screen), Blank Activity with some Fragments. A Fragment is a User control in It get rendered inside the Activity and it has its own lifecycle. There are many options there that one can choose from, but for now let’s choose the Blank Activity. 
Click next to give the activity a name as depicted in Figure 1.9 

Figure 1.9  

Figure 1.10 depicted an option for the developer to give the Activity or Screen or page whatever you want to call it, a name. But I rather let it remain like this and click finish.  

A Project will be created as depicted on the Solution Explorer or Project Explorer as depicted in figure 1.10  

Figure 1.10 
As you can see the File Structure is not a simple and clear one, in the next article, I will explain the file structure and tell you where to find what you need.  

This was the simple introduction on how to get started, on the next part of this article we will explain the file structure and also show you how to run this Project on your Phone and also we will create a virtual phone where we can deploy our app and test it on our development machines. 

Read Coding Android applications Part 3 after this article.
Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: Vuyiswa Maseko
Member Level: NotApplicable
Member Status: Member,MVP,Administrator
Member Since: 7/6/2008 11:50:44 PM
Country: South Africa
Thank you for posting at Dotnetfunda [Administrator]
Vuyiswa Junius Maseko is a Founder of Vimalsoft (Pty) Ltd ( and a forum moderator at www.DotnetFunda. Vuyiswa has been developing for 16 years now. his major strength are C# 1.1,2.0,3.0,3.5,4.0,4.5 and and sql and his interest were in, c#, Silverlight,wpf,wcf, wwf and now his interests are in Kinect for Windows,Unity 3D. He has been using .net since the beta version of it. Vuyiswa believes that Kinect and Hololen is the next generation of computing.Thanks to people like Chris Maunder (codeproject), Colin Angus Mackay (codeproject), Dave Kreskowiak (Codeproject), Sheo Narayan (.Netfunda),Rajesh Kumar(Microsoft) They have made vuyiswa what he is today.

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)