seskindell Active Member Licensed User Longtime User Aug 4, 2018 #1 Can somebody tell me how I would implement something like this from B4A? Thank you public void setTime(long time) { if (ShellInterface.isSuAvailable()) { ShellInterface.runCommand("chmod 666 /dev/alarm"); SystemClock.setCurrentTimeMillis(time); ShellInterface.runCommand("chmod 664 /dev/alarm"); } }
Can somebody tell me how I would implement something like this from B4A? Thank you public void setTime(long time) { if (ShellInterface.isSuAvailable()) { ShellInterface.runCommand("chmod 666 /dev/alarm"); SystemClock.setCurrentTimeMillis(time); ShellInterface.runCommand("chmod 664 /dev/alarm"); } }
seskindell Active Member Licensed User Longtime User Aug 4, 2018 #2 BTW, I have a rooted phone Samsung 8. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 5, 2018 #3 You can run chmod with Phone.Shell or ShellAsync. You can call setCurrentTimeMillis with: B4X: Dim jo As JavaObject Dim time As Long = DateTime.Now + DateTime.TicksPerHour jo.InitializeStatic("android.os.SystemClock").RunMethod("setCurrentTimeMillis", Array(time)) Upvote 0
You can run chmod with Phone.Shell or ShellAsync. You can call setCurrentTimeMillis with: B4X: Dim jo As JavaObject Dim time As Long = DateTime.Now + DateTime.TicksPerHour jo.InitializeStatic("android.os.SystemClock").RunMethod("setCurrentTimeMillis", Array(time))