Posts

How to create a dictionary app in Sketchware?

Image
An android app for a dictionary can be created in sketchware using File:shared preferences component. Follow the steps below to create a dictionary app. 1. Start a new project in Sketchware. 2. In VIEW area of project, insert a Linear (H) with Edittext , and a Linear (V) with a ListView and two Textviews . 3. In LOGIC area add a new File (shared preference) component. 4. Go to onCreate event and more blocks named Awords , Bwords , Cwords, etc. 5. Also add a string list and a number variable . 6. In Awords, sequentially add words starting with letter A to file with an integer as key; then add meaning of each word to file with the word itself as key. Similarly add words and meanings to file for defining Bwords, Cwords, etc. 7. In onCreate event, add all words to file by using more blocks.  Also add all words to the list and ListView . Use blocks as shown in the image below. Important update : It is recommended not to use the if...else...

How to integrate Admob interstitial ads using​ AIDE?

Image
AIDE can be used to integrate Admob Ads to a Sketchware project. Follow the steps below to integrate Admob interstitial ads to a sketchware project using AIDE. Prerequisites An Android project (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. 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 and decompress the contents of the zip file in it. Check whether the  res  folder at location...

How to integrate Admob Ads in Sketchware project using AIDE?

Image
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 and de...

Use of List String blocks in Sketchware android projects

Image
A  string list  is an ordered collection of strings, where user has precise control over where in list each string is added. Use of list blocks in Sketchware projects is described below. Adding elements to list Elements can be add to a list one by one, and they take the position as per the sequence in which they are added. For example, if we add Google, Yahoo, Amazon, YouTube, and Android to a list, they will take positions 0, 1, 2, 3, and 4 respectively. If a very large number of elements are to be added to the list, as in some kind of word game, then multiple more blocks can be used to add elements to the list, and the more blocks can be used in a sequence in the event where list is to be created. The images below show an example. An important aspect of lists is that they allow duplicate elements and they allow multiple null elements. Using List elements in Spinner or ListView Elements added to a list can be shown in Spinner or ListView by settin...

How to open any other App or website from your app?

Image
Intent can be used to open urls or other apps from android app. To open URLs from app 1. In order to link to a url from your app, which means on clicking a button or on any other event the url opens in default browser in mobile, first add an  intent  component in LOGIC area of Sketchware project. 2. Next, on button click event, add following blocks: Intent setAction ACTION_VIEW, Intent setData URL of website to be opened StartActivity Intent To open other apps in mobile from app 1. Other apps in mobile can be opened using the package name of those apps. If the app is not installed on mobile, then it will not open. Below is an example to open Snapseed photo editor app from a Sketchware app. 2. In order to open other apps directly on button click, add an intent component as shown above. 3. Next, on button click event, add following blocks: Intent setAction ACTION_VIEW, Intent setData  android-app://com.niksoftware.snapseed(package name of the app) S...

How to add a common share button in Sketchware?

Image
Sharing text contents or URLs from a Sketchware App is possible using intent, but the data can only be shared using individual urls to emails, facebook, twitter, and other sites which provide a sharing option, individually. But in order to implement a common share button for sharing content, some code is to be added in the project using add source directly block. Follow the steps below to add a share button in Sketchware App. 1. Suppose you want to share the contents of field Edittext1 as title and of field  Edittext2 ​ as main content. For sharing the contents, first insert a button or an  imageview with share icon. 2. In LOGIC area, in the onClick event for button, which is to be used as share button, add two string variables a and b. 3. Set string variable a  to contents of Edittext1 field, and variable b to contents of Edittext2 field. 4. Add the following code in add source directly block: Intent i = new Intent(android.content.Intent.ACTION...