Skip to main content

Useful tips for new Sketchware users

Today, I will be sharing some useful tips that I wish I knew when I started using Sketchware. These tips will help you work faster and simplify the way you do tasks.

COPYING A LAYOUT

You've built a beautiful layout or someone shared a project with you and you want to replicate the layout on another activity. Instead of having to recreate it, you can highlight the layout that you want to copy and then click the save button.

Save layout

After you save a layout it will appear in your views just under the shared views icon

Shared view

You can then drag it from the list and use it again on another activity.

SAVE BLOCKS TO COLLECTIONS

After creating a complex or long sequence of blocks, instead of having to recreate them, you can copy them to your collections. These will be available in your collections and you can easily access and reuse them from there.

Save blocks to collections

NB- You still have to recreate variables and other components that you want to reuse on the new activity. These will not be imported unless they already exist. For example if I have a list string "countries" that I want to reuse on another page. I simply have to create a new list string countries then I can import my blocks.

USE MOREBLOCKS

Sketchware moreblocks

Moreblocks are meant to make it easier to do tasks and to keep your logic neat. As you add more features to your app, its logic will also become more complex. So instead of placing all your blocks in onCreate, you can use moreblocks. Say I want to check time, show welcome message, set text data and so on... I will only have the moreblocks in onCreate and then I know exactly where to go if I want to adjust the logic for checking time.

SAVE MOREBLOCKS TO COLLECTIONS

Save moreblock to collection


Say you have a moreblock that changes the font of all widgets in your app, instead of having to recreate it on each activity, you can save it to your collections and then import it from collections whenever you need it. In the screen above, the arrows sho how to add to collections. At the top of the screen, just under events, we have "Import from Collections" this is where your Moreblock will be saved.

USE WEIGHT PROPERTY FOR FLEXIBLE LAYOUTS

weight property


Phones come in various models and device sizes. This means that your app will not look the same on all screens. An easy way to avoid any problems that this might solve is to use the weight property instead of a fixed width and height. A weight of 1 takes up the available space on the screen. Think of it as a ratio... if weight is 1, then it takes up 1 or the entire space in that layout or screen. If the weight is 2, it means that our ratio is 2:1 meaning 2 items can fit on one screen. Weight sum is the total weight that a layout can accommodate. So a weight of 3 means it will take up 3 items with a weight of 1 each.

NAME YOUR LAYOUTS AND WIDGETS

Widget id


This might not be necessary when using a small number of widgets on an activity but as you build more complex logic, it is easier to identify widgets by their names in your logic. For example if I have edittext1, edittext2, edittext3 and edittext4, it's wise to rename them "username", "email", "password" and "confirm_password". This let's you know which item you are using. It also saves you from mismatches and it simplifies troubleshooting. Click on any item that you want to rename... once the properties menu appears, click "id" and give it a new name.

NB- Unless its convenient, avoid giving your widgets names like "value1", "value2." This might cause challenges when you now have to compile your data on one activity and you now have 6 items from different activity with the name "value1". Rather use names like "purchases", "weekly_purchases" and "sales"

CHOOSE A STYLE AND BE CONSISTENT

When naming your widgets and setting up your keys, you should come up with a style that works for you and be consistent. The listview keys and other items are case sensitive... so a minor difference such as capitalization of one key and not the other could cause you unnecessary headaches. So if you're going to use small letters, be consistent with it. If you're going to use underscore to separate characters, be consistent with it. You might remember what you're doing now, but after some months you probably won't.

BE WARY OF AUTOFILL

The autofill feature is very helpful in filling in information but I've noticed that at times it adds a space after the character sequence. The system views this blank space as an additional character. The challenge is that it's hard to identify the additional blank space especially if it's at the end of the character sequence. So you might get users saying I'm trying to login but I can't. In some instances it's because they used autofill and the blank space makes the sytem recognize that email is badly formatted.

I hope you found these tips very helpful. Here's to wishing you all the best as you continue to build that amazing app of yours.

Comments

Popular posts from this blog

Hip hop and RnB songs to apologize to your partner

Love is a beautiful thing, but it often goes wrong. This often leads to pain, suffering and sorrow.  Being imperfect beings, hearts tend to get broken all the time regardless how hard we may try to avoid it.  The heartbreak is often inadvertent but at times we find ourselves in the wrong. An oversight, a word unsaid or even a lapse in our judgement can cause our loved ones harm. This doesn't always have to be the end though. Oftentimes, relationships can be mended by simply uttering three simple words: "I AM SORRY". This article is a collection of some of my favourite 'I'm sorry' songs. I hope you'll enjoy these apology songs, but more importantly, I hope you will get a few quotables and some wisdom nuggets from them.  The best apology however, is to change behaviour (got that from a Jay Z interview) so as you apologize, please remember that it was your actions that hurt them. The best apology is one which involves you not repeating those same mistakes aga...

How to easily create background notifications in Sketchware(original)

How to easily create background notifications in Sketchware(original) One of the keys to building a successful app is to find mechanisms that will keep your users engaged. You can do this by using background notifications. This tutorial will show you how to do that in Sketchware. We will cover: 1. How to create notifications in Sketchware 2. How to show these notifications even when the app is closed.

Happy Birthday Memes: Laugh Your Way to Someone's Heart

Happy Birthday Memes: Laugh Your Way to Someone's Heart Introduction Birthdays are a special occasion to celebrate another year of life, and what better way to do it than with a good laugh? That's where happy birthday memes come in! These hilarious images are the perfect way to put a smile on someone's face and let them know you're thinking of them on their special day. Why Memes Are the Best Birthday Greetings * Relatable:  Memes often tap into universal experiences and emotions, making them instantly relatable to a wide audience. * Quick and Easy:  Sharing a meme is a hassle-free way to send birthday wishes, perfect for those last-minute greetings. * Memorable:  A funny meme is more likely to stick in someone's mind, making your birthday wishes unforgettable. * Versatile:  There's a meme for every type of person and occasion, from silly and goofy to heartfelt and sentimental. How to Use Happy Birthday Memes * Share on Social Media:  Spread ...