Let's started with our calculator android App
Hello, friends and this is my first video and I am trying my best in this video. I have to make a CALCULATOR APP in the android studio. you can learn coding in an easy way and you can make your own application through the android studio.
Step-1
- Open your Android Studio
- Click on Start a New Android Studio Project.
- Give your Application Name
wctutorialcalculator
and leave other fields blank as it is, then clicks NEXT.
Step-2
- Select the Minimum SDK
API 15: Android 4.0.3(IceCreamSandwich)
. I selected because it covers almost 94% device and it has almost all the features. If you want to cover 100% device then you can select API 8: Android 2.2(Froyo).
Step-3
- Select the
Empty Activity
and click NEXT. - Leave the activity name
MainActivity
as it is and leave everything as it is. Click Finish.
Products Use For Making Videos:
Tripod: https://amzn.to/33nZ5Qx
Camera: https://amzn.to/35C3KB4
Laptop: https://amzn.to/3bZcMJS
LED Tubelight: https://amzn.to/2ZwAF6C
Step-4
- After clicking Finish, it takes around ~2-3 minutes to build Activity and files.
- Here is a final project structure for your application.
Step-5
- Now we have to add our Java code in our MainActivity.java file.
- So open you
MainActivity.java
file from left side of IDE (app -> java -> com.wctutorial.wctutorialcalculator -> MainActivity.java)
- In-Line 156 – 183: Here we set click listener on “=” button. We put condition like if the user click the Add button the
wctutorialAddition
value is set True on the click listener of the Add button.
- After we set the
crunchifyAddition
value to false, so that we can perform Add an action again.