Or invoke adb shell date -s YYYYMMDD.HHmmss that could work as well.
Either way I think you would need root.

A better way would be to launch the settings activity with the date settings:

StartActivity(new Intent(Android.Provider.Settings.ActionDateSettings));

On Fri, Jun 15, 2012 at 12:47 AM, Jonathan Pryor <j...@xamarin.com> wrote:
> On Jun 14, 2012, at 11:45 AM, Nosh wrote:
>> Any ideas on how to set the device date and time via code
>
> You probably don't.
>
> You could probably P/Invoke settimeofday(2), but that requires that you be 
> root, so unless you happen to be running as the root user it won't do any 
> good.
>
>        http://linux.die.net/man/2/settimeofday
>
>  - Jon
>
> _______________________________________________
> Monodroid mailing list
> Monodroid@lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid



-- 
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
http://ostebaronen.dk
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to