How to make a Calculator in Android Studio | 2024

Поділитися
Вставка
  • Опубліковано 3 лют 2025

КОМЕНТАРІ • 344

  • @EasyTuto1
    @EasyTuto1  2 роки тому +31

    implementation 'com.faendir.rhino:rhino-android:1.5.2'

    • @melanialeonelli5154
      @melanialeonelli5154 2 роки тому +1

      where?

    • @EzaZigzag
      @EzaZigzag 2 роки тому +1

      why my number button keypad background not change when i switch to dark mode ? thank you

    • @naveenpenagaluru4580
      @naveenpenagaluru4580 2 роки тому

      implementation 'com. faendir. rhino:rhino-android:1.5.2'

    • @m5553
      @m5553 2 роки тому +3

      hi
      it is not working
      please help

    • @EzaZigzag
      @EzaZigzag 2 роки тому +2

      @@m5553 did you already sync your gradle?

  • @raghavkr2746
    @raghavkr2746 Рік тому +54

    "Say hello to this hello world and delete it", That was smooth af!!💫💫

  • @emmanuelreuven7350
    @emmanuelreuven7350 2 роки тому +18

    You are awsome, thank you.
    It was so easy to do this with your explanation.
    I managed to finish it from scratch in 2-3 hours, including finding myself installing Android Studio and the Emulator.
    Thank you so much.

  • @thebhagwabilla
    @thebhagwabilla 10 місяців тому

    bhaiya your explanation is always the best among all the people. You own a huge respect and position in my android journey. ❤❤❤

    • @EasyTuto1
      @EasyTuto1  10 місяців тому

      Thank you so much 😀

    • @Ilovedoingthingsthatidontknow
      @Ilovedoingthingsthatidontknow 5 місяців тому

      Did ur code worked ?? Mine giving error on adding dependcy..can u plz help me with this

  • @q.w.e.r.t.y27
    @q.w.e.r.t.y27 Рік тому

    u r literally god for me rn..u helped my finish my prject

    • @EasyTuto1
      @EasyTuto1  Рік тому +1

      Thank you

    • @q.w.e.r.t.y27
      @q.w.e.r.t.y27 Рік тому

      @@EasyTuto1 it is showing an error on 14:08 for me on the getText and the setText

  • @ruduplays8769
    @ruduplays8769 2 роки тому +3

    THANK YOUUUU because of this video i understood all the basic concepts of android studio!
    keep making content like this! i love it.

  • @visheshdahiwale748
    @visheshdahiwale748 2 роки тому +1

    Thank you brother... the way of yours teaching is very simpler....

  • @NehaMajithiya
    @NehaMajithiya 11 місяців тому +1

    Project done thank you sir👍😊

  • @alexeymatveev9031
    @alexeymatveev9031 2 роки тому +5

    Thank you. There are minor problems, like if keeping pressing AC it goes below 0, but this is even better to solve as homework. Thank you very much!

    • @bobbygraphics
      @bobbygraphics 2 роки тому +2

      Change if statement to while..so while ac is above 0. It must clear

    • @alexeymatveev9031
      @alexeymatveev9031 2 роки тому

      @@bobbygraphics Thanks a lot. May be you can give me some heads up about the hardware requirements? I've set aside Android because it took like 5 minutes to recompile after every minor change. What is the preferred laptop configurations for this? I have MacAir with 8GB and I suspect there is something wrong about it not with configuration.. It should not be that demanding I guess...🙄🙄

    • @ashish_more
      @ashish_more Рік тому

      @@alexeymatveev9031 I also have the same MacBook Air m1 base variant , and android studio is taking 3 gb of ram and the emulator is taking 5gb of ram and java is taking 1.5 gb of ram ! I don't know why it has such a high ram usuage!

  • @imanonymous02
    @imanonymous02 Рік тому

    The way you explain it, this was easier than making maggi. 🙇

  • @Siddharth_Creation563
    @Siddharth_Creation563 Рік тому +1

    I love you sir 💗💗💗💗💗
    Success hua
    So thank you so much ❤️🙏
    Gurudev 😊😊😊😊

  • @knightwor
    @knightwor 2 роки тому +2

    nice bother keep growing ☺️👍

  • @ZTechTutorials
    @ZTechTutorials 2 роки тому +1

    kiya bat hay. buht hee umda.. thanks.

  • @zo0oi_574
    @zo0oi_574 2 роки тому +2

    Very nice
    Keep going👍🏻

  • @jrstudzinski1986
    @jrstudzinski1986 Рік тому

    Incrível! Parabéns pelo trabalho! Funcionou perfeitamente! Ganhou mais 1 inscrito brasileiro! 👍👍👍

    • @EasyTuto1
      @EasyTuto1  Рік тому

      Muito obrigado pelo apoio entusiasmado! Fico feliz em saber que você gostou e que agora tenho mais um assinante brasileiro incrível! 🎉 Seja muito bem-vindo à comunidade! Estou aqui para ajudar no que precisar. 😊

  • @Naveen_Kumar0826
    @Naveen_Kumar0826 Рік тому

    ❤❤❤❤❤❤thank you great work

  • @ScaryBeats777_montage_creator
    @ScaryBeats777_montage_creator 2 роки тому +7

    My PC not accepting 'JavaScript ' keword showing error at time of importing in main activity
    Plzz reply...

  • @trog-l5k
    @trog-l5k 4 місяці тому

    bro i learned so much fr thx

  • @history_funy
    @history_funy 2 роки тому +1

    Verry good and easy following speech !!

  • @Mathu_meow
    @Mathu_meow Місяць тому

    Can you please tell about that what is the backend and frontend used

  • @demstheprogrammer
    @demstheprogrammer 2 роки тому

    Thank you for this toturial i hope its work in my compiler when i code this later

  • @Shashank-pu1qo
    @Shashank-pu1qo 2 роки тому +6

    Import org. Mozilla. JavaScript. Context... Giving me error😭

    • @hexagaming9170
      @hexagaming9170 Рік тому

      Mai apka problem fix kar sakta hu
      Contact karo mujhe mere about section me Whats app no. hai

    • @Ilovedoingthingsthatidontknow
      @Ilovedoingthingsthatidontknow 5 місяців тому +2

      How did u solve that ... same thing giving me error

    • @TZCoder
      @TZCoder Місяць тому

      Make sure cAsE is correct Mozilla is different from mozilla. Only Context has capital letter.

  • @HussnainAli-so4xq
    @HussnainAli-so4xq 8 місяців тому

    Awesome 👍

  • @antaryamidas3319
    @antaryamidas3319 Рік тому

    Why u use a relative layout at starting 0:55 ?

  • @dhruvsharma5786
    @dhruvsharma5786 Рік тому

    Thanks sir 🙏

  • @bromonsterking
    @bromonsterking 2 роки тому +1

    Really you are great, and thank you ❤️

  • @mrigankadas6684
    @mrigankadas6684 2 роки тому +35

    🤣🤣say hello to this hello world and delete it. Such a dominance over hello world programs.

    • @tesfamichaelalmaw
      @tesfamichaelalmaw 10 місяців тому

      🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣

  • @moubiswasEdits
    @moubiswasEdits 7 місяців тому

    Thank you for the tutorial

  • @cheong34lol35
    @cheong34lol35 7 місяців тому +2

    how do you change the libs thing in your gradle part

  • @luxiouslyrics8617
    @luxiouslyrics8617 2 роки тому +3

    What could be the problem because when I open the app and click any button, an error message appears saying "App has stopped".

    • @jampasemp1186
      @jampasemp1186 11 місяців тому

      U have to declare ur activity in the androidManifest

  • @YogeshJangid986
    @YogeshJangid986 2 роки тому +1

    Hi, First of all thank you for creating this project. I downloaded the project and tested. It has some bugs, When we minus 100-100 = It's giving wrong value as well as % isn't working. Please check once.

  • @catalintudoreanu8880
    @catalintudoreanu8880 2 роки тому +1

    thanks man, you good dawg

  • @ilmdotcom6767
    @ilmdotcom6767 Рік тому +1

    thanks buddy.... but at last when you imported the libraries, it is a bit confusing for newbie..

  • @happymiki
    @happymiki 2 роки тому +2

    Nice brother 🎉 😍 😊

  • @Pluto-qi9gh
    @Pluto-qi9gh 8 місяців тому

    Just completed this tutorial. Running android studio jellyfish. I used java language but was forced to use kotlin dsl. there were quite a few changes that needed to be made. However, I had chat gpt 4.0 correcting the errors in the code along the way. But, I got it to work. Thanks again for a great video. Only suggestion from me would be to slow down just a little when you complete a few lines of code to make pausing the video a little easier .

  • @SADIQLLC
    @SADIQLLC Рік тому

    Thanks bro
    I have created it for same like your work but the plus button just works other all not working like minus multiplay divide, please guide me how to solve it...

    • @EasyTuto1
      @EasyTuto1  Рік тому

      Something is wrong in the code.
      Try resolving. ❤️

  • @fyft84
    @fyft84 Рік тому

    Thanks bhai ❤🎉

  • @j.m2312
    @j.m2312 Рік тому +1

    there are errors in main. activity. java file.
    its my first app and i can't solve it.
    i need help sir 🥺 plz

  • @someone7307
    @someone7307 2 роки тому +3

    why the implementation 'com.faendir.rhino:rhino-android:1.5.2' didn't work? it has a new one now?

  • @JesusTeambijnor
    @JesusTeambijnor Рік тому

    Brother, where will you publish this on Playstore, please tell me.

  • @lohithyadav7225
    @lohithyadav7225 2 роки тому

    Good one 👍👍

  • @KhushiDreamscape
    @KhushiDreamscape 2 місяці тому

    sir new implementation library?

  • @ultragameryt1780
    @ultragameryt1780 Рік тому

    Awesome 👍😊

  • @syedfaisal417
    @syedfaisal417 Рік тому +1

    Hi brother I am from Pakistan, When I press C button for multiple times and at the end when there is no value and I press C button then the application gets close automatically and I see the library name of JavaScript in Text view. Please provide the solution. Thanks

    • @EasyTuto1
      @EasyTuto1  Рік тому +1

      Yeah you can just add condition when there is no value.

  • @KJ7JHN
    @KJ7JHN 9 місяців тому

    @EasyTuto1 do you have a video that uses a keyboard listener?

  • @mouaadibnujabal3919
    @mouaadibnujabal3919 8 місяців тому

    Thank you bro

  • @MichaelLuisFelasol
    @MichaelLuisFelasol 4 місяці тому

    its 2024 and my gradle is language is kts is there a way you can change it to the one you used?

  • @soylent0815
    @soylent0815 2 роки тому +8

    Any idea how to keep the exact precision when calculating? For example 6.1 multiplied by 3 results in 18.29999999999997. I guess it has something to do with the floating point numbers, but I can't figure out how to handle this problem in the code from this video... Apart from that - great tutorial! 👍

    • @heterawasmapreha
      @heterawasmapreha 2 роки тому

      second that

    • @Kamal-cn6kk
      @Kamal-cn6kk 2 роки тому +4

      Use BigDecimal class rather than floating point numbers to get accurate values.

    • @TANISHQTHUSE
      @TANISHQTHUSE Рік тому +1

      I once saw in a tutorial for addition of dollar. This error occurs because computers are poor in storing decimal number in form of binary. Convert 6.1 to 61 and 3 to 30. Multiply them , divide by 10. This should solve the issue. Simple and easy solution. Else you can always use relevant libraries in the language you are using.

  • @docps9591
    @docps9591 2 роки тому +2

    You are amazing

  • @Prncgr8
    @Prncgr8 10 місяців тому

    When I try put paste linear layout nothing comes 😢 if I try manual it doesn't work

    • @EasyTuto1
      @EasyTuto1  10 місяців тому

      Check correctly

  • @babraksohail6965
    @babraksohail6965 2 роки тому +4

    Brother Could You Explain in depth About Rhino implementation u did in your project like the purpose of using script, context.setOptimizationLevel (-1) , In short, the whole portion of try. Eagerly Awaiting for your reply !
    thanks :) Love Your Work :)

    • @felixmaundu3891
      @felixmaundu3891 2 роки тому

      Did you get an explanation?

    • @babraksohail6965
      @babraksohail6965 2 роки тому

      @@felixmaundu3891 no brother

    • @ronp1436
      @ronp1436 Рік тому

      the function gets values between -1 to 9 and what it means is that higher levels of optimization can improve the performance of the JavaScript code but may also increase the time it takes to compile the code. So for this calculator simple app it really doesn't matter

    • @kaminipal7248
      @kaminipal7248 Рік тому

      Same problem

    • @kaminipal7248
      @kaminipal7248 Рік тому

      Please reply

  • @lenovopc4257
    @lenovopc4257 Рік тому +1

    non-static method 'setoptimizationlevel(int)' cannot be referenced from a static context .....this error show! What will I do

  • @GhOsTs_369
    @GhOsTs_369 5 місяців тому

    Sir why is my 2nd linear layout overlapping with the first one ?

  • @jorgemendoza7128
    @jorgemendoza7128 Рік тому

    I have a problem, when I try it on the virtual device, the C button and others do not work and the app closes many times

  • @axelmedina8834
    @axelmedina8834 2 роки тому +1

    Can someone help me? My code does not have errors but the text view does not shows any number when i push any materialbutton

  • @PhoenixYT00223
    @PhoenixYT00223 Рік тому +1

    error showing during javascript writing??

  • @moinyesin
    @moinyesin 5 місяців тому

    The parentheses doesn't work... And there is a problem where it shows 55 when you click 5=5(nn for n=n)...another problem is it shows Err if i press 5+= (n+=)

  • @LancineDiare-ww8xn
    @LancineDiare-ww8xn 11 місяців тому

    Thank you a lot.

  • @asadbekaminboyev3311
    @asadbekaminboyev3311 2 роки тому +1

    The implementation in Gradle is working?

  • @theconfusingriddle
    @theconfusingriddle 2 роки тому +4

    Brother I am facing problem in solution Text View it's not getting clear😞😞

  • @heterawasmapreha
    @heterawasmapreha 2 роки тому +1

    How did the app theme change in dark mode? Isn't working for me

    • @niyisyt
      @niyisyt 2 роки тому

      Do you have an answer yet?

    • @EasyTuto1
      @EasyTuto1  2 роки тому

      Turn dark mode in your phone.
      It will automatically turn on.

    • @heterawasmapreha
      @heterawasmapreha 2 роки тому

      @@EasyTuto1 It works on Redmi. But when I tried on Pixel Pro and Samsung S22 Ultra, it ends up with a really ugly coloring... Any ideas abt this?

  • @Abbaskhan-qv5xd
    @Abbaskhan-qv5xd Рік тому +1

    Multiply option is not working

  • @Tiwari.A
    @Tiwari.A 4 місяці тому

    By doing the same only - and + operations are working what more to do for * and /

  • @saiungarala6686
    @saiungarala6686 4 місяці тому

    How to add that line into dependencies

  • @pranjalsrivastava14
    @pranjalsrivastava14 Рік тому

    Hi I have successfully created a calculator in this but can't see anything on my emulator. What might be the issue?

  • @Mathu_meow
    @Mathu_meow Місяць тому

    Anyone please reply here what is the Backend used?

  • @Aakash983
    @Aakash983 6 місяців тому

    How to open in Design Model?

  • @mikebledig7208
    @mikebledig7208 2 роки тому +1

    Very interesting and easy to follow. Can we have some more? Please?

  • @sakibtalukqder
    @sakibtalukqder 11 місяців тому

    too much helpful,,

  • @iamsaqeebpathan
    @iamsaqeebpathan Рік тому

    what happend if i click only C?? the app is crashed

  • @virtual_space399
    @virtual_space399 2 роки тому +1

    Bro kya hum apne android phone se calculator app bna skte h ....

  • @haiqaarshad3474
    @haiqaarshad3474 Рік тому

    can you explain whats going in gradle app ???

    • @swadeshicreator9717
      @swadeshicreator9717 Рік тому +1

      Basically we asked gradle to add that library to our project which was not by default present for our use.

  • @aishee5961
    @aishee5961 Рік тому

    Thank you so much sir

  • @ralphsantiago850
    @ralphsantiago850 2 роки тому +5

    the part of import org.mozilla.javascript.Context;
    import org.mozilla.javascript.Scriptable; is not working for me

  • @mohamedrashid1091
    @mohamedrashid1091 Рік тому

    Bro my all functions are working good but while turn on the dark mode it will not converting in dark theme properly

  • @krupakarguvvalegi8426
    @krupakarguvvalegi8426 Рік тому

    bro while i have finished the calci there is a problem occuring like double no are coming while pressing any button can u help me bro

  • @sntiaaul
    @sntiaaul 11 місяців тому

    thank you but why my result is "err", whats wrong?

    • @EasyTuto1
      @EasyTuto1  11 місяців тому

      Check the code.

  • @KundiXola
    @KundiXola Місяць тому

    there is no activity_main_xml

  • @history_funy
    @history_funy 2 роки тому +2

    Well done your tutorial.
    There is one error.
    If you keep pressing the "C" key,
    an error called org.moailla.javascript.Undefined@o... will occur at the end.
    What could be the cause?

    • @diras1127
      @diras1127 2 роки тому +1

      that has two reasons, one is using substring(0,0) may cause crash(so you need to change the "C" part, add an if statement), and the other is that setText("") does not cause "ERR", so you need to add something to the if statement in the filling resultTv part

    • @solomonezekiel5302
      @solomonezekiel5302 Рік тому

      @@diras1127 please explain in plain english

    • @atulthakur6928
      @atulthakur6928 Рік тому

      same error . how to fix

    • @Sahil-jx2to
      @Sahil-jx2to Рік тому

      ​@@atulthakur6928 were you able to solve it? I encountered the same.......solved to some sort but got another one.

    • @joydeepbhandary902
      @joydeepbhandary902 Рік тому +1

      ADD THIS In the case of "C"
      else if (button_text.equals("C")) {
      if(datatocalculate.length()==1)
      {datatocalculate="0";}
      else {
      datatocalculate = datatocalculate.substring(0, datatocalculate.length() - 1);}
      }
      it will work😇

  • @AndroidAppBazarCompany
    @AndroidAppBazarCompany Рік тому

    Sir, I am sorry to sat that there are a bug! I When I clicked on "C" button after deleting all cumber it make error and if I also click on "C" this application make crash!😔 Please give us this solution!

    • @EasyTuto1
      @EasyTuto1  Рік тому

      You can check if no numbers are there or length is 0 then you if C is pressed you can return from there directly.

  • @fred2548
    @fred2548 Рік тому

    help me out im trying to copypaste and they keep overlaping each other
    how do I get the four buttons below one another

  • @-Poojitha-sn3vt
    @-Poojitha-sn3vt 2 роки тому +1

    When i clear all by using C
    If nothing is there ,then i click C
    Im getting an error
    Will you please give me sol for that

    • @VikasKumar-wz9ju
      @VikasKumar-wz9ju 2 роки тому +2

      same here
      please help us solve this issue
      In a clearscreen if i press "C"
      it displays:
      org.mozilla
      .javascript
      .Underfined@0

    • @rizkyfaisalrafi8993
      @rizkyfaisalrafi8993 2 роки тому

      @@VikasKumar-wz9ju Same :(

    • @techxyz5176
      @techxyz5176 2 роки тому

      you need to put a condition so the getResult method won't accept null values. Here's the code that fixed mine:
      if(dataToCalculate.length() > 0){
      finalResult = getResult(dataToCalculate);
      }
      meaning the getResult method won't accept null value when you clear the dataToCalculate variable

  • @gaura_ydv23
    @gaura_ydv23 10 місяців тому

    When we press the "C" button after the result text view becomes 0, the app is crashing each time

    • @EasyTuto1
      @EasyTuto1  10 місяців тому

      Add a condition for C if dataToCalculate.length ==0 return.

  • @sivanandham8836
    @sivanandham8836 Рік тому

    nandrigal kodi annaa

  • @samirmortada2097
    @samirmortada2097 2 роки тому +1

    Brother can u please make the code pdf or anything inorder to make copy and paste without wasting time thank you

  • @jejesan9297
    @jejesan9297 11 місяців тому

    please may i know the name of your programming tools?

    • @EasyTuto1
      @EasyTuto1  11 місяців тому

      Its Android Studio.

  • @nwcoder
    @nwcoder 2 роки тому +1

    Please upload next part on this calculator app scientific mode...

  • @muneesff5549
    @muneesff5549 2 роки тому +1

    bro Ac button was not working bro what can i do bro

  • @jonthamastersmooth
    @jonthamastersmooth 2 роки тому +1

    Do you have a version for doing this in Kotlin?

  • @imhassan4119
    @imhassan4119 Рік тому +1

    Please sir how can I import JavaScript?

  • @bcastudent6390
    @bcastudent6390 Рік тому

    Backend code is not working. Any button not work.please help me sir....

  • @abdelmadjidbettache
    @abdelmadjidbettache Рік тому

    Hello, you didn't solve the dot button it concatenates more than one

  • @tennetialekhya7572
    @tennetialekhya7572 Рік тому

    It's showing "Err" Whenever I'm trying to use an operator... Plz help

  • @seann6494
    @seann6494 5 місяців тому

    how do you add that library bruh please for the love of God

  • @shyamjiverma5467
    @shyamjiverma5467 Рік тому

    bro. my C button is not working and showing as pressing it.

  • @mesopotamian97
    @mesopotamian97 2 роки тому +8

    For those who have a problem with backspace, try this code. It works for me.
    if(buttonText.equals("C")
    {
    if(dataToCalculate.length() > 0)
    {
    StringBuilder sb = new StringBuilder(solutionTv.getText());
    sb.deleteCharAt(solutionTv.getText().length()-1);
    dataToCalculate = sb.toString();
    solutionTv.setText(dataToCalculate);
    resultTv.setText(dataToCalculate);
    }
    return;
    }

  • @Vk__ff7483
    @Vk__ff7483 7 місяців тому

    Sir my last String operation is showing error please help

    • @EasyTuto1
      @EasyTuto1  7 місяців тому

      Check the new video in the channel of Simple Calculator.

  • @lenovopc4257
    @lenovopc4257 Рік тому

    My app didn't not give result what will I do

  • @priyas_lifestyle09
    @priyas_lifestyle09 6 місяців тому +1

    Nice
    But app download kese kre?

  • @tushajoshi5186
    @tushajoshi5186 Рік тому

    If the result actually has .0 in the value it will also be replaced by empty string ?

    • @navneetjasrotia
      @navneetjasrotia Рік тому

      no, not the whole result. Only .0 will get replace by the empty string