1

I am trying to develop a kiosk application on android. I am facing two challenges.


  1. Once the tablet getting off due to a battery drain. it is not turning on even after the battery reached 100% . is there a work around for this ? I have seen regarding editing some files in /system/init of Android after rooting. But I have not seen any file related to battery or charging. I am using 4.1 and higher

  1. I am experiencing a problem of battery draining. as it continuously keep display on, battery drains gradually even if the charger is connected.

Has anybody came across similar problems and find any solutions ?

Is there android devices available which , power on automatically after connecting wall charger ? Is there tablets that doesn't have battery and directly works from charger connection ?

Please provide your suggestions.

Update 1:


As I am using kiosk operation, I have to keep the screen on every time. I am not experiencing a quick battery drain, it drains slowly even if the charger connected , like 1 percentage in 6-8 minutes, so it lasts approximately 10 hours with charger connected. Then once it gets switched off, it needs to be powered on manually ( not power on after battery drain is a normal behavior, but is there a work around for this ?).

Actually I am not expecting the battery to get drained on a charger connected. is that a normal behavior ?

Can I do anything from the software to prevent it ? When I analyzed most of the power is consumed by screen, then wifi, then comes the application. Both are switched on all the time. Any advises on this ???

Update 2:


</p>

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="in.aivknowtech.reviews.permission.C2D_MESSAGE"/>
 android:permission="android.permission.BIND_DEVICE_ADMIN"

Update 4


As my issue is considered. It is not an issue triggered by a particular event. I assume when connecting a charger android is loading the kernel and only showing a battery symbol, When we press on power button it boots up the kernel. Is there a way to bypass it ? Or is it depended on hardware or firmware ?

If it is dependent on android, Yes there is some hack we can do about it. Else it might be not possible. :(

A similar discussion is here but no definite answer android auto boot on external power

  • 1
    Sounds like your charger is too low-powered for the device, or the device is running some abnormally intensive task in the background. – Huey Aug 04 '15 at 11:54
  • @Huey, I have tested on two devices, both behaves similarly, is that because of the chargers are not made with enough current capacity ? (are they made in charge only when the screen is switched off ?) – aivknow tech Aug 04 '15 at 12:43
  • What's the current supplied by your charger. Since it's a tablet you'll probably need >= 1.5A ideally – Huey Aug 04 '15 at 12:59
  • Currently the supplied charger (7" tab) 5V and 1A usb charger. – aivknow tech Aug 04 '15 at 13:54
  • @Huey,I am seeing a progress now. I connected a 2A charger instead of 1A. Now the battery is getting charged instead of slowly draining. Seems like this will be enough. I am doing further tests , will update you. – aivknow tech Aug 05 '15 at 05:11
  • @Huey , I have switched off wifi and reduced screen brightness , now 1A charger also can charge it while using the application. – aivknow tech Aug 05 '15 at 06:37

1 Answers1

2

@aivknow tech

I did this on Samsung Galaxy Tab sm-t330nu

edit the lpm service entry in init.rc from

service lpm /system/bin/lpm
    class charger
    critical

to

service lpm /system/bin/reboot
    class charger
    critical

Result = from powered off state, plug in charger, battery icon displays briefly, then device reboots to normal operation.

to mod your device's service in your init.rc in the

on charger

section find that equivalent service.

moonbutt74
  • 683
  • 5
  • 14
  • Hi , I am not using custom kernel, I have updated the question to depict the scenario well. application is using hardly 10%-15% CPU max and most of the time it is not having any processing in the background. – aivknow tech Aug 04 '15 at 12:46
  • @aivknow tech , hmm what permissions does you app have? is it running in foreground when the issue occurs? Is this issue originating from the device or from the device while running the application? – moonbutt74 Aug 04 '15 at 13:41
  • It is having admin policy permissions also. please see the update given. – aivknow tech Aug 04 '15 at 13:55
  • This is for locking the device when power is not connected. Yes my application runs all the time on the device. there is not other foreground application. – aivknow tech Aug 04 '15 at 14:02
  • @aivknow tech, ok neat, so this is where my thought process is going continuing with suspend/resume issue and permissions EDIT - see above, can't wrap thins right in comment... – moonbutt74 Aug 04 '15 at 14:14
  • 1
    Thanks for your your answers. I think daydream might not make much difference. please see more thoughts on the Edit. – aivknow tech Aug 05 '15 at 05:46
  • @aivknow tech check my edit, if this is what you mean, start tab from powered off state by plugging in charger then try the above. – moonbutt74 Aug 05 '15 at 14:50
  • Great thank you boombutt74. I will try and update the result – aivknow tech Aug 06 '15 at 04:32
  • Hi I was going through the documents related to it. I think you are pointing to the correct point. I would like to know few more points, I will need root permission to do this isn't it ? Also do I need the source of the ROM or just unpacking ram-disk will make the changes permanent ? – aivknow tech Aug 06 '15 at 11:01
  • You would need to be root to pull your boot.img. You would also need to be root to write it back. The edit may be slightly different for your device but the approach should work exactly the same. You would be reassigning a service directly connect to battery charging from power-off state to run reboot command instead, effectively booting your tab to OS when you plug it in. – moonbutt74 Aug 06 '15 at 11:43
  • Yes Thanks moonbutt74, this gives a very clear idea regarding how I can achieve it. I had looked for it many places. Thank you again. – aivknow tech Aug 06 '15 at 11:51