So, it’s time for another post. Let’s start!
In the last post, we treated the entire project folder as a black box and just performed some steps to create, debug and run an Android project. We also touched upon the concept of emulator. Now, it’s time to go inside the project folder and discuss each component separately.
Let’s have a look at the project structure created yesterday.
The top level folder is the name of the project. It’s the folder in your work space where all the files related to your project will be placed.
There are various files and sub-folders under this heading:
- src: As the name suggests, it is the name of the folder where all the source files are stored. If you click at the package name, you will find a file called *.java where * depends on the name of the activity you chose while making the project (Remember?). Do you see any need of having a package at the top? If not, wait for sometime.
- gen: This folder has files that are automatically generated. We will look at these files a little later. No need to worry for now!
- res: (Folders in between! Not much important. I will discuss if you ask for it.) . The sub-folders whose name start with “drawable” store the images which act as icons for the app in the various places in Android platform (the different folders are used to store different sizes as the icon size in the menu is different from the one in task manager and so on. Doesn’t make any sense! Don’t worry, we will come to it when we will try to change the icons of our apps. There are two important sub-folders named layout and values. We will look upon them in a greater detail in the next post.
- Android Manifest.xml: This file acts like a template used to tell the Android about the components of the project and it’s specific requirements. For example, it specifies whether the project is compatible with Android 2.2 or it requires any higher version. It also specifies which java file is the starting file for the project. For those who are realy curious, double click on it and go to AndroidManifest.xml tab (bottom of the editor window) and try to make sense out of it. For the rest, we will modify this file only when we will be talking about something called an Intent.
This tutorial was meant to be an overview for the posts to follow. In the coming posts, we will be playing around with the layout and values folder, and look at their capabilities in changing the properties of the app. Please share with me any kind of difficulties that you may be having. I will be happy to help!
Coming up with the next post soon!
Till then, Bye!
So! Finally, the wait is over. We are ready to make our first android app. But, keep in mind that the motto of this app is not to go deep into the programming concepts, but to familiarize ourselves with the Eclipse IDE and Android SDK, touching the most trivial but fundamental concepts in android app development.
Since most of the programming tutorial start with making a “Hello World” app, I will also try to do the same. But since there can be various version of a “Hello World” app in Android (HOW? We’ll see!), I will start with the simplest in this tutorial and will be build upon it in the later post, finally leading to the development of the really tough one. Without wasting more time, let’s get straight to the point!
Familiarizing with Eclipse
Let’s start the Eclipse and focus on its various components. While starting, it may ask for a work space. Just let it be the default one but remember it, as all of your projects will stored at this address.
If you are opening it for the first time, you may see the Welcome screen. You can take sometime to explore. But, you can close it for following the tutorial. After doing so, you will see a screen split into various parts.
OK! Now, let’s analyze each of the components.
The left most component (called Package Explorer) shows all the projects that exist in your work space (described above).
The bottom right panel has further tabs, of which the Console shows the execution of the program. We will be discussing about the other tabs as we go along.
The middle section is simply an editor which allows us to write our code
Now, lets look at the toolbar. If you have successfully configured the development environment, you will find two additional icons (one as a link to Android SDK manager and other to AVD manager). Have a look!
AVD Manager stand for Android Virtual Device Manager. It is used to make emulators. Heard of this word?
For those who didn’t, emulator is used to provide a virtual Android-like environment to the developer in order to allow the development of the apps by the people who don’t have an Android phone. Since there are multiple versions of Android avaliable, there are multiple versions of emulator too. This AVD manager allows us to make the emulator of the desired version with the desired requirements. We will be looking on the process when we will come to the debugging and execution of the app (Debugging?? Just wait for sometime!!).
Each android app is the result of a project. You can consider the app as the output when you are able to successfully compile the app, just like .out is the output when you compile a C program with GCC (though the app may not function as desired because compilation doesn’t ensure proper execution). As a result, most of the beginners tend to end up seeing “Application stopped unexpectedly” error in spite of the entire process being error-free.
So, if you also end up doing so, don’t get disheartened! It’s a necessary step in learning.
OK. moving on, let’s create the project.
- Go to File->New->Android Project.
- Choose a Name. I will choose Hello World.
- Select a platform. For me, it’s 2.2.
- In the package name, choose something that has the form com.*.*. I am choosing com.hello.world.
- Leave the other things as it is. Click Next and Finish.
So, I am back again. I had thought of starting the app development from this post, but I think an important matter still remains to discuss. The software that one needs to use for the purpose!
Well! A lot of stuff needs to be installed to be able to start the development. Let’s go through each of them one-by-one.
It is required to be able to write and compile Java applications. Follow these steps to install it.
- Go to www.oracle.com/technetwork/java/javase/downloads/index.html
- Download the latest version of Java JDK
It is the Integrated Development Environment (a software used to edit, compile and run the apps) which we will use to write Android applications. Here are the steps:
- Go to www.eclipse.org/downloads/
- Download the latest version on Eclipse Classic
- Go to http://developer.android.com/sdk/index.html
- Download the latest version of Windows Installer (.exe file)
- Set your browser at no proxy (since the Android SDK does not have the option for proxy authentication)
- Run the above downloaded .exe file and let it download the required components
After installing the above four software packages, you are ready to start!
Now, you can start familiarizing yourself with the Eclipse IDE and Android SDK.Just try out the various options and understand how to make new project, include libraries, etc.
I hope that this proves to be a helpful guide for all those who face a lot of difficulty in setting up this development environment. Please provide your feedback and suggestions if any.
I will start with the coding assignments soon. In the next post, we will familiarize ourselves with various features of Eclipse IDE and Android SDK and will go on to make our first “Hello World” Application in Android.
See you then!
PS: For all those who have been able to set up the environment, please comment so that I can have an idea of the number of people who are going to follow my blog and make some really cool android applications.
As a site on Android app development must start with a proper introduction, I will also try to follow the same convention, though I will not follow any convention in trying to make it proper as I am not planning to give any details of the Android architecture (at least in the intro).
OK! So, let’s start with most basic question, What is Android?
Android is an operating system optimized for mobile phones, i.e., Android running on a smartphone is similar to Linux (Windows??) running on the PC.
So, Are there any other questions? I feel that there are!
Android! Why is it so popular? Why is it that you find various android app stores, selling millions of apps free to the users? Why do all the mobile based projects mainly target the Android platform?
Even the newbies to the Android World may be able to answer the above questions with just a sentence, “Android is Open Source” (the reason for my comparsion of Android to Linux) , though many may not be clear of how it being open source helps in making it so popular.
Android is Open Source, i.e, one can download the Android source code (for those who are pretty eager to do it, please go to source.android.com), edit it and change the complete structure of it (but if you can do that, please don’t follow this blog). This makes the entire API (I will come on it, but for now you can take it some libraries and functions that are available in Android) available to the user and hence, gives him the power to exploit all the features of Android, allowing him to make some really interesting and useful apps, which is clearly reflected by the number of apps available at the app stores. Coming on to the fact about mobile based projects, Android source can be optimized for all the available platforms, which makes it an obvious choice way above the others.
Having talked about the various basic features of Android, its time to move straight into making Android apps. The next post will focus on the development of the most basic app on Android.
Till then, Bye!
This blog aims at providing tutorials and coding assignments to make it easier for the beginners to grasp the various aspects of Android App Development. The coding assignments will comprise of making some Android applications, the best of which will be published on the site at the end of the week.
Hoping to see a great response!!