I'm developing a standalone kiosk using an android tablet(iBall running on 4.2.2).Its has the chinese MTK in it.
Suppose when there is no power,then eventually the tab's battery will drain out and have no juice left in it.When the power comes back I want the tab to automatically bootup without any manual intervention.I read online that if we modify the code present in the battery animation file we can achieve this.For the same,I replaced the original code of the battery charging animation file called 'ipod' located at '/system/bin' with :
#!/system/bin/sh
/system/bin/reboot
However,when my tab was shutdown and docked it didnt boot-up,instead it was just stuck at the charging logo.When I replaced the above code with:
/system/bin/reboot
my tab did boot-up when it was shutdown and docked.This means my code was getting stuck at '#!/system/bin/sh' . What could be the reason?
Also,while booting up the tab using the above process I want to boot it up after a delay,for which I used
sleep 20
/system/bin/reboot
but there was no delay in the bootup process(irrespective of the value of sleep that I give) How do I create this delay ?
PS: I gave 777 permission to the file; owner-root; group-shell. Kindly assist.Many thanks !
Found the reason my commands were not executing. The reason was because,I was editing on my notepad++ on windows,until I came across this answer on SO - " Make sure your text editor is not putting a /r /n and only a /n for every new line. This is typical if you are writing the script on windows.Use notepad++ (windows) and go to edit|EOL convention|UNIX then save it. " So I changed my convention as per the above answer and ran my code and got the desired result.