How to create calculator using Android Studio - Kotlin

  Рет қаралды 89,556

CodeAndroid

CodeAndroid

6 жыл бұрын

Source Code : bit.ly/android_calculator
Amazon India Affiliated Link:
Please use below link to support my channel
bit.ly/amazon_sale_code_android
Also you can support via Paypal using
bit.ly/paypal_codeandroid
Thank you
#CodeAndroid #Flutter

Пікірлер: 133
@nabilahsafrahasni6726
@nabilahsafrahasni6726 5 жыл бұрын
Thank you! This tutorial really helps me. :)
@Rvdy.mp3
@Rvdy.mp3 4 жыл бұрын
That was very helpful. Thanks!
@sainahsainah1694
@sainahsainah1694 4 жыл бұрын
How to add history of calculation look like on windows 10 / samsung style calculator?
@alexandredalfabbro
@alexandredalfabbro 4 жыл бұрын
Great tutorial! Thanks a lot!
@abuanas4430
@abuanas4430 3 жыл бұрын
Thanks, could you please explain the expressionbuilder. I didn't get it
@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.
@kkrshn
@kkrshn 4 жыл бұрын
Hi, Operation are not happening. Please help It seems operators r not registered but only numbers. On pressing equal button only numbers r returned
@divilator5332
@divilator5332 5 жыл бұрын
ctrl + d to duplicate.
@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 жыл бұрын
Instead, compile you need to use "implementation".
@mukilan2815
@mukilan2815 3 жыл бұрын
bro i got this error --> Expected org.gradle.api.artifacts.result.ResolvedDependencyResult but found org.gradle.api.internal.artifacts.result.DefaultUnresolvedDependencyResult
@vafahummatli1021
@vafahummatli1021 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
@dhruvalyarr
@dhruvalyarr 4 жыл бұрын
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!
@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.
@alihaider-jw6eq
@alihaider-jw6eq 5 жыл бұрын
why you do so fast wr are beginer not a n expert
@user-in8yg7rz2c
@user-in8yg7rz2c 4 жыл бұрын
Thank you this very useful
@Anas-pr7le
@Anas-pr7le 4 жыл бұрын
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
@diaaahmedhassan1757
@diaaahmedhassan1757 4 жыл бұрын
The clear button just clear tvExpress without tvResult what can I do
@nischalshakya5428
@nischalshakya5428 4 жыл бұрын
Brother, the give library is not found and how to add on android studio????plz reply
@senthamizhselvan7536
@senthamizhselvan7536 4 жыл бұрын
could we make a sound while get for an correct answer
@laurencekimpeligro1735
@laurencekimpeligro1735 3 жыл бұрын
Newbie here my Android Studio doesn't have ExpressionBuilder how to add?
@MarketingGuru2024
@MarketingGuru2024 4 жыл бұрын
Great video 😀
@danieladisa9404
@danieladisa9404 5 жыл бұрын
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 5 жыл бұрын
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.
@locnguyeninh3554
@locnguyeninh3554 4 жыл бұрын
Thank you so much
@failbook8996
@failbook8996 5 жыл бұрын
Make tutorial on scientific calculator too using kotlin, anyways your tutorial is awesome thanks
@mdmahbuburrahman9247
@mdmahbuburrahman9247 5 жыл бұрын
Sir?? My android studio can't find ExpressionBuilder and also build() method what can i do????
@CodeAndroid
@CodeAndroid 5 жыл бұрын
you need to include a library which is given in description. "implementation 'net.objecthunter:exp4j:0.4.8'"
@mdmahbuburrahman9247
@mdmahbuburrahman9247 5 жыл бұрын
@@CodeAndroid thanks u sir😇
@japogi3639
@japogi3639 3 жыл бұрын
how about for decimal?
@monishkumararanganathan2000
@monishkumararanganathan2000 5 жыл бұрын
Hi bro how to make a coding for developing the app. How to learn that coding please help me
@michaelc.umunna1633
@michaelc.umunna1633 5 жыл бұрын
ExpressionBuilder is not working in my calculator project, what can I do???
@CodeAndroid
@CodeAndroid 5 жыл бұрын
You have to implement the library which is given in description. They only you will get ExpressionBuilder.
@ElyesBoudhina
@ElyesBoudhina 4 жыл бұрын
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
@taranjeethreddy6281
@taranjeethreddy6281 5 жыл бұрын
How to use android jetpack in building a calculator app
@nologames8856
@nologames8856 4 жыл бұрын
An excellent video
@stylegaming9108
@stylegaming9108 5 жыл бұрын
nicely explained
@sobhanbabudhanalakota3662
@sobhanbabudhanalakota3662 3 ай бұрын
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
@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.
@selvasky5100
@selvasky5100 4 жыл бұрын
Sir I am installing Android studio But the design Editor unavailable Problem sir
@ahmedsheikh4360
@ahmedsheikh4360 5 жыл бұрын
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.
@ViralShortsOfDuniya
@ViralShortsOfDuniya 4 жыл бұрын
If i am using this library. Do i have to give credits/or mention the license of the owner?
@CodeAndroid
@CodeAndroid 4 жыл бұрын
No. Not required.
@ViralShortsOfDuniya
@ViralShortsOfDuniya 4 жыл бұрын
@@CodeAndroid thnx dude
@woaki3665
@woaki3665 4 жыл бұрын
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.
@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.
@himanisrivastava7213
@himanisrivastava7213 4 жыл бұрын
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
@muhammadjavid2542
@muhammadjavid2542 4 жыл бұрын
20(3)=60 in code what method is used to do this?
@SemenNaduiev
@SemenNaduiev 4 жыл бұрын
this code is in libray
@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.
@felipefranco7444
@felipefranco7444 3 жыл бұрын
what is this tutorial did you check what this code does?
@aabida_amiri
@aabida_amiri 3 жыл бұрын
Hi sir , i have an error in ExpressionBuilder method in main activity , the ExpressionBuilder color is red Can you help me
@CodeAndroid
@CodeAndroid 3 жыл бұрын
Check whether you compiled or implementation 'net.objecthunter:exp4j:0.4.8' dependency in your app level gradle file.
@moazelsawaf2000
@moazelsawaf2000 4 жыл бұрын
Thanks
@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 жыл бұрын
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
@momokarter7319
@momokarter7319 5 жыл бұрын
i please how i learn kotlin on web i don't see a website for learn kotlin to create app
@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 жыл бұрын
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.
@MrNik-zv7dp
@MrNik-zv7dp 4 жыл бұрын
Good . enjoyed
@avatarofworldsgameplay3562
@avatarofworldsgameplay3562 3 жыл бұрын
can you explain function of . ? dot, i mean
@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.😍😍😍
@eswarmvs9375
@eswarmvs9375 5 жыл бұрын
want source code right now
@pratikpatil9577
@pratikpatil9577 Жыл бұрын
Not able to use this library getting error
@bahtiyor_halmetov
@bahtiyor_halmetov 3 жыл бұрын
Thank you bro, I HAVE Question how can i get installer of my Application
@yahianad
@yahianad 4 жыл бұрын
Thank you Sir. I made otherwise the kt part and works perfectly !
@MrDe0
@MrDe0 4 жыл бұрын
Thank U
@karolalan9758
@karolalan9758 4 жыл бұрын
GRACIAS!!!
@durveshzope6873
@durveshzope6873 5 жыл бұрын
can you give me calculator apk
@subhadeepmukherjee3527
@subhadeepmukherjee3527 3 жыл бұрын
my divide button is not working :(
@noyfariha7613
@noyfariha7613 4 жыл бұрын
cool
@imsol-info
@imsol-info 4 жыл бұрын
Fun appenonExpression(string : String , canClear : Boolean). This is not workings in my project
@CodeAndroid
@CodeAndroid 4 жыл бұрын
Did you import the library.
@imsol-info
@imsol-info 4 жыл бұрын
Yes i did
@imsol-info
@imsol-info 4 жыл бұрын
SetOnClickListener(android.view.View.OnClickListener) in View cannot be applied to (void). Sir how can i solve this error. Please reply me
@HassanMoujahed
@HassanMoujahed 5 жыл бұрын
Good job ,i have followed what you do step by step but i have only black backround
@HassanMoujahed
@HassanMoujahed 5 жыл бұрын
I found the error in name of style items
@rezafereydouni
@rezafereydouni 3 жыл бұрын
Github please , i use this video for univercity project for android unit :)
@sagarghodake4623
@sagarghodake4623 5 жыл бұрын
Hi sir i am getting error in .java class
@CodeAndroid
@CodeAndroid 5 жыл бұрын
you need to use ::class.java not .java class
@karthikgowd7689
@karthikgowd7689 Жыл бұрын
Gradle Is Not working Bro
@ritvikverma5969
@ritvikverma5969 3 жыл бұрын
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!
@egonreinhardt
@egonreinhardt 2 жыл бұрын
same problem here
@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 жыл бұрын
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 жыл бұрын
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.
@flyer261
@flyer261 3 жыл бұрын
у кого вылетает приложение, при написании кода на вычисление чисел?
@flyer261
@flyer261 3 жыл бұрын
вылетает, но компилятор не ругается, ошибок не видит
@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.
@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.
@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
@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.
@hackerboysomali4136
@hackerboysomali4136 4 жыл бұрын
Your good but not to good tell me something why are you faster when your writing the code?
@CodeAndroid
@CodeAndroid 4 жыл бұрын
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 4 жыл бұрын
@@CodeAndroid okay copy that and thanks 😊 but if you wanna explain some tutorial like this don't so faster all right.
@rodrickngonyoku5042
@rodrickngonyoku5042 5 жыл бұрын
Great Tutorial but you are Too fast!!!...Nice work though
@pagevpetty
@pagevpetty 5 жыл бұрын
you can always play at a slower speed or press pause ;)
@rodrickngonyoku5042
@rodrickngonyoku5042 5 жыл бұрын
@@pagevpetty gues so
@darkblack5236
@darkblack5236 4 жыл бұрын
Explain everything and make a video
@gomezmario.f
@gomezmario.f 5 жыл бұрын
I Love you indians..🙌👌
@tajummalabbass2459
@tajummalabbass2459 5 жыл бұрын
very bad ......very fast stream unable to understand
@ugurserhattoy
@ugurserhattoy 5 жыл бұрын
you can slow it down
@abdoar2749
@abdoar2749 4 жыл бұрын
I need this wallpaper in your PC 😍 please
@nishisingh8760
@nishisingh8760 3 жыл бұрын
Too fast not good
@darkblack5236
@darkblack5236 4 жыл бұрын
Ur too fast
@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
@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
How to create login screen using Android Studio - Kotlin
11:39
CodeAndroid
Рет қаралды 73 М.
Can A Seed Grow In Your Nose? 🤔
00:33
Zack D. Films
Рет қаралды 29 МЛН
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 25 МЛН
Fragment in Android Studio using Kotlin | Android Knowledge
15:36
Android Knowledge
Рет қаралды 9 М.
Calculator App Example Android Studio Tutorial
12:33
Code With Cal
Рет қаралды 87 М.
How to make a calculator in Android Studio 2020 | Part 1
15:38
Practical Coding
Рет қаралды 158 М.
Calculator App Android Studio Kotlin Tutorial
12:22
Code With Cal
Рет қаралды 73 М.
No Code App Development is a Trap
9:31
Coding with Dee
Рет қаралды 188 М.
Navigation Drawer and Bottom Navigation View in Android Studio | Kotlin
27:36
RECYCLERVIEW - Android Fundamentals
24:58
Philipp Lackner
Рет қаралды 102 М.
When RESTful architecture isn't enough...
21:02
Dreams of Code
Рет қаралды 265 М.
Can A Seed Grow In Your Nose? 🤔
00:33
Zack D. Films
Рет қаралды 29 МЛН