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.
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:
Timer component and number variables can be used to add a Stopwatch to your Android App created in Sketchware. To create a Stopwatch App in Sketchware follow the steps below. 1. Start a new project in Sketchware . Fill app name, package name and app icon. 2. In VIEW area, insert a Textview and a Button widget. In Textview properties set layout_gravity as center_horizontal, text as 00:00:00.00, and text_size as 40sp. In Button properties set layout_gravity as center_horizontal, text as Start/Stop/Reset and text_size as 20sp. 3. In LOGIC area add a new timer component t . 4. In onCreate event, add five number variables , one each for hour, minutes, seconds, and milliseconds, and an extra variable for managing Button Click. Set all these number variables to 0. 5. Suppose the five number variables are named as h , m ,...
How to enable download in an app created with Sketchware? Suppose you have created an app in Sketchware which uses webview to open a site. You can seamlessly explore the site in your app. But the download links in the webview field do not work. But it is possible to make it work by exporting the source code. You can edit the code in either Android studio or Eclipse to add your desired features and then recompile it. I tried to do that but soon realized that setting up environment for development of Android app is not easy for a naive like me. But it can be done by code injection or by using another mobile app called Anacode. Enabling download from webview in Sketchware using add source directly block. 1. In VIEW area of your app insert a WebView (webview1). 2. In LOGIC area, in onCreate event, a. Add write String... to file path ... Block. This will add WRITE_EXTERNAL_STORAGE permission. b. Then add an add source directly block. In this block pu...
To create an EditText with animation features, we can use the EditText in a TextInputLayout which is a Layout interface in android.support.design.widget library. In Sketchware we cannot add it in xml file but we can create it programmatically. Follow the instructions given below for a simple example. 1. In VIEW area of your project add two Linear horizontal linear2 and linear3 , and a Button button1 . 2. Switch On AppCompat and design. 3. Create a more block extra and define the block using an add source directly block. Put following code in it. } EditText edittext1, edittext2; { Here we declare two EditText fields, edittext1 and edittext2 . 4. In onCreate event, i. Use add source directly block and use codes to define edittext1, set it's LayoutParams, set it's hint, and set it's text color. edittext1 = new EditText(this); edittext1.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayou...
Timer component and number variables can be used to add a Stopwatch to your Android App created in Sketchware. To create a Stopwatch App in Sketchware follow the steps below. 1. Start a new project in Sketchware . Fill app name, package name and app icon. 2. In VIEW area, insert a Textview and a Button widget. In Textview properties set layout_gravity as center_horizontal, text as 00:00:00.00, and text_size as 40sp. In Button properties set layout_gravity as center_horizontal, text as Start/Stop/Reset and text_size as 20sp. 3. In LOGIC area add a new timer component t . 4. In onCreate event, add five number variables , one each for hour, minutes, seconds, and milliseconds, and an extra variable for managing Button Click. Set all these number variables to 0. 5. Suppose the five number variables are named as h , m ,...
AIDE can be used to integrate Admob Ads to a Sketchware project. First export the source code of your sketchware android project and then follow the steps below to learn how to integrate Admob banner ads in AIDE. Prerequisites A Sketchware project AIDE with pro account key purchased Account in Google developer console Account in Admob Before placing admob ads in an app, the app needs to be uploaded to google play store, however test ads can be tried in any app. Always place the test ad ID before placing your ad unit ID. App ID and ad unit ID can be obtained by registering the app on Admob. But for using test ads no registration is required. Do not click on your own Ads. This code works in apps which do not use AppCompat and Design. Export the Sketchware project In Sketchware, under MY PROJECTS, go to project settings of the app to be exported, and click on Export to PC (Android Studio) . The exported file is a zip file. Create a new folder...
We can highlight a particular searched character sequence in a TextView or EditText field or any other text field by using Spannable. To use Spannable class to highlight a searched text in Sketchware Android Project, follow the steps given below. 1. In VIEW area of your project, add an EditText field ( edittext1 ) which will act as input field for search term. Add a TextView ( textview1 ) which will display the number of results found. And add another TextView ( textview2 ) or EditText (edittext2) field which will contain the text in which the word is to be searched. 2. In LOGIC area, in onCreate event set the text to be searched in TextView field. 3. If you want the app to search from any text added by user, use EditText instead textview2 in step no.1 and do not set the text in onCreate. 4. Add a new String variable text . Add three number variables total, len and y . 4. Add a new event edittext1 onTextChanged . 5. In the event edittext1 onTextChange...
This tutorial shows a Sketchware android project example in which a Notification is displayed when a Button is clicked and when the Notification is clicked, it opens a new Activity. 1. Create a new project in Sketchware. In VIEW area add an EditText edittext1 , and a Button button1 . 2. Using Image Manager add an images mail_white . This will be used as the Notification icon. 3. In Library manager switch on AppCompat and Design . 4. Create a new VIEW two.xml / TwoActivity.java . 5. Add a More Block: createChannel . 6. In More Block createChannel , use add source directly block and put following code: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { CharSequence name = "Channel name 1"; String description = "Notification channel"; int importance = NotificationManager.IMPORTANCE_DEFAULT; NotificationChannel channel = new NotificationChannel("id 1", name, importance); channel.setDescription(description); NotificationManager n...
To create a Torch Flashlight application for Android with Sketchware follow the steps given below. 1. Create a new project in Sketchware. In VIEW area add an ImageView imageview1 . Set it's width and height to 100, and scale type to FIT_XY. 2. Using Image Manager add two images ic_flash_on_black and ic_flash_off_black . 3. Set ic_flash_off_black as the image of imageview1. 4. In Library manager switch on AppCompat and Design . 5. Add a Camera component . 6. Add two Boolean variables: flashLightStatus and hasCameraFlash . 7. Add two More Blocks: flashLightOn and flashLightOff . 8. In onCreate event, use add source directly block and put following code: hasCameraFlash = getPackageManager(). hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH); 9. In More Block flashLightOn , use add source directly block and put following code: android.hardware.camera2.CameraManager cameraManager = (andr...
To create a Stopwatch App in sketchware using Chronometer, follow the steps given below. 1. Create a new project in Sketchware. 2. In VIEW area add a LinearV with width and height as match_parent, and gravity as center_horizontal, center_vertical. • Inside this add a LinearH linear2 with width 240, height 240, padding 20, magin 8, and gravity center_horizontal, center_vertical. • Below linear2, add two Buttons start_button and pause_button . Set their margins as 8 and text as START and PAUSE respectively. 3. Create a more block extra . 4. In the more block extra , use an add source directly blocks and put codes to declare a long variable timeWhenStopped, and a Chronometer stopclock. } private long timeWhenStopped = 0; private Chronometer stopclock; { 5. Add 5 number variables mode , ZERO , RUNNING , STOPPED , PAUSED . 6. In onCreate event, set ZERO to 0, RUNNING to 1, STOPPED to 2, PAUSED to ...
1. Create a new app in Sketchware. 2. Apart from main.xml , add three new pages, list.xml , add.xml , password.xml . 3. In main.xml/MainActivity: i. add two TextViews: textview1 and textview2 . ii. Add following components: Intent i , SpeechToText spttxt , and SharedPreferences sp:sp . iii. In onCreate event, if some password is saved in SharedPreferences, make textview2 GONE, and set textview1 to empty. iv. In textview1 onClick event, if saved password is '-none' use Intent to move to ListActivity, else set SpeechToText start listening. v. In the event SpeechToText: onSpeechResponse , if result equals saved password, or if result equals 'ON' and no password is saved, use Intent to move to ListActivity, else FinishActivity. vi. In the event SpeechToText: onSpeechError , FinishActivity. 4. In Image Manager add images ic_add_white and ic_settings_white. 5. Create a...
Komentar