start the switched off android device automatically

200 views
Skip to first unread message

Deepesh Kankaria

unread,
Aug 31, 2015, 12:26:09 PM8/31/15
to android-platform
Hi All,

I am making an application which will be installed in rooted android devices which will be installed at remote locations. The devices would be connected to a charger all the time but there would be cases when the electricity won't be there for long hours and the mobile device gets discharged and it gets switched off. 
Now, In general scenarios we have to Long Press the POWER ON button to switch on the device but in my case it would not be possible as the device would not be accessible for human intervention. 

Please suggest any ways so that we can override the phone switch On functionality so  that the device comes up on it's own.

It would be of great help and a great add on to our applications.

Regards
Deepesh

Durgadoss Ramanathan

unread,
Aug 31, 2015, 2:14:41 PM8/31/15
to android-...@googlegroups.com
Hi,

Usually, people use relay switches to control power to the device (through a USB connected to host device), mostly for automated test environment. A quick Google search for "relay to switch power for android devices" shows a lot of links. You may explore this path to get some idea.

Thanks,
Durga 

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/d/optout.



--
Regards
Durgadoss

David Cowden

unread,
Aug 31, 2015, 8:42:40 PM8/31/15
to android-...@googlegroups.com
I think the question was more, "can I configure a device to automatically power on when it receives power?".

Glenn Kasten

unread,
Aug 31, 2015, 8:52:07 PM8/31/15
to android-platform
In general, this will require changes to the bootloader.
Most bootloader implementations that I've seen will display a "battery charging" graphic
upon first receiving power after having been previously discharged to empty.
I imagine it should be possible to modify the bootloader
to automatically boot up the OS after charging is complete,
but I am not an expert here.  Note that bootloader
implementations are often proprietary, not open source.


On Monday, August 31, 2015 at 5:42:40 PM UTC-7, David Cowden wrote:
I think the question was more, "can I configure a device to automatically power on when it receives power?".
On Mon, Aug 31, 2015 at 11:14 AM, Durgadoss Ramanathan <r.dur...@gmail.com> wrote:
Hi,

Usually, people use relay switches to control power to the device (through a USB connected to host device), mostly for automated test environment. A quick Google search for "relay to switch power for android devices" shows a lot of links. You may explore this path to get some idea.

Thanks,
Durga 
On Mon, Aug 31, 2015 at 4:10 PM, Deepesh Kankaria <1987d...@gmail.com> wrote:
Hi All,

I am making an application which will be installed in rooted android devices which will be installed at remote locations. The devices would be connected to a charger all the time but there would be cases when the electricity won't be there for long hours and the mobile device gets discharged and it gets switched off. 
Now, In general scenarios we have to Long Press the POWER ON button to switch on the device but in my case it would not be possible as the device would not be accessible for human intervention. 

Please suggest any ways so that we can override the phone switch On functionality so  that the device comes up on it's own.

It would be of great help and a great add on to our applications.

Regards
Deepesh

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platform+unsubscribe@googlegroups.com.
To post to this group, send email to android-platform@googlegroups.com.



--
Regards
Durgadoss

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platform+unsubscribe@googlegroups.com.
To post to this group, send email to android-platform@googlegroups.com.

Rishi Gupta

unread,
Sep 2, 2015, 1:33:41 AM9/2/15
to android-platform
Do you want hardware solution or software solution. When device is completely off and it is plugged into charger, booting occurs till kernel level. Take a look at 'init' of android. You can modify files in /system/init for implementing what you want.

Deepesh Kankaria

unread,
Sep 2, 2015, 10:19:42 AM9/2/15
to android-platform
Hi all,

Rishi - I want a software solution to this problem statement.

Glenn - Can you give me some pointers how can I get the information around boot loader and we are ready to use some open source or proprietary boot loader also if it serves our purpose.

Durga- Hardware solution would be our last bet. I have followed some thread where they have done something like this but it's all not full proof and their suggestions worked for them on a very specific device.

Let me explain what I have done so far.

I have rooted the device.

I tried changing some files in the /system/bin for achieving this. There is a file named as Kpoc_charger in the Micromax device which are build on Mediatek Chipset. When I removed the file; only an icon that charger is plugged comes but the animation which shows the battery percentage doesn't come. I tried adding following lines in the same file
su
/system/bin/reboot

But I am not able to reboot the system.
There are two things which I am not able to get :
1) what is the extension of these files so that I can look more into it.
2) Is there any way to see which files are looked or referred when the device reboots after discharging completely.

Any help on this would be greatly appreciated.


On Monday, August 31, 2015 at 9:56:09 PM UTC+5:30, Deepesh Kankaria wrote:

Shree Kumar

unread,
Sep 2, 2015, 11:11:24 AM9/2/15
to android-...@googlegroups.com

I am curious - what are you doing in your application that is so battery intensive  (reason for such battery discharge) ?

If there any way to prevent this, then I would encourage you to do that. E.g., the application can wait for the battery to charge prior to doing something that is battery intensive.

Thanks
-- Shree

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.

Durgadoss Ramanathan

unread,
Sep 2, 2015, 1:59:30 PM9/2/15
to android-...@googlegroups.com
Hi Deepesh,

For "which files are looked or referred when the device reboots after discharging completely":

I am not sure if you have complete access to the exact code base your device is running. But in AOSP,
I would look at

system/core/init/init.cpp (Read up around "charger mode")
system/core/healthd/healthd_mode_charger.cpp

to begin with..

Thanks,
Durga

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/d/optout.



--
Regards
Durgadoss

Deepesh Kankaria

unread,
Sep 3, 2015, 12:57:14 AM9/3/15
to android-platform
Shree ,

The devices will be placed at remote locations and hence it will not be possible to go and press the power button every now and then. So, we want to make it automatic so that once it reboots we have all the control over the device which we are managing to notifications .


On Monday, August 31, 2015 at 9:56:09 PM UTC+5:30, Deepesh Kankaria wrote:

rishi gupta

unread,
Sep 3, 2015, 12:57:14 AM9/3/15
to android-...@googlegroups.com
This have everything you will need http://androidxref.com/5.1.1_r6/xref/system/core/init/

On Wed, Sep 2, 2015 at 12:27 PM, Deepesh Kankaria <1987d...@gmail.com> wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "android-platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-platform/UxAb66cL-og/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-platfo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages