0

I'm creating an android application that gets the current time in a different country/time-zone. I'm making it as there aren't many other apps on the marketplace that do the same job.

I've got an analogue clock with a digital clock underneath on my app, how do I change the time on the clocks - take on or off a number of hours? For example, I may want the clock to display the time in Florida, so for me that'd be -6 hours.

Although I'm proficient in other programming languages; mainly .NET I'm new to Java, so please excuse the simple questions!

Thankyou!

Todd Davies
  • 5,484
  • 8
  • 47
  • 71

2 Answers2

3

The analog clock widget in android doesn't allow setting the time but you could adapt it as the source is available.

Community
  • 1
  • 1
Colin Pickard
  • 45,724
  • 13
  • 98
  • 148
2

If you are referring to android.widget.AnalogClock and android.widget.DigitalClock, they only show the current device time. They are not designed for showing arbitrary times, as you seek.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Ok, does that mean that I'll have to create my own clock view? That shouldn't be too much of a problem, I don't think. Thanks for your help! – Todd Davies Jan 07 '11 at 22:17
  • @Todd Davies: As @Colin Pickard suggested, you may be able to handle this via a subclass (doubtful) or a clone of the existing widgets (possible). However, if you don't like the look and feel of the existing one, you may as well roll something new from scratch. – CommonsWare Jan 07 '11 at 22:27
  • Ok, I saw an article describing how to make a custom clock widget, I'll have several .png files and rotate them around a central point to form a clock. I'll also use a TextView to display a digital time underneath. Thanks for all your help! – Todd Davies Jan 08 '11 at 10:36
  • @Todd Davies: can you please tell me where did you find that article? – Pramod Sep 08 '11 at 08:13
  • I can't remember, probably just a google search. It was quite a while ago. Sorry! – Todd Davies Sep 10 '11 at 14:58