开发者

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.


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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜