In Sketchware: How to create a calculator for any simple formula?
Create a simple formula calculator Android app in Sketchware
Here is a tutorial to calculate using any simple formula, for users of Sketchware Android app.
I'll take the example of calculating volume of a cone.Formula is: Vcone = 1/3 × pi × r2 × h
Step 1
Download Sketchware
Step 2
Go to my projects and start a new project.
Fill details in Project Settings:-
Package name: com.cone
Project name: conevolume
App name: Cone Volume
App icon:
App version: 1.0
Step 2
Go to my projects and start a new project.
Fill details in Project Settings:-
Package name: com.cone
Project name: conevolume
App name: Cone Volume
App icon:
App version: 1.0
Step 3
Create View of your app. It is saved as main.xml. The process is simple. In the view field drag and drop 'linear', 'textview', 'button' and 'edittext' to places where you want them to appear.
In my project I have inserted 5 'linear', 4 'textview', 3 'edittext' and 2 'button'.
Edit the 'textview' fields to write details. Modify text of 'button' to write calculate, Reset, etc. Change background color of 'linear'. Modify Edittext to remove 'hint', and change 'input type' to 'number decimal'. I have modified Edittext1 and Edittext2 to take input of radius and height of cone, and Edittext3 is for volume output.
Step 4
After your view is set, click on 'Logic'.
You will find a screen as in picture below.
Click on onCreate and drag and drop 'set Enable' view into the field. Now choose 'Edittext3' and make setEnable 'false'
Step 5
Now go to 'Button 1 onClick'. Add three new 'variables'. I have added 'r', 'h' and 'vol'. Drag if - else control into field. Now add: if not length of Edittext1 and Edittext2 is > 0, show message ..., else... The picture below shows how to do it.
Now within 'else' field, set Variable 'r' to, toNumber Edittext1, and so on for all input fields. Set output variable 'vol' to your formula pi * r^2 * h / 3. Then set Edittext3 to your output variable 'vol'. It is shown in the picture below.
For any queries please write below.
In my project I have inserted 5 'linear', 4 'textview', 3 'edittext' and 2 'button'.
Edit the 'textview' fields to write details. Modify text of 'button' to write calculate, Reset, etc. Change background color of 'linear'. Modify Edittext to remove 'hint', and change 'input type' to 'number decimal'. I have modified Edittext1 and Edittext2 to take input of radius and height of cone, and Edittext3 is for volume output.
Step 4
After your view is set, click on 'Logic'.
You will find a screen as in picture below.
Click on onCreate and drag and drop 'set Enable' view into the field. Now choose 'Edittext3' and make setEnable 'false'
Step 5
Now go to 'Button 1 onClick'. Add three new 'variables'. I have added 'r', 'h' and 'vol'. Drag if - else control into field. Now add: if not length of Edittext1 and Edittext2 is > 0, show message ..., else... The picture below shows how to do it.
Now within 'else' field, set Variable 'r' to, toNumber Edittext1, and so on for all input fields. Set output variable 'vol' to your formula pi * r^2 * h / 3. Then set Edittext3 to your output variable 'vol'. It is shown in the picture below.
Step 6
Go to 'Button2 onClick', which is reset button and use 'settext' view for all three 'Edittext' to set them to empty.
Step 7
Now Compile and run the App. Your app is ready.
You can send the apk to your Email account to get the apk file. Or you can save it to your mobile directly using 'ES File explorer' app.
This video below is a tutorial on how to make an app for simple calculations:
Here is a video of a temperature converter created in Sketchware:
For any queries please write below.
Hi can you help me pls? Trying to make a app where you get user input, multiply by a number then devide by 2 and display the answer?
ReplyDeleteWatch this: https://youtu.be/AoxJdu33Org
DeleteTHANK YOU !!!!!!!!!
DeleteI am developing own native language Dictionary app..with help of your video youtube..
ReplyDeleteI want a picture for every word different pictures ..eg apple image of apple.
Mango img of mango...can you help me.?
I'll make a tutorial for it. And then I will send you link
DeleteHallo i need some help l want to make my calculor app with one Textviwe lika a real phone
Deletehow can make app disable button befor user input number
ReplyDeleteor i have 5 input (edittext) if user fill 2 input app fill other 0 auto
@ahmed Darwesh
DeleteTo disable Button, Use set enable false Block in onCreate. And on Edittext on text changed event (for all Edittext), if length of edittext1.getText is more than 0 and Edittext2.getText is more than 0, use set enable true for button.
جيد جدا انا ممتن لك واتابعك كثير شكرا لك
ReplyDeleteThank you.
DeleteI want to make a financial calculator for making check stubs. How can I make one for Texas taxes
ReplyDeleteAny will be appreciated
DeleteAny help will be appreciated!
DeleteDear sir
ReplyDeleteWhen I input number in mainActivity
then how can i show input equally to anotherActivity
You have to create file shared preferences component with same name in both activities. Then you can save the input in file Shared preferences using a key, and retrieve it on another Activity.
DeleteIs very gooooooood i like the sketchware and you sanjeev
ReplyDeleteThis was a really great contest and hopefully I can attend the next one. It was alot of fun and I really enjoyed myself..
ReplyDeleteHow to make an app
Hello,
ReplyDeleteI have a weird problem that I come across when subtracting certain numbers for my calculator app. When I try to subtract .10 from .01, the results are -.0900002. It doesnt do this with all number numbers accept when I'm adding numbers certain together. Can you please tell me how to fix it.
hi ... i need a help in calculation method.
ReplyDelete137 / 20 = 6.85
i need to split the result value 6.85 in two textboxs i.e. 6 in textview4 and 85 in textview5. (split the value after decimal)
is it possible in sketchware ?
Thanks in advance.
Suppose n is your result in decimal format.
ReplyDeleteYou can get the integer value by using:
floor (n).
Floor is a math block.
You can get the remaining decimal value by subtracting floor(n) from n.
Thanks for your reply.
DeleteI followed the floor in match block, but could not found how to substract floor... please guide further.
Thanks :)
Floor math Block in Sketchware
ReplyDeleteFloor Block
how can i set brackets? I.e. (d*i)/10000
ReplyDeleteNo need of brackets in sketchware, it automatically adds brackets in code.
Deletecluld help me on an app im trying to make for my work. im calculating boardfoot.the formula we use at work is
ReplyDeleteW*L÷12+15% =bdft
i need W and L as an input sa result is the bdft
i cant seem to get the 15% not 0.15.coz its the 15% of the total of W*L÷12
Small code . I can't see. You can explain me?
ReplyDeleteHello i want do 100:250 but it result was 0. what is the problem
ReplyDeleteSince the result is less than 1, use the block toString with decimal.
DeleteHello, I wanna make an app to manage my coaching class in which the name of sudent, I batch, and fees history exist
ReplyDeleteJust help me please
ReplyDeleteAmigo...tipo..estou tentando faser um app com a seguinte logica : na primeira tela coloco um numero em um edit text, esse numero tem que ser multiplcado pelo resultado de outra multiplicação de duas edit text que esta na segunda tela, e o resultado final deve aparecer em uma textview na terceira tela.. pode me ajudar?
ReplyDeleteqweweweqwe
ReplyDeleteSanjeev, Hi I need help in creating my app how can i contact you.
ReplyDeleteSanjeev, Hi I need help in creating my app how can i contact you.
ReplyDeleteHow to solve this error:
ReplyDeleteWhen the user don't write any number ( or text ) and try to calculate something. The Sketchware show the menssage : Invalid To number block operation : Empty string.
Hello, I would like to appreciate your work. It’s a great platform got to learn a lot. Your data is really worthy. Thank you so much. Keep it up!
ReplyDeletePlaybox App For Android
Playbox Download Android
Sir I want to change data in a list when a user click different images how can i do this??
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteBro I need a shooting game please help me🙏🙏🙏🙏🙏
ReplyDeleteالشرح بالكتابه يساعدني أكثر من الفيديوهات شكراً لك ونرجو المزيد من الشروحات
ReplyDeleteكنت أبحث عن شروحات سكيتشوير بهذه الطريقة السهله أتمنى لك التوفيق والنجاح
ReplyDeleteIn mobile app development there are some factors which effects cost to develop an app, which you must need to pay attention.
ReplyDeletePls how can I create an app to find the area of shapes
ReplyDeleteHi can you please make an tutorial for a app that can convert currency of many countries
ReplyDeletesir can you help me to fine a way to change the font of timer in bengali font... i am creating an app which contain all bangla font. but i cant change the number font from english to bengali. please guide me
ReplyDelete