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:



Comments

  1. can you create an apps that show ussd mobile codes? very hard to me

    ReplyDelete
  2. Dear you can just write the ussd codes in textview in Sketchware.

    ReplyDelete
  3. Matthew 22
    [35] Then one of them, which was a lawyer, asked him a question, tempting him, and saying, [36] Master, which is the great commandment in the law?

    Revelation 22
    [15]...and whosoever loveth and maketh a lie.

    FIND THE ANSWERS YOU SO DESPERATELY SEEK !
    >>>>>>>>>>>>>>>>>>>>>>>>>>>
    NEW TESTAMENT BIBLE STUDY
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<


    Billionaires are BRILLIANT !

    scratchwiththechickens@gmail.com
    seeking benefactor

    !

    ReplyDelete

Post a Comment

Popular posts from this blog

A Flash Light App in Sketchware

Create Music Player app in Sketchware

In Sketchware: How to create a calculator for any simple formula?

Simple car racing android game in Sketchware

Firebase auth in Sketchware for Login Activity