Introduction: Android Development: Creating a Basic Calculator
Welcome to a fun tutorial on making a basic calculator on an Android application. In this tutorial I will guide you through downloading all the necessary software, designing the layout of the application, coding the application to make it work properly, and finally how to run the application on an Android Virtual Device.
While creating the tutorial I assumed that the viewer already has a good understand of the JAVA language. In the tutorial I do not go into specific detail about the code I am writing besides a basic background of the new android parts. After watching many other Android tutorials however, I realized this is how many of the tutorial videos handle the JAVA knowledge.
- Working Computer
- Windows / Mac / Linux OS
- Drive to learn
- Android Device (OPTIONAL)
If any questions arise during the 10 part video series, make sure to go to the final step in order to find my contact information that will allow me to personally address your question to provide you with a solution in a timely manor.
I have attached the two files that we were coding with during these tutorials. If for any reason you get lost while following a long or can't figure out an error, these will be a good place to look since they contain the working code of the application.
Step 1: Step 1: Download Java JDK
In this step I will guide you on how to install the Java JDK to your machine in order to correctly run the java code you will compile in later steps.
Step 2: Step 2: Download Android SDK
In this step I will go over how to download the Android SDK to provide you with the tools needed to develop your first Android Application. These tools include the AVD manager, the Eclipse development environment, and multiple plugins that will be used in the background.
Step 3: Step 3: Setting Up AVD (Android Virtual Device)
In this step I will go over how to set up a AVD (Android Virtual Device) in order to run your code on in future steps. Once you successfully create your AVD and it is starting up, I suggest moving onto the next steps since the boot time takes roughly 10 minutes. You will not need it booted up until step 10 so you will have plenty of time.
Step 4: Step 4: Setting Up Eclipse Environment
In this step I will go over how to set up the Eclipse development environment to get you started on programming your first Android application.
Step 5: Step 5: Creating Textviews for Layout
In this step I will go over how to design and set up the input and output textviews that you will be using in your Android Application.
Step 6: Step 6: Creating Buttons for Functionality
In this step I will go over how to create and design the buttons that you will use in your Android Application.
Step 7: Step 7: Setting Up the Main Activity Java File
In this step I will go over how to set up the main activity java file that you created in step 4. This code will be the background code for your program and will allow the buttons and textviews to function properly.
Step 8: Step 8: Making the Buttons Function Correctly
In this step I will dive further into the main activity java file to show you how to get the buttons to do the necessary calculations with the input values based on which button you pressed.
Step 9: Step 9: Outputting the Results
In this step I will finish off the main activity java file by outputting our results to a textview that we created in step 5.
Step 10: Step 10: Running the Application
In this final step I will go over how to run the completed Android application on the AVD that we set up in step 3. Once you have finished this step and successfully ran the application, you have completed your first Android tutorial!
Step 11: Conclusion & Contact
Thank you for following a long with my Basic Android Calculator tutorial. I hope you guys enjoyed the 10 part video series and learned a little more about development in Android. If you want to dive further into programming with Android I suggest thenewboston's tutorials on YouTube. This series provides over 200 tutorials starting from the most basic of programs, to more advanced and complex logic.
After creating numerous tutorials and guides on Android Development I have learned that you can never prepare for an error that will arise when trying to make your first Android application. In order to accommodate for this, I have provided you with my email address so that you can email me with your problems.
Please include in the email:
- Your Name
- Tutorial Name
- Your Problem
- Screenshots of your problem
When I receive this email, I will try and recreate your problem in order to help you solve it and get back to you within 5 days. Please allow for an additional 2 days before emailing me again with your problem due to my busy schedule at times.