ad

Create a Basic Calculator on Andorid Studio




Hello Guys in this tutorial you will learn , how to create a basic calculator on Android Studio?

So First create a new project on Android Studio , select empty Activity click next then Finish.

Go to activity_main.xml and create Buttons and two editTexts as shown below

activity_main.xml



Then go to MainActivity.java then copy below code then paste in your MainActivity.java (Please delete all the code in the file except package name then paste the code given below)

MainActivity.java



Still getting problem? (Watch the tutorial)



Custom Buttons in Android Studio



Custom Android Button in Android Studio

Here I have shown you how to create custom Buttons in Android Studio, you can copy the below codes and can change as per your need

activity_main.xml


create below files in Drawable folder , right click on folder then click new then Drawable resource file.
circle.xml


oval.xm


round.xml

rectangle.xml

backgroundlayout.xml

MainActivity.java

#2 Create a Project

Step 1: Start and configure the project

Click Start a new project


Enter Your preferred app name and click next

Step 2: Select form factors and API level

1)Select api level if you want your app to run on maximum devices then select lower api versions
2)Click next



Step 3: Add an activity
1)Select an activity (Click an Empty Activity for begineers)
2)Then Click next





Step 4: Configure your activity And Click Finish

#1Download and Install Android studio




#1 Download and Install Android studio

Setting up Android Studio is very easy, just download ANDROID STUDIO.

After Downloading just follow below steps.
  1. Launch the .exe file you downloaded.
  2. Follow the setup wizard to install Android Studio and any necessary SDK tools.
That's it! The following video shows each step of the recommended setup procedure.



<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-1791536856250563" data-ad-slot="2121468758"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

For Windows




For Ubuntu

Recently added

Create a Basic Calculator on Andorid Studio

Hello Guys in this tutorial you will learn , how to create a basic calculator on Android Studio? So First create a new project on An...