Sketchware: How to create a digital clock?

It is very easy to include a real time digital clock in your Android App created with Sketchware.

Firstly, drag and drop a textview widget in a linear layout. Edit it's text size to 25 or more.

Now in the Logic of your app, add a Calendar component and a Timer component.


Then go to onCreate event and add a new block. I added a block named rep in my project.


After that define the new block function. Use TimerTask after ..1.. ms block and inside that use Calendar getNow block and textview setText block. Set text of textview to Calendar...Format.... block, and then repeat the block. The image below shows the blocks.


Lastly, in onCreate activity drag and drop the new block as shown below.
Now save and run your app. It will show current date and time updating every millisecond.

You can change the calendar Format to show the clock in your way. The format 'yyyy-MM-dd hh:mm:ss a' will show the time in AM/PM format.

Here is a video tutorial for creating a digital clock in Sketchware App:


Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

How to enable download in webview in Sketchware apps?

TextInputLayout in Sketchware

Create Stopwatch App in Android using Sketchware

How to integrate Admob Ads in Sketchware project using AIDE?

How to find and​ highlight a word in a text field in Sketchware?

Code for implementing Notifications in Sketchware

A Flash Light App in Sketchware

Create a Stopwatch App using Chronometer in Sketchware

Create app to save all passwords, protected using voice key