Android Question How To Display System Clock In A Button

mark787

Member
Licensed User
Longtime User
I would like to display the on going system time in a button, or label or text view..... but I cannot find any source code that actually works..... does anyone have any tried and tested simple B4a source code that actually works.....
 

mark787

Member
Licensed User
Longtime User
I would like it to be more like a digital clock in a button with the seconds ticking off one by one as well ............. I already have the code you have reference that code only displaces a single instance of time and no more.
 
Last edited:
Upvote 0

mark787

Member
Licensed User
Longtime User
Upvote 0

mark787

Member
Licensed User
Longtime User
Who cares about a font/s ......................I would like it to be more like a digital clock in a button with the seconds ticking off one by one as well ............. I don't need no font declaration ............... I need source code for a digital clock in an App.......HHHHHHHHHHHHEEEEEELLLLLLLLLLPPPPPPPPP.
 
Upvote 0

MaFu

Well-Known Member
Licensed User
Longtime User
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User

When you say digital, what are you mean,?
My first association is a "digital look like" but, you actually maybe think: two different clock exist in device, and you don't want nasty analog, but great digital clock!?!?!?
You are also rude, so I will not provide any future help/answer.
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
I need source code for a digital clock in an App

Mark, I would like to explain to you what a digital clock is (as it seems you are not sure about this)

DIGITAL:



ANALOG:



As you see, a digital clock is just a string like "12:59:59" which you can put into a label, an edittext or even in a button.

Maybe you then think of "that looks crap, I want a good looking one". It's like in Word: You need to set another FONT like this one



There's a cool thing. It's called "Google search". Just type "digital clock font" and... WOW... Much font, so wow...". So then just LOAD that FONT (as Pendrush posted), color it as you need and get the time (see MaFu's post).

PS: As you see, three people are helping you. So be kind...
 
Upvote 0

mark787

Member
Licensed User
Longtime User
@mark787 : please try the project attached

This is what I was so desperately looking for.............I had to edit your Code to get exactly what I wanted........ Now it works perfectly...
I think I could love you if I didn't love myself so much........Thank you so much!...... You are the Greatest! Lemonisdead,...........

Sub Process_Globals

Dim T1 AsTimer

EndSub

Sub Globals

Private Button110 As Button

EndSub

Sub Activity_Create(FirstTime AsBoolean)

Activity.LoadLayout("Botto.bal")

T1.Initialize("T1",DateTime.TicksPersecond)

DateTime.TimeFormat="hh:mm:ss"

EndSub

Sub Activity_Resume

T1.Enabled=True

EndSub

Sub Activity_Pause (UserClosed AsBoolean)

EndSub

Sub Button110_Click

EndSub

Sub T1_Tick

UpdateButton110

EndSub

Sub UpdateButton110

Button110.Text=DateTime.Time(DateTime.Now)

EndSub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…