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?
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
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 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?
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.
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(); }
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
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
@@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.
@@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");
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. 😅
iOS Calculator App Tutorial
th-cam.com/video/A2gGNTKo_q8/w-d-xo.html
This is an amazing tutorial with a simple-looking good layout! Thank you so much!
Bro, amazing tutorial. Thank you, am your new subscriber!
Kudos!
dude! cal! i love your video! i like the way you speed/fast forward on things! this helps me! thanks!!!
Great tutorial! Cheers for the rhino engine I had no idea there was such thing
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?
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
Anyway I found it. I just needed to Sync project with gradle files.
Great help thanks... needed more videos like that.
bless up am in class doing a quiz then this saved me bless up bless up
say bless up again
@@sheriffcrandy bless up
I just realize this program doesn't have a delete button, where you can delete one character at a time.
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
Your video lesson was very helpful to me
Oh Man, You made my work easy..😍
Grande hermano, eres el mejor se te quiere
Best tutorial to be honest
my texts are automatically left aligned, how can that be fixed?
Thank u so much amazing tutorial
After click on equal button when both TextViews are empty app crashing, i dont know where is the problem pls help
I solved it, just added
if (workings.equals("") || resultsTV.equals("")) {
Toast.makeText(this, "Empty Fields", Toast.LENGTH_SHORT).show();
return;
Thank you so much!! You saved me!
Glad I could help :)
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...
06:25 make sure you have correctly added the dependency in the Build Gradle. :)
@@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?
Just the one 3rd party line I add is all you should change :)
Go to File then click "Sync Project with Gradle Files"
@@luismiguelmanato966 thanx!
why do you not use the constraint layout method?
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.
lovely video. thank you
Your welcome, thanks for the support.
Problem in initTextviews method plz help
the message of toast doesn't show up ? any solution
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();
}
After pressing' =' the answer displays. The press something without clearing old answer . It will continue in same place.
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
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
hey sir, you're quite good, pls create a tutorial for publishing an android app, connecting android app to database(sqlite) etc. thanks! ♡
Publishing app tutorial is a good idea.
Sqlite database tutorial:
th-cam.com/video/4k1ZMpO9Zn0/w-d-xo.html
@@CodeWithCal thank you idol ♡
I want code for equal without using ScriptEngine.
th-cam.com/video/2hSHgungOKI/w-d-xo.html
This kotlin calculator tutorial uses no external code.
thank you!
good job bro
how can i make calculator but the result will display in other activities
One way is to pass the result via an intent
I have a doubt, (3:08) for me when I copy n paste, then the buttons are inserting in the same column
Check the parent linear layout is correct and it's orientation is set to vertical
Hey I have a problem with Android studio ver4.1 it is not updating the preview .pls help
Happy to help how I can. Can you provide any more detail?
@@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
@@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?
Thank you
Giving Error while I'm using ScriptEngine ? What should I do ..??
Hi, happy to help. What error are you getting?
I got the same error too
@joshua kregg I think you are spot on here. Thanks for clarifying for all :)
Go a head bro.. Best of luck.
i cant enable script engine why? theres no class for it
06:25 make sure you have correctly added the dependency in the Build Gradle. :)
@@CodeWithCal I add everything exactly like you and still, I have a red underline
And the build Gradle managed to sync with the added dependancy no errors?
@@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.
@@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");
lets go
Bro please give the code that u have written in this video
Link in the description 👆
How to download the javascript
I think its available on the web just search the package name
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. 😅
th-cam.com/video/PZRI1IfStY0/w-d-xo.html
Tom Scott did a great video on this very topic
your voice sounds fine in the beginning but it's painfully sibilant when you go into coding
Thanks for the feedback, yes I didn't quite have my mic 🎤 situation sorted at this point.
@@CodeWithCal you are writing like a express train plss
Can I use c language in the place of java hete
developer.android.com/studio/projects/add-native-code
Maybe, I haven't had any experience doing so.
you can make android apps on visual studio with c++
teşekkür ederijm
hello can we make a video in partnership?
Hi, what do you have in mind?
@@CodeWithCal we can make tutorial in twice or other things as you want
thanks for project but you maked too faster and cant make sense very well
Leyyaok
very fast
💨
@@CodeWithCal hahaa