Calculator App Example Android Studio Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024

ความคิดเห็น • 93

  • @CodeWithCal
    @CodeWithCal  3 ปีที่แล้ว +7

    iOS Calculator App Tutorial
    th-cam.com/video/A2gGNTKo_q8/w-d-xo.html

  • @woojuspace7281
    @woojuspace7281 3 ปีที่แล้ว +7

    This is an amazing tutorial with a simple-looking good layout! Thank you so much!

  • @ericlareza4905
    @ericlareza4905 3 ปีที่แล้ว +1

    Bro, amazing tutorial. Thank you, am your new subscriber!
    Kudos!

  • @emmanuelpedroza2421
    @emmanuelpedroza2421 3 ปีที่แล้ว +1

    dude! cal! i love your video! i like the way you speed/fast forward on things! this helps me! thanks!!!

  • @x55554
    @x55554 3 ปีที่แล้ว +1

    Great tutorial! Cheers for the rhino engine I had no idea there was such thing

  • @cassiomendes5123
    @cassiomendes5123 2 ปีที่แล้ว +1

    I tried to add a backspace button there but isn´t working correctly. When I delete something and I put a new number, the number that I´d deleted is showing up again. What can i do?

  • @charleslandercanillas1213
    @charleslandercanillas1213 3 ปีที่แล้ว +4

    Bro. Can I ask? Why is ScriptEngine and ScriptEngineManager not working on me? It says that it cannot resolve symbole 'ScriptEngine' and 'ScriptEngineManager'. Thanks bro

  • @shubhankaringale278
    @shubhankaringale278 3 ปีที่แล้ว +1

    Great help thanks... needed more videos like that.

  • @legend.Is.a.qt.WasTaken
    @legend.Is.a.qt.WasTaken 3 ปีที่แล้ว +1

    bless up am in class doing a quiz then this saved me bless up bless up

  • @charleslandercanillas1213
    @charleslandercanillas1213 3 ปีที่แล้ว +2

    I just realize this program doesn't have a delete button, where you can delete one character at a time.

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว

      Take a look at this kotlin calculator app tutorial, we implement a backspace button in this calculator :)
      th-cam.com/video/2hSHgungOKI/w-d-xo.html

  • @asadbekaminboyev3311
    @asadbekaminboyev3311 2 ปีที่แล้ว

    Your video lesson was very helpful to me

  • @AsadKhan-rl5mc
    @AsadKhan-rl5mc 2 ปีที่แล้ว

    Oh Man, You made my work easy..😍

  • @sebastianbermudezvasquez2848
    @sebastianbermudezvasquez2848 3 ปีที่แล้ว

    Grande hermano, eres el mejor se te quiere

  • @subhajeetchakraborty1791
    @subhajeetchakraborty1791 2 ปีที่แล้ว

    Best tutorial to be honest

  • @frankappiah2090
    @frankappiah2090 ปีที่แล้ว

    my texts are automatically left aligned, how can that be fixed?

  • @sathwikasreeravipati1416
    @sathwikasreeravipati1416 2 ปีที่แล้ว

    Thank u so much amazing tutorial

  • @mrmaroko193
    @mrmaroko193 2 ปีที่แล้ว

    After click on equal button when both TextViews are empty app crashing, i dont know where is the problem pls help

    • @mrmaroko193
      @mrmaroko193 2 ปีที่แล้ว

      I solved it, just added
      if (workings.equals("") || resultsTV.equals("")) {
      Toast.makeText(this, "Empty Fields", Toast.LENGTH_SHORT).show();
      return;

  • @amiel6057
    @amiel6057 3 ปีที่แล้ว

    Thank you so much!! You saved me!

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว +2

      Glad I could help :)

  • @tafman
    @tafman 2 ปีที่แล้ว +2

    This is an amazing tutorial....
    I was following the tutorial smoothly until you reached the ScriptEngine coding...
    My problem is 'ScriptEngine', 'shortName 'and 'eval'... They are all showing red lines....
    When i checked the hint it shows the following:
    import class
    Create class
    Create enum... etc
    Please what am i doing wrong...
    I'll have to pause the calculator for now... Will be waiting for your reply.... Thanks in advance...

    • @CodeWithCal
      @CodeWithCal  2 ปีที่แล้ว +1

      06:25 make sure you have correctly added the dependency in the Build Gradle. :)

    • @tafman
      @tafman 2 ปีที่แล้ว +2

      @@CodeWithCal Thanks for your time, i really appreciate....
      Those your dependencies are quite different from mine... Maybe it's because i installed Android Studio recently....
      Should i delete my dependencies and input that of yours or i should just add your dependencies to my existing ones?

    • @CodeWithCal
      @CodeWithCal  2 ปีที่แล้ว +2

      Just the one 3rd party line I add is all you should change :)

    • @luismiguelmanato966
      @luismiguelmanato966 2 ปีที่แล้ว +3

      Go to File then click "Sync Project with Gradle Files"

    • @ocemakca
      @ocemakca ปีที่แล้ว

      @@luismiguelmanato966 thanx!

  • @saifullahrahman
    @saifullahrahman 4 ปีที่แล้ว +1

    why do you not use the constraint layout method?

    • @CodeWithCal
      @CodeWithCal  4 ปีที่แล้ว

      I think it depends what your building. I have nothing against constraint layouts.
      But i feel like for this application it was easier to use Linear Layout.

  • @chichigorgor3184
    @chichigorgor3184 4 ปีที่แล้ว +1

    lovely video. thank you

    • @CodeWithCal
      @CodeWithCal  4 ปีที่แล้ว

      Your welcome, thanks for the support.

  • @krishnagawali1955
    @krishnagawali1955 2 ปีที่แล้ว

    Problem in initTextviews method plz help

  • @benabdallahanwer1045
    @benabdallahanwer1045 3 ปีที่แล้ว +1

    the message of toast doesn't show up ? any solution

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว

      Design is to show toast message if the input is invalid. could your input simply be valid?
      Failing that. does your toast message show if you move the Toast line outside of the try catch statement?
      Toast.makeText(this, "TestToast", Toast.LENGTH_SHORT).show();
      try {
      result = (double)engine.eval(formula);
      } catch (ScriptException e)
      {
      Toast.makeText(this, "Invalid Input", Toast.LENGTH_SHORT).show();
      }

  • @kartikhegadi7574
    @kartikhegadi7574 ปีที่แล้ว

    After pressing' =' the answer displays. The press something without clearing old answer . It will continue in same place.

  • @abdallahomar5205
    @abdallahomar5205 4 ปีที่แล้ว +7

    Very good tutorial thank you a lot ❤️
    But i have a little comment , you have an error in ^ it is not working well if you get a power of a number which has more than a digit like 10^2 because when you get the left number in changeFormula() the number will be 01 instead of 10 so it will get the power of 01^2 instead of 10^2

    • @CodeWithCal
      @CodeWithCal  4 ปีที่แล้ว +4

      Good eye, Thanks for sharing.
      For a quick fix, underneath our loop which we create our number left we could use a string builder reverse our numberLeft String.
      StringBuilder leftNumberBuilder = new StringBuilder(numberLeft);
      numberLeft = leftNumberBuilder.reverse().toString();
      stackoverflow.com/questions/7569335/reverse-a-string-in-java

  • @nicx.nvrlnd
    @nicx.nvrlnd 3 ปีที่แล้ว +1

    hey sir, you're quite good, pls create a tutorial for publishing an android app, connecting android app to database(sqlite) etc. thanks! ♡

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว +1

      Publishing app tutorial is a good idea.
      Sqlite database tutorial:
      th-cam.com/video/4k1ZMpO9Zn0/w-d-xo.html

    • @nicx.nvrlnd
      @nicx.nvrlnd 3 ปีที่แล้ว

      @@CodeWithCal thank you idol ♡

  • @kaviyaakavi5969
    @kaviyaakavi5969 3 ปีที่แล้ว +1

    I want code for equal without using ScriptEngine.

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว

      th-cam.com/video/2hSHgungOKI/w-d-xo.html
      This kotlin calculator tutorial uses no external code.

  • @zongsian5268
    @zongsian5268 3 ปีที่แล้ว +1

    thank you!

  • @asadbekaminboyev3311
    @asadbekaminboyev3311 2 ปีที่แล้ว

    good job bro

  • @kaiden7866
    @kaiden7866 2 ปีที่แล้ว

    how can i make calculator but the result will display in other activities

    • @CodeWithCal
      @CodeWithCal  2 ปีที่แล้ว

      One way is to pass the result via an intent

  • @guruprasad.r766
    @guruprasad.r766 3 ปีที่แล้ว +1

    I have a doubt, (3:08) for me when I copy n paste, then the buttons are inserting in the same column

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว +1

      Check the parent linear layout is correct and it's orientation is set to vertical

  • @iamsyndrome5429
    @iamsyndrome5429 4 ปีที่แล้ว

    Hey I have a problem with Android studio ver4.1 it is not updating the preview .pls help

    • @CodeWithCal
      @CodeWithCal  4 ปีที่แล้ว

      Happy to help how I can. Can you provide any more detail?

    • @gilbertnicholas1062
      @gilbertnicholas1062 4 ปีที่แล้ว

      @@CodeWithCal I'm having the same problem, the preview in main.xml doesn't update after changed the code in code section of main.xml

    • @CodeWithCal
      @CodeWithCal  4 ปีที่แล้ว

      @@gilbertnicholas1062 Hmm 🤔 do you think it is related to using Android studio v4.1?
      Or could it be a mistake in your Layout XML file?

  • @markjohnpaulmonton5318
    @markjohnpaulmonton5318 2 ปีที่แล้ว

    Thank you

  • @harshitsolanki1754
    @harshitsolanki1754 3 ปีที่แล้ว

    Giving Error while I'm using ScriptEngine ? What should I do ..??

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว

      Hi, happy to help. What error are you getting?

    • @RinitaJ
      @RinitaJ 3 ปีที่แล้ว

      I got the same error too

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว

      @joshua kregg I think you are spot on here. Thanks for clarifying for all :)

  • @shiamahamedluvon117
    @shiamahamedluvon117 3 ปีที่แล้ว

    Go a head bro.. Best of luck.

  • @audday6
    @audday6 3 ปีที่แล้ว

    i cant enable script engine why? theres no class for it

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว

      06:25 make sure you have correctly added the dependency in the Build Gradle. :)

    • @ArianKapllanaj
      @ArianKapllanaj 3 ปีที่แล้ว

      @@CodeWithCal I add everything exactly like you and still, I have a red underline

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว

      And the build Gradle managed to sync with the added dependancy no errors?

    • @ArianKapllanaj
      @ArianKapllanaj 3 ปีที่แล้ว

      @@CodeWithCal I do not have any error in build.gradle, I have red text in actibity_main.xml in the words: ScriptEngine, ScriptEngineManager, shortName, and eval.

    • @ArianKapllanaj
      @ArianKapllanaj 3 ปีที่แล้ว

      @@CodeWithCal Now I did sync and it works. But shortName was red again and I change the code as it is in GitHub ScriptEngine engine = new ScriptEngineManager().getEngineByName("rhino");

  • @asadbekaminboyev3311
    @asadbekaminboyev3311 2 ปีที่แล้ว

    lets go

  • @vipulsingh4893
    @vipulsingh4893 ปีที่แล้ว

    Bro please give the code that u have written in this video

    • @CodeWithCal
      @CodeWithCal  ปีที่แล้ว

      Link in the description 👆

  • @kalelda3295
    @kalelda3295 2 ปีที่แล้ว

    How to download the javascript

    • @CodeWithCal
      @CodeWithCal  2 ปีที่แล้ว

      I think its available on the web just search the package name

  • @candrasniper3404
    @candrasniper3404 2 ปีที่แล้ว

    The implementation... is the key to make it easy. I had built the calc with my own code, but it was getting frustating sometimes with the math result, related to double floating point in accuracy. Sometimes, it should be 1.1, but it was showed 1.09999999998. 😅

    • @CodeWithCal
      @CodeWithCal  2 ปีที่แล้ว

      th-cam.com/video/PZRI1IfStY0/w-d-xo.html
      Tom Scott did a great video on this very topic

  • @neferiusnexus2607
    @neferiusnexus2607 3 ปีที่แล้ว

    your voice sounds fine in the beginning but it's painfully sibilant when you go into coding

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว

      Thanks for the feedback, yes I didn't quite have my mic 🎤 situation sorted at this point.

    • @pritidwivedi5021
      @pritidwivedi5021 2 ปีที่แล้ว

      @@CodeWithCal you are writing like a express train plss

  • @coderdemo9169
    @coderdemo9169 3 ปีที่แล้ว

    Can I use c language in the place of java hete

    • @CodeWithCal
      @CodeWithCal  3 ปีที่แล้ว

      developer.android.com/studio/projects/add-native-code
      Maybe, I haven't had any experience doing so.

    • @RaiMuhammadArslan786
      @RaiMuhammadArslan786 3 ปีที่แล้ว

      you can make android apps on visual studio with c++

  • @burakozcan1001
    @burakozcan1001 3 ปีที่แล้ว

    teşekkür ederijm

  • @javatmz
    @javatmz 4 ปีที่แล้ว

    hello can we make a video in partnership?

    • @CodeWithCal
      @CodeWithCal  4 ปีที่แล้ว +1

      Hi, what do you have in mind?

    • @javatmz
      @javatmz 4 ปีที่แล้ว

      @@CodeWithCal we can make tutorial in twice or other things as you want

  • @merajhotak7330
    @merajhotak7330 3 ปีที่แล้ว

    thanks for project but you maked too faster and cant make sense very well

  • @KTones
    @KTones 3 ปีที่แล้ว

    Leyyaok

  • @shamsnadeem3308
    @shamsnadeem3308 3 ปีที่แล้ว

    very fast