How to create calculator using Android Studio - Kotlin

Поделиться
HTML-код
  • Опубликовано: 10 ноя 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.

  • @alihaider-jw6eq
    @alihaider-jw6eq 5 лет назад +32

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

  • @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.

  • @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

  • @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

  • @sobhanbabudhanalakota3662
    @sobhanbabudhanalakota3662 6 месяцев назад

    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

  • @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.

  • @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.😍😍😍

  • @divilator5332
    @divilator5332 5 лет назад +13

    ctrl + d to duplicate.

  • @nischalshakya5428
    @nischalshakya5428 4 года назад

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

  • @felipefranco7444
    @felipefranco7444 3 года назад

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

  • @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.

  • @abuanas4430
    @abuanas4430 3 года назад

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

  • @laurencekimpeligro1735
    @laurencekimpeligro1735 3 года назад

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

  • @senthamizhselvan7536
    @senthamizhselvan7536 4 года назад

    could we make a sound while get for an correct answer

  • @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

  • @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".

  • @japogi3639
    @japogi3639 3 года назад

    how about for decimal?

  • @pratikpatil9577
    @pratikpatil9577 Год назад

    Not able to use this library getting error

  • @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

  • @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.

  • @nabilahsafrahasni6726
    @nabilahsafrahasni6726 6 лет назад +4

    Thank you! This tutorial really helps me. :)

  • @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

  • @ViralShortsOfDuniya
    @ViralShortsOfDuniya 5 лет назад

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

  • @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.

  • @monishkumararanganathan2000
    @monishkumararanganathan2000 5 лет назад

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

  • @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😇

  • @subhadeepmukherjee3527
    @subhadeepmukherjee3527 4 года назад

    my divide button is not working :(

  • @sainahsainah1694
    @sainahsainah1694 4 года назад

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

  • @selvasky5100
    @selvasky5100 4 года назад

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

  • @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 4 года назад +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!

  • @bahtiyor_halmetov
    @bahtiyor_halmetov 3 года назад

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

  • @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.

  • @momokarter7319
    @momokarter7319 5 лет назад

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

  • @Rvdy.mp3
    @Rvdy.mp3 5 лет назад +1

    That was very helpful. Thanks!

  • @taranjeethreddy6281
    @taranjeethreddy6281 5 лет назад

    How to use android jetpack in building a calculator app

  • @souradip007
    @souradip007 5 лет назад

    How to use gradle code that you have used?

    • @CodeAndroid
      @CodeAndroid  5 лет назад

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

  • @failbook8996
    @failbook8996 5 лет назад +1

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

  • @karthikgowd7689
    @karthikgowd7689 Год назад

    Gradle Is Not working Bro

  • @muhammadjavid2542
    @muhammadjavid2542 5 лет назад

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

  • @diaaahmedhassan1757
    @diaaahmedhassan1757 5 лет назад

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

  • @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

  • @flyer261
    @flyer261 3 года назад

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

    • @flyer261
      @flyer261 3 года назад

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

  • @avatarofworldsgameplay3562
    @avatarofworldsgameplay3562 4 года назад

    can you explain function of . ? dot, i mean

  • @eswarmvs9375
    @eswarmvs9375 5 лет назад

    want source code right now

  • @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

  • @rezafereydouni
    @rezafereydouni 3 года назад +1

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

  • @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

  • @yahianad
    @yahianad 4 года назад

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

  • @قناةالتوبة-و9ق
    @قناةالتوبة-و9ق 4 года назад

    Thank you this very useful

  • @alexandredalfabbro
    @alexandredalfabbro 5 лет назад

    Great tutorial! Thanks a lot!

  • @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 ?

  • @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.

  • @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.

  • @nologames8856
    @nologames8856 5 лет назад

    An excellent video

  • @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.

  • @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.

  • @durveshzope6873
    @durveshzope6873 5 лет назад

    can you give me calculator apk

  • @sagarghodake4623
    @sagarghodake4623 5 лет назад

    Hi sir i am getting error in .java class

    • @CodeAndroid
      @CodeAndroid  5 лет назад

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

  • @stylegaming9108
    @stylegaming9108 5 лет назад

    nicely explained

  • @locnguyeninh3554
    @locnguyeninh3554 4 года назад

    Thank you so much

  • @rodrickngonyoku5042
    @rodrickngonyoku5042 5 лет назад

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

  • @MrDe0
    @MrDe0 4 года назад

    Thank U

  • @MrNik-zv7dp
    @MrNik-zv7dp 4 года назад

    Good . enjoyed

  • @abdoar2749
    @abdoar2749 4 года назад +1

    I need this wallpaper in your PC 😍 please

  • @Nextechdynamics
    @Nextechdynamics 5 лет назад

    Great video 😀

  • @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.

  • @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.

  • @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

  • @noyr7613
    @noyr7613 4 года назад

    cool

  • @tajummalabbass2459
    @tajummalabbass2459 5 лет назад

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

  • @nishisingh8760
    @nishisingh8760 3 года назад

    Too fast not good

  • @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!

  • @karolalan9758
    @karolalan9758 4 года назад

    GRACIAS!!!

  • @karthikgowd7689
    @karthikgowd7689 Год назад

    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

  • @gomezmario.f
    @gomezmario.f 5 лет назад +1

    I Love you indians..🙌👌

  • @moazelsawaf2000
    @moazelsawaf2000 5 лет назад

    Thanks

  • @darkblack5236
    @darkblack5236 5 лет назад

    Explain everything and make a video

  • @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