How to create calculator using Android Studio - Kotlin

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

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

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

    not gonna lie, the tutorial was a bit hard to follow but it was worth it. A video that goes to the point and delivers a nice looking calculator.

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

    It was extremely useful, the only problem was being so fast while talking and writing pieces of code. Overall, thanks so much!

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

      Set replay speed to 0.75x

  • @ahmedsheikh4360
    @ahmedsheikh4360 6 ปีที่แล้ว +17

    I don't know why some developers skip a lot of things when they build app or like that or copy paste. it doesn't help and your channel will not grow upp and you will lose many subscribers.

  • @michaelc.umunna1633
    @michaelc.umunna1633 6 ปีที่แล้ว +2

    ExpressionBuilder is not working in my calculator project, what can I do???

    • @CodeAndroid
      @CodeAndroid  6 ปีที่แล้ว +1

      You have to implement the library which is given in description. They only you will get ExpressionBuilder.

    • @ElyesBoudhina
      @ElyesBoudhina 5 ปีที่แล้ว

      The most important thing in the entire video is implementing the library and using Expression builder , hey keep in mind in new versions of Android the word ===> compile

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

    bro i got this error --> Expected org.gradle.api.artifacts.result.ResolvedDependencyResult but found org.gradle.api.internal.artifacts.result.DefaultUnresolvedDependencyResult

  • @alihaider-jw6eq
    @alihaider-jw6eq 5 ปีที่แล้ว +32

    why you do so fast wr are beginer not a n expert

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

    Sir??
    My android studio can't find ExpressionBuilder and also build() method what can i do????

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

      you need to include a library which is given in description. "implementation 'net.objecthunter:exp4j:0.4.8'"

    • @mdmahbuburrahman9247
      @mdmahbuburrahman9247 6 ปีที่แล้ว

      @@CodeAndroid thanks u sir😇

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

    Why are you using TextView as buttons again? I couldn't understand what was said in the video.

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

      I don't want the look of button. So I used TextView.

  • @aqeebhj5467
    @aqeebhj5467 6 ปีที่แล้ว

    hey sir instead of using linear layout over their for button u can use the grid view

    • @CodeAndroid
      @CodeAndroid  6 ปีที่แล้ว

      Of course, you can use it. The only problem, inside the button click we need to use a switch condition(it gets confusing). To avoid that I am using linearlayout.
      Thank you for supporting CodeAndroid !!!
      Follow me on twitter: @theCodeAndroid.

    • @aqeebhj5467
      @aqeebhj5467 6 ปีที่แล้ว

      thanks for your replay sir and wish you will 100k subscriber soon :)

    • @CodeAndroid
      @CodeAndroid  6 ปีที่แล้ว

      thank you.

  • @imsol-info
    @imsol-info 5 ปีที่แล้ว

    Fun appenonExpression(string : String , canClear : Boolean).
    This is not workings in my project

    • @CodeAndroid
      @CodeAndroid  5 ปีที่แล้ว

      Did you import the library.

    • @imsol-info
      @imsol-info 5 ปีที่แล้ว

      Yes i did

    • @imsol-info
      @imsol-info 5 ปีที่แล้ว

      SetOnClickListener(android.view.View.OnClickListener) in View cannot be applied to (void).
      Sir how can i solve this error. Please reply me

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

    Hey, When I am Trying To add This (1
    @color/actionButton
    21sp
    @android:color/white
    center) in Style section Then Showing one error Like [':' is not a valid resource name character] How can I solve this Error. and To buttons, grey colour is also not showing.

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

    Hi sir , i have an error in ExpressionBuilder method in main activity , the ExpressionBuilder color is red
    Can you help me

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

      Check whether you compiled or implementation 'net.objecthunter:exp4j:0.4.8' dependency in your app level gradle file.

  • @dhruvalgandhi
    @dhruvalgandhi 5 ปีที่แล้ว +1

    I've only black in background, through I've included all things which you have mentioned,but it doesn't show the button's color orange..
    Pls give me solution

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

      In styles.xml file, under ActionButtonStyle and NumberButtonStyle, background should be android:background and you won't have only black background. I just had the same problem and hope it helps someone searching for the fix in the comments, also unlucky I didn't come up to this earlier so you didn't have to wait for a response for 8 months.
      Hope you didn't give up tho! Cheers!

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

    Thanks, could you please explain the expressionbuilder. I didn't get it

  • @divilator5332
    @divilator5332 5 ปีที่แล้ว +13

    ctrl + d to duplicate.

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

    Newbie here my Android Studio doesn't have ExpressionBuilder how to add?

  • @Anas-pr7le
    @Anas-pr7le 4 ปีที่แล้ว +1

    I am getting Unresolved reference: ExpressionBuilder error, can you help me out pls?

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

      yeah me too..i think problem in library...but i dont know how to add library

  • @yugabro
    @yugabro 5 ปีที่แล้ว

    in your line 55
    why did u interconvert long and Double idont understand why u couldnt just use result.toString()
    why did u use an if and else
    if(result==longResult.toDouble())
    tvresult.text=longResult.toString()
    else
    tvresult.text= resultValue.toString()
    Please clear my doubt

    • @CodeAndroid
      @CodeAndroid  5 ปีที่แล้ว +1

      ExpressionBuilder evaluated result will have return type as Double. To check that result is having decimal value or not, I am comparing it with long value. Otherwise i need to convert both double and long to string and compare it. For numbers it is better to use the type int,float,long or double. So i converted both to double and compared it.

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

    Brother, the give library is not found and how to add on android studio????plz reply

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

    How to add history of calculation look like on windows 10 / samsung style calculator?

  • @senthamizhselvan7536
    @senthamizhselvan7536 5 ปีที่แล้ว

    could we make a sound while get for an correct answer

  • @sobhanbabudhanalakota3662
    @sobhanbabudhanalakota3662 7 หลายเดือนก่อน

    Sir the same code i have entered but at the beginning in main activity im getting error at tvResult and tvExpression as it is not suggesting from activity main
    Can you help me

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

    Not able to use this library getting error

  • @kkrshn
    @kkrshn 5 ปีที่แล้ว

    Hi,
    Operation are not happening. Please help
    It seems operators r not registered but only numbers. On pressing equal button only numbers r returned

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

    how about for decimal?

  • @techmariah2648
    @techmariah2648 5 ปีที่แล้ว

    The only issue I have is the "expression builder" and "log" in mainactivity. what could be wrong? Also this Library: "compile 'net.objecthunter:exp4j:0.4.8'" is obsolete....could this be the cause?

    • @CodeAndroid
      @CodeAndroid  5 ปีที่แล้ว +1

      Instead, compile you need to use "implementation".

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

    what is this tutorial did you check what this code does?

  • @muhammadjavid2542
    @muhammadjavid2542 5 ปีที่แล้ว

    20(3)=60
    in code what method is used to do this?

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

      this code is in libray

  • @monishkumararanganathan2000
    @monishkumararanganathan2000 5 ปีที่แล้ว

    Hi bro how to make a coding for developing the app. How to learn that coding please help me

  • @momokarter7319
    @momokarter7319 5 ปีที่แล้ว

    i please how i learn kotlin on web i don't see a website for learn kotlin to create app

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

    Thanks brother it's great...
    Who are just copy paste the program, will face some problems like me😂😂😂.
    Here i will share while compiling what problems I faced & how it solved.
    1. In main activity appcompact v7 problems .
    Solution (don't change your actual import program data, it will automatically decide for me it was (androidx.appcompat.app)
    2. Don't forget to copy the gradle library file in "build.gradle" (it's available in this video description i.e compile.net.obeject.... (in video 11.16)
    If you copy the code also some time error will occur for latest version Android studio. For that instead of compile we can put implementation... It will say to put you ...
    If anyone face any issues share with me. I did it.😍😍😍

  • @ras9579
    @ras9579 6 ปีที่แล้ว

    i want "Dot" just one time after an integer. like this "2 ." , but 2...... is possible... how can i do this?

    • @CodeAndroid
      @CodeAndroid  6 ปีที่แล้ว +1

      Use a flag to control it. Reset this flag every time when we do any action. So that the flag can be ready for next number. One problem here is on press of back(erase), we need to read entire string to find dot is there in last number or not.

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

      @@CodeAndroid can you please share the flag code

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

    Sir I am installing Android studio
    But the design Editor unavailable
    Problem sir

  • @souradip007
    @souradip007 6 ปีที่แล้ว

    How to use gradle code that you have used?

    • @CodeAndroid
      @CodeAndroid  6 ปีที่แล้ว

      In the application-level gradle file, you need to place that code inside dependencies.

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

    my divide button is not working :(

  • @ViralShortsOfDuniya
    @ViralShortsOfDuniya 5 ปีที่แล้ว

    If i am using this library.
    Do i have to give credits/or mention the license of the owner?

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

    don't speed up your videos, they are way too fast and we can't understand what you are doing.
    Also sir how do you create a only for styles and color without making a new activity

  • @HarshPatel-ky5vk
    @HarshPatel-ky5vk 5 ปีที่แล้ว

    Brother it has one problem of multiple operator at time

    • @CodeAndroid
      @CodeAndroid  5 ปีที่แล้ว

      Yes. You can block/replace the operator by checking last character.

    • @HarshPatel-ky5vk
      @HarshPatel-ky5vk 5 ปีที่แล้ว

      @@CodeAndroid can you do it for us in your video ?

  • @rahuldon4309
    @rahuldon4309 5 ปีที่แล้ว

    Bro in my case 🔙 BACK bottom is not working 😥😥😥

    • @CodeAndroid
      @CodeAndroid  5 ปีที่แล้ว

      Check the onclick for that button. Also check weather you are updating the textview.

  • @ras9579
    @ras9579 6 ปีที่แล้ว

    hello sir , what is the use of "compile 'net.objecthunter:exp4j:0.4.8'" or why we should use this in this project?

    • @CodeAndroid
      @CodeAndroid  6 ปีที่แล้ว

      We are using an object called "ExpressionBuilder". Which is described in that library. Using this library we can avoid doing calculation and handling crashes and other stuff.

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

    can you explain function of . ? dot, i mean

  • @danieladisa9404
    @danieladisa9404 6 ปีที่แล้ว

    Sir I would like a situation where my on click listener for equals sets the expression to the result at once sir. Thank you.

    • @CodeAndroid
      @CodeAndroid  6 ปีที่แล้ว

      If we set the expression on the result on click of the equal button, then when we can show the expression result?.
      If you want full expression, then add another TextView in between question and result. Then append the character in question as well as the new TextView. when the user clicks "CE" or after equal they press any number clear this TextView.

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

    у кого вылетает приложение, при написании кода на вычисление чисел?

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

      вылетает, но компилятор не ругается, ошибок не видит

  • @diaaahmedhassan1757
    @diaaahmedhassan1757 5 ปีที่แล้ว

    The clear button
    just clear tvExpress without
    tvResult what can I do

  • @HassanMoujahed
    @HassanMoujahed 6 ปีที่แล้ว +5

    Good job ,i have followed what you do step by step but i have only black backround

    • @HassanMoujahed
      @HassanMoujahed 6 ปีที่แล้ว

      I found the error in name of style items

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

    Upload the video in min resolution 1080p

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

      Latest video I am uploading on 2K resolution. My old laptop has HD ready display. So I couldn't record more than that.

  • @taranjeethreddy6281
    @taranjeethreddy6281 5 ปีที่แล้ว

    How to use android jetpack in building a calculator app

  • @eswarmvs9375
    @eswarmvs9375 5 ปีที่แล้ว

    want source code right now

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

    Thank you! This tutorial really helps me. :)

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

    Gradle Is Not working Bro

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

    Thank you bro, I HAVE Question how can i get installer of my Application

  • @sagarghodake4623
    @sagarghodake4623 5 ปีที่แล้ว

    Hi sir i am getting error in .java class

    • @CodeAndroid
      @CodeAndroid  5 ปีที่แล้ว

      you need to use ::class.java not .java class

  • @failbook8996
    @failbook8996 5 ปีที่แล้ว +1

    Make tutorial on scientific calculator too using kotlin, anyways your tutorial is awesome thanks

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

    Github please , i use this video for univercity project for android unit :)

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

    Hey please can anybody help me????
    I made the .xml file as explained and then copied the library and also the code and pasted it.
    But my app is not working at all, the only error i'm getting is " UNRESOLVED REFERENCE " for all my Textviews id (tvOne,tvTwo,etc. etc.) ; all of them.
    I dont know how to resolve this issue , i literally tried everything, please help sir!

  • @durveshzope6873
    @durveshzope6873 5 ปีที่แล้ว

    can you give me calculator apk

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

    compile 'net.objecthunter:exp4j:0.4.8' This one not working Bro
    api 'net.objecthunter:exp4j:0.4.8' i tryid this one all same but app properly not working

  • @hackerboysomali4136
    @hackerboysomali4136 5 ปีที่แล้ว

    Your good but not to good tell me something why are you faster when your writing the code?

    • @CodeAndroid
      @CodeAndroid  5 ปีที่แล้ว

      Just to save time I make the typing faster. Beginners can pause the video once the typing is done, and intermediate people can see it on the go. in future video will try to fix this.

    • @hackerboysomali4136
      @hackerboysomali4136 5 ปีที่แล้ว

      @@CodeAndroid okay copy that and thanks 😊 but if you wanna explain some tutorial like this don't so faster all right.

  • @jaimealbertovalenciabasto2774
    @jaimealbertovalenciabasto2774 5 ปีที่แล้ว

    Hello, Thanks for this tutorial. I have a question: How can I add library "compile 'net.objecthunter:exp4j:0.4.8" on my project ?. I appreciate if someone can explain me xD

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

      Well, I have the same issue, but I read the problem!
      Look, on the video it appears to use the library on the Gradle Build (Module App)
      Well... here;s the thing. If you just put compile 'net.objecthunter:exp4j:0.4.8' it will start to synchronize!
      "If you don't know how to start the Gradle Sync, there is a message right on top that says Gradle Sync - Start, click on it and then let the Gradle Begins!"
      Keep in mind something... if you start to sync the compile "net.objecthunter:exp4j:0.4.8" it can happen 2 things:
      Depending on the version of your Android Studio 1. it may start the sync, but it may not complete it, or 2. it will complete it.
      In my case was the first one, my Android Studio start the synchronization and after a few minutes (2mins), it stopped. But the sync chart says that the syntaxis "COMPILE" is obsolete for the current version of Android Studio 3.3, instead replace COMPILE with IMPLEMENTATION.
      So instead on typing "compile 'net.objecthunter:exp4j:0.4.8' " replace compile with "implementation 'net.objecthunter:exp4j:0.4.8' "

    • @jhaneman1231
      @jhaneman1231 5 ปีที่แล้ว +1

      I hope that might resolve the problem you have! I am a beginner, and this calculator on Kotlin is my College Class Project and a new dare programming language from my teacher on College!
      I hope I was of service for you.

    • @jaimealbertovalenciabasto2774
      @jaimealbertovalenciabasto2774 5 ปีที่แล้ว

      Thanks a lot!!!!! XD

    •  5 ปีที่แล้ว

      @@jhaneman1231 heyy !! bro thanks so much bro

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

      @@jhaneman1231 Million thanks.

  • @Rvdy.mp3
    @Rvdy.mp3 5 ปีที่แล้ว +1

    That was very helpful. Thanks!

  • @alexandredalfabbro
    @alexandredalfabbro 5 ปีที่แล้ว

    Great tutorial! Thanks a lot!

  • @Nextechdynamics
    @Nextechdynamics 5 ปีที่แล้ว

    Great video 😀

  • @tajummalabbass2459
    @tajummalabbass2459 5 ปีที่แล้ว

    very bad ......very fast stream unable to understand

  • @nologames8856
    @nologames8856 5 ปีที่แล้ว

    An excellent video

  • @androidgame5815
    @androidgame5815 6 ปีที่แล้ว

    hi, I like your job you help me a lot thank you.
    please can you make a scientific calculator with (sin.tang.cos .....)
    I looking forward to seeing more videos of you. thanks :).
    PS.pleas in future can you give more details and explanation
    keep going

    • @CodeAndroid
      @CodeAndroid  6 ปีที่แล้ว

      Hi, In that app itself you can add one more row with sin, cos, and tan. That library can handle that.

    • @androidgame5815
      @androidgame5815 6 ปีที่แล้ว

      yes, I try it but the problem the, win I using (sin.tang or cos ) the result given with radians unite .i try to convert it to the degree but I failed (example sin30=0.5degree me sin30=-0988... radian).
      tvsin.setOnClickListener { appendOnExpression("sin(",false) }
      i try to put in the and of it but it not work

    • @androidgame5815
      @androidgame5815 6 ปีที่แล้ว

      I am thankful if you give me the solution thanks

  • @rodrickngonyoku5042
    @rodrickngonyoku5042 5 ปีที่แล้ว

    Great Tutorial but you are Too fast!!!...Nice work though

    • @pagevpetty
      @pagevpetty 5 ปีที่แล้ว +1

      you can always play at a slower speed or press pause ;)

    • @rodrickngonyoku5042
      @rodrickngonyoku5042 5 ปีที่แล้ว

      @@pagevpetty gues so

  • @yahianad
    @yahianad 5 ปีที่แล้ว

    Thank you Sir. I made otherwise the kt part and works perfectly !

  • @nooraldinjalab5978
    @nooraldinjalab5978 6 ปีที่แล้ว

    hi, I like your job thank you for it
    i have tow quastion:1- can i make calculator app and put it in google play with out copyright for library
    2- can you added √ and % in library
    thank you very much

    • @CodeAndroid
      @CodeAndroid  6 ปีที่แล้ว

      I am not the developer of that library. to check the license: www.objecthunter.net/exp4j/license.html. The library already contains √ and % functionalities.

  • @قناةالتوبة-و9ق
    @قناةالتوبة-و9ق 5 ปีที่แล้ว

    Thank you this very useful

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

    Thank you so much

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

    GRACIAS!!!

  • @stylegaming9108
    @stylegaming9108 5 ปีที่แล้ว

    nicely explained

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

    I need this wallpaper in your PC 😍 please

  • @MrNik-zv7dp
    @MrNik-zv7dp 4 ปีที่แล้ว

    Good . enjoyed

  • @gomezmario.f
    @gomezmario.f 5 ปีที่แล้ว +1

    I Love you indians..🙌👌

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

    Too fast not good

  • @moazelsawaf2000
    @moazelsawaf2000 5 ปีที่แล้ว

    Thanks

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

    cool

  • @darkblack5236
    @darkblack5236 5 ปีที่แล้ว

    Explain everything and make a video

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

    Thank U

  • @darkblack5236
    @darkblack5236 5 ปีที่แล้ว

    Ur too fast

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

    my is showing error on tvResult.text

  • @monishkumararanganathan2000
    @monishkumararanganathan2000 5 ปีที่แล้ว

    Hi bro how to make a coding for developing the app. How to learn that coding please help me