Developing Android application is not too completed or difficult as you might think. If you try like 30 minutes to 1 hour, you may crate a simple application easily. Today, I tried just about 40 minutes to build a simple application which can convert from Celsius to Fahrenheit temperature and nothing else! And I have completed that. Later, I decided to create a HubPage so that it may be helpful for other novice / beginner of Android application developer. Remember, this tutorial is very very short and focused and only for new learners. It's is not very helpful for Expert Android developer.
Simple Temperature Converter (Celsius to Fahrenheit):
Step 1: Create Android Application Project
First create an Android Application Project using Eclipse ADT. Give it a name like Converter or whatever you like. For this tutorial, we will call this as Converter. After the completion of this Android Application Project, you will find the following project structure.
Step 2: UI designing
We need to convert from Celsius to Fahrenheit. So, we need two input / edit type of fields only. To mark those fields, we need two tags / texts. And finally, we need one button to convert the process. So, our application may look like the following:
The xml code to create that above UI, are the following:
Step 3: Java code for implementing the logic
Our goal is to read one field value and then convert it and finally display that result to the other filed. So, we need two fields to store and display the result. And the calculation will be completed upon clicking the OK button. The full code of this looks like the following:
Step 4: Run the application and test
After successfully running, you will find the following temperature converter Android application. Just type some value in the Celsius field and press OK button to see the action.