user728859
user728859

Reputation: 55

Accessing the time within live wallpapers

I've developed a live wallpaper. Now I want it to connect with the net to get the exact time, so the live wallpaper changes according to it. But, being an amateur, I'm not able to do it. Please help.

Upvotes: 0

Views: 323

Answers (1)

George Freeman
George Freeman

Reputation: 2260

Suggest using local system calls; no need to access Internet. Take a look at PolarClock, for example, to see some code using time-related classes: https://android.googlesource.com/platform/packages/wallpapers/Basic/+/master/src/com/android/wallpaper/polarclock/PolarClockWallpaper.java

Edit: There are two good reasons why you do not want to use the Internet to get the time:

  1. When the wallpaper is installed, the user will have to authorize Internet access. They may wonder why you want to do this when by rights it is unnecessary.
  2. Your wallpaper will not function if Internet access is unavailable.

Upvotes: 2

Related Questions