Android Question Cold Boot Using USB Accessory

floatingpoint

Member
Licensed User
Longtime User
Android 4.1.2.
I have a working Kiosk App that runs whenever the USB is connected to an accessory identified via manifest. Power is also supplied via USB.
All good.

If the Host is turned off for > 1 day then Android device battery will drain and shut down.
On power-up the Android device simply starts to charge but does not cold boot.

I have looked around the Android forums and this forum but cannot seem to find an answer to whether it
is possible to automatically cold boot following USB (accessory) power restore?

Any pointers greatly appreciated.

FP
 

floatingpoint

Member
Licensed User
Longtime User
For the information of those interested, I didn't have any luck with the toggle library and GotoSleep for reasons of lack of permission as others have noted in toggle library threads.

I ended up enabling the Android device power save manually via System menu and using Kiosk App code:

B4X:
Dim Awake As PhoneWakeState

'In Main:

Sub Activity_Resume
    Awake.KeepAlive(True)  ' Keeps screen on full brightness which appears to disable Android power-save
    .
    .
    .
End Sub


'and In Service when USB data watchdog timed out due to no data call:

Sub Service_Destroy   ' The service will not be running after this Sub Until you call StartService again
   UsbClose
   Awake.ReleaseKeepAlive   ' Allows Android power-save to operate for USB down
   ExitApplication
End Sub


Hope this helps someone.

FP
 
Last edited:
Upvote 0

oceanwanderlust

Member
Licensed User
Longtime User
Floatingpoint,

How does your code example help the device get past the bootloader / battery charging screen when power is applied again? Or, are you just making the device last long w/o power?

From what I have found, cold boot is possible by modifying the bootloader on some devices such as Galaxy or Nexus, but I have not found a solution for my Tab4 Kiosk.
 
Upvote 0

floatingpoint

Member
Licensed User
Longtime User
Floatingpoint,

How does your code example help the device get past the bootloader / battery charging screen when power is applied again? Or, are you just making the device last long w/o power?

From what I have found, cold boot is possible by modifying the bootloader on some devices such as Galaxy or Nexus, but I have not found a solution for my Tab4 Kiosk.

Since I don't need any wireless for this app, I turn it off and am just making the device last long without power.

FP
 
Upvote 0
Top