I trying some stuffs with android as i am learning android development, now i have a scenario here.
Layout is as below
Now what i want is when the user clicks the button the date should increase by say 20 days how can i do this.
i am unable to start...please help
Update Date & Time on Your Android DeviceTap Settings to open the Settings menu. Tap Date & Time. Tap Automatic. If this option is turned off, check that the correct Date, Time and Time Zone are selected.
Turn Automatic Date Settings On and Off Go to Settings > General management or System > Date and time and turn the Automatic date and time button off and then back on. These settings may vary slightly depending on your device. In most cases, this action should readjust your clock to the accurate time.
As I already said that's impossible. You need the SET_TIME
permission and that permission is granted by system only to applications that are in the Android system image. If You are able to gain that privilege you can easily change with the AlarmManager. SystemClock.setCurrentTimeMillis
write the /dev/allarm file
adb shell ls -l /dev/alarm
crw-rw-r-- system radio 10, 46 2013-06-12 10:46 alarm
c
stays for Character special file (stored in /dev).
system and radio have read and write permissions (rw-, tree bits, int value 6), the others have only the read permission (r, int value 4). So the file permission is 664
. If you can get root user (running su
), you can change the permission of this file and wrote in it a new value. A bug report has been filled in order to ask google to allow apps to modify programmatically the mobile date but it has been declied. Here the reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With