Skip to main content

Posts

Understanding the Sketchware blocks- Variables

We had covered some ground and some are still unsure about what the blocks do and mean. So in the next few days we will be looking at some of these and what they do. We will start with the Orange blocks at the top. These are variable blocks. TYPES OF VARIABLES Think of variables as place holders and these variables can be used to temporarily hold numerous values. There are four types of variables: 1. Boolean 2. Number Variable 3. String variable 4. Map variable We'll cover Boolean Variables later. Today we'll cover Number, string and map variables. BOOLEAN VARIABLES A boolean is a data type that has only two possible values. For example a user's  can be logged in or logged out. So the value of that boolean can only either be true or false. In the image above I have created a boolean variable called isRunning. I can use this  to determine when the app is running by setting the value to true when the app starts(onStart). then I can also specify what happens when the app is ru

How to use the Whatsapp API to send messages with Sketchware

As an app developer you also want to provide a seamless user experience for your users. This means simplifying tasks and finding easier ways to do things. This can be achieved using APIs. This tutorial will cover how to use the WhatsApp API to: 1. Open a chat 2. Open a chat with a predefined message. Please note that the decision to send the message lies ultimately with the user.  The logic is placed onButtonClick... so I can send a message when a the button is clicked. In the first example we use an intent and then we setdata to the contents of edittext1. Just in case the image isn't clear enough, the text is: whatsapp://send?text=   In the second example we specify a phone number. When clicked, a chat to that number will be opened. This is particularly useful on a contact page... whereby users can simply click a button to chat. The code used below is: https://api.whatsapp.com/send?phone= All the best as you build that amazing app

Adding your own fonts in Sketchware

Sketchware allows you to add your own custom fonts. You can get these from sites like 1001freefonts and others. These usually come in .ttf and are fairly small. When you've downloaded your font click here 👇 Click and open the menu on the top right corner of your project screen.  Navigate to where the downloaded font is stored on your device. Now that the font is in Sketchware, I want to choose which text appears in that font. If I want it to appear in the specified font when the app starts and that is achieved using the setTypeface block. I will  put my logic in *onCreate* or *onStart*. If, however, I want that font to appear when a specific condition is met, I can place it on that specific event. For example, *onButtonClick*, *onTextChanged* or in an *IF-ELSE* block. For this tutorial i will place the block *onCreate* This will display my text in the specified format.

How to create a QR code reader in Sketchware

A QR Code is a two dimensional optical bar code which is used for carrying data. QR stands for "Quick Response". Each QR Code normally contains an identifier, a locator and a url. These codes were initially used for tracking of auto parts but have become more popular in recent years. Nowadays they are used for providing easy access to website as well as for tracking purposes. That has made them a key marketing tool. Instead of typing a url, a user can simply scan a code and be redirected to a specific page on a website. You can however adapt the QR Code and use it as you wish. Some time back I mentioned a tracking app for employees or students... using a QRCODE and your listviews, you can create a powerful tracking app. So let's create a simple app which generates a QR Code using the data that we will provide.  How it will work A user can type something in an edittext field and when they click a button, we will call the QR code using an API to generate a code. We will the

How to search a firebase list in Sketchware

If your app deals with a lot of data then you might want to include a search feature in your app, so that they can easily find whatever they are looking for. This article will cover how to implement the search feature in your Sketchware app. Please note that this logic is only for searching for data that is stored in your firebase database. Let's get into it. First create your layout.  In the example above, I have added a linear Horizontal. In my linear Horizontal I have added 2 imageviews and an edittext. I have set my edittext hint to "Search..." This is how it will work. When the app starts, the 'cancel search' button and the edittext for searching will be hidden. Then when a user clicks the search button the edittext and Cancel search button becomes visible. When I click the cancel search button, it clears the edittext and then hides the edittext and the cancel search button. I have given my edittext a weight value of 1. This makes it take up all the extra spa

How to create a spinner list in Sketchware

As you create your app, you might want to present specific data in a spinner. This could be something like a choice of countries or currency options. This tutorial will show you how to: 1. Create a String list 2. Display data in a spinner Step 1. Create a new project and add a spinner widget. Simply drag it onto your project screen. If you have nothing on your screen it will look like it does in the picture below Once you have added the Spinner widget navigate to the onCreate event to set your spinner data. In your onCreate event create a String list. Simply follow the arrows. Some new blocks will appear. Place your blocks like I have done in the image below. You can replace the text with your own custom text. Simply click that white space and type your own list characters. Remember: If you're having trouble finding your blocks, simply use the colours to guide you. Place a setSpinnerData below your add blocks. Choose your spinner... in this case its spinner1 and our list string is

How to move from one screen to another in Sketchware

One of the first tasks you will probably want to perform is to move from one activity to another or even to open other apps. This can be easily achieved by using an INTENT COMPONENT. This tutorial will cover  1. how to create a new activity(page) in Sketchware 2. how to use the intent component to navigate between activities(pages) Whenever you want to move, you will need to create an Intent component. Components can be found or created in the components section of your project. The above picture shows where components can be found. Click the circled red button(it's called a floating action button) to create a component. It is the first component on your left. You can give your component any name... for example "intent" or "i" or "homepage." Once you have created and named your component... you can then navigate back to your view or activity section so that you can find the right event to place the logic. Before doing anything we will also need to crea