Create Android Digital Clock App in Sketchware
To create a simple Digital Clock android app in sketchware, or to display time in your android app, follow the instructions given below.
1. Create a new android project in Sketchware.
2. In VIEW area add a LinearV linear1. For linear1 set gravity to center_vertical.
Inside linear1, add a LinearH linear2.
3. In LOGIC area, open onCreate event. Insert an add source directly block from operator section. In this add source directly block put codes provided below.
TextClock clock = new TextClock(this);
clock.setTextSize(50);
clock.setTextColor(Color.RED);
clock.setFormat24Hour("dd MMM yyyy hh:mm:ss cccc");
linear2.addView(clock);
This code creates a new TextClock clock. Then sets the text size and text color for the TextClock, sets the format for the TextClock, and adds the TextClock to linear2.
For symbols which can be used in clock format visit http://www.sketchwarehelp.com/2017/07/list-of-calendar-format-symbols-valid.html?m=1
4. Save and run the project. Install the app generated. The app will display the current date, current time, and day as shown in image below.
The video below illustrates the same.
1. Create a new android project in Sketchware.
2. In VIEW area add a LinearV linear1. For linear1 set gravity to center_vertical.
Inside linear1, add a LinearH linear2.
3. In LOGIC area, open onCreate event. Insert an add source directly block from operator section. In this add source directly block put codes provided below.
TextClock clock = new TextClock(this);
clock.setTextSize(50);
clock.setTextColor(Color.RED);
clock.setFormat24Hour("dd MMM yyyy hh:mm:ss cccc");
linear2.addView(clock);
This code creates a new TextClock clock. Then sets the text size and text color for the TextClock, sets the format for the TextClock, and adds the TextClock to linear2.
For symbols which can be used in clock format visit http://www.sketchwarehelp.com/2017/07/list-of-calendar-format-symbols-valid.html?m=1
4. Save and run the project. Install the app generated. The app will display the current date, current time, and day as shown in image below.
The video below illustrates the same.
Maybe, you already heard about lucky patcher app...
ReplyDeleteI want to make a app like this one. Can I do it with my android phone by using this Sketchware. Please, let me know the answer as soon as possible...
Impossible
DeleteFor 24std
ReplyDeleteTextClock clock = new TextClock(this);
clock.setTextSize(20);
clock.setTextColor(Color.RED);
clock.setFormat12Hour(null);
clock.setFormat24Hour("dd MMM yyyy HH:mm:ss cccc");
linear2.addView(clock);
clock.setGravity(Gravity.CENTER);
Thamk you!! This worked first time
DeleteAll I had to do was change the linear.
H one hour
ReplyDeletem one minut
S second in time in one digit
MM month in two digits
d day name
MMMM month name
dd day in two digits
yyyy year
y year in one digit
yy year in two digits
SSS secounds in time
SS minimum secounds in two digits in time
turn activity and select color of statebarcolor for activate of the color of statebar in activity in onCreate or view
ReplyDeletecreate clock with format of time or day or day name or month name or month in two digits or day in two digits or year or year in one digit or year in two digits with secounds in time or minimum secounds in two digits in time
Delete