如何更新的Android时间 [英] How to update the android time
问题描述
我采用了android TAB对于一些应用程序开发。
在我的应用我得到UTC时间从其他应用程序(其他设备通过TCP套接字提供了我的应用程序)。有一次,我收到这个我需要得到时间来更新时间。有没有API来更改系统时间..?
公共静态布尔setCurrentTimeMillis(long millis)来
设定当前挂钟时间,以毫秒为单位。 需要调用进程具有相应的权限。 [虽然只有系统进程可以更改时间]
用户的应用程序无法设置时间。只有系统进程。这是
对于
安全性,而且还因为我认为它不会有太大的effect--时间确实从重置
通过网络时间收音机。
I am using android TAB for some app development . in my application I get UTC time from the other application(other device provides to my application via TCP socket ) . Once I receive this I need to update the time with receive time . Is there any apis to change the system time ..?
public static boolean setCurrentTimeMillis (long millis)
Sets the current wall time, in milliseconds. Requires the calling process to have appropriate permissions. [although Only system process can change the time]
User apps cannot set the time. Only the system processes can. This is for security, but also because I think it won't have much effect-- the time does reset from the radio via network time.
这篇关于如何更新的Android时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!