[Q] Orientation sensor, tips for saving battery? - Android Software Development

Hi, I'm developing an app that uses android orientation sensor, it is a service. However, I was using this app and I discover that it is responsible for draining my battery.
Any developer has any tip for saving battery when using this orientation sensors?

Related

Desire HD Sensor Usage, Battery Drain

Greetings,
Just wondering if anyone has noticed that if you use Spare Parts, go to Sensor Usage, and under "Android System" it seems to use a ton of sensor, without any real explanation as to what it's all about.
I had this problem with my Galaxy Tab and the Gallery3D application (it also happens on the DHD if I'm not careful) and it drained the battery like crazy.
Any explanation, fix, or workaround? Any thoughts would be appreciated
That's really not an issue, you notice that when your sending a SMS and you hold it landscape the orientation changes? That's because a sensor told your DHD to switch the orientation.
Without them being on all the time your smartphone wont be so smart as you'd have to change the brightness of your display every time it gets dark, you'd have to manually change the orientation. You get the picture.
RE: Sensor Usage and Accelerometer
Hi,
I am aware of that but that is not the issue. On all other android phones and devices (I have 2 android tablets and 3 other phones) the Sensor Usage is not like that. It won't be activated even when the phone is "off" or in hibernation mode.
Like I said, I used to have this issue with my Galaxy Tab which caused it to use alot of battery (Gallery 3D App) and I did have a workaround which improved battery life significantly.
Any other suggestions would be kindly appreciated.

[Q] P-Sensor VS G-Sensor Battery Consumption ?

Q: Which of these two uses more juice?
for example, an app to automatically turns on the screen uses proximity sensor
and another app that uses g-sensor (or when shaken) turns on your screen
if these app is turned on for a whole day, which of them use more battery?
note that it must work even if the screen is off.
Don't speculate, measure the current.
http://forum.xda-developers.com/showthread.php?t=2487055
Renate NST said:
Don't speculate, measure the current.
http://forum.xda-developers.com/showthread.php?t=2487055
Click to expand...
Click to collapse
thanks, i was just getting a general fact anyways, i thought somebody already tried measuring it
Try_Catch_ said:
Q: Which of these two uses more juice?
for example, an app to automatically turns on the screen uses proximity sensor
and another app that uses g-sensor (or when shaken) turns on your screen
if these app is turned on for a whole day, which of them use more battery?
note that it must work even if the screen is off.
Click to expand...
Click to collapse
i found this . hope it helps
[4] Q: I'm experiencing high battery usage, why?
A: The app should use about 6 percent extra energy per day if you are not using too much the Turn Screen On by Motion feature. If you frequently lay your phone face up on a table and the Turn Screen On by Motion Timeout is too long, the battery consumption can be much higher. Because the CPU has to be constantly analyzing the data of to acceleration sensor to catch the movement when you lift up the device. Thus if you want to reduce the battery usage it's recommended to keep your phone often lying face down when it's on a table. Because in this situation the proximity sensor is responsible for turning the screen back on which uses much less energy. Moreover, please, keep in mind that the android en-built battery consumption measurement can show much higher results, because it shows the battery usage relatively to another apps. If the phone was not in use or the measurement period was short, it looks like my app uses too much energy however there was not too much energy used all together.
op:
http://forum.xda-developers.com/showpost.php?p=40102037&postcount=3

LGE Gravity Sensor Battery Drain - Any fix?

Hey all,
I've done some searching around and haven't been able to find a solution for this. The LGE Gravity Sensor (which is related to Knock On) has been causing my Android OS to stay awake and cause battery drain. I attempted to Greenify doubletab and Knock On still worked, but it didn't fix the battery drain. I turned off Knock On and it went away immediately so I know that is the problem.
Has anyone found a way or know a way to keep this from draining battery but still keep Knock On functionality?
If I compare battery between having Knock On active or disabled, it's not doing that much to the battery. But in the battery stats it looks much different as with Knock On disabled, your display will take the top spot and not Android OS anymore.
Sent from my LG-V500 using Tapatalk

**touchless sleep/wake control!! (app - gravity screen)**

Waking up a device involves the hassle of picking up our device, reaching for the power button, and then pressing it to turn the screen on.
However, using the gyrometer and proximity sensors, gravity screen wakes your device up right as you pick it up, or hover your finger over the proximity sensor!! Neat!
Pros :
Small and light-weight
Doesn't hog up on RAM
No appreciable effect on battery life!
Various options to tune the settings to your liking!
Helpful for devices with broken power buttons
Cons :
None. You say?
This app has been around for a while, and it works seamlessly with our device.
All credits to the developer Plexnor. It is his work. Be generous, and buy him a beer if you may.
Play store link :
https://play.google.com/store/apps/details?id=com.plexnor.gravityscreenofffree&hl=en
Here's a video on the same : :laugh::laugh:
https://youtu.be/NJ6kgaDIwCU
[APP][2.2+] Gravity Screen > Turn Screen On/Off Automatically - Keep Screen On
It doesn't seem to show up on the stock battery consumption screen but on BBS and Gsam, GravityScreen was consuming almost 7 to 12% battery per day.
Maybe I'm doing something wrong but I even turned off the wake by motion and all other accelerometer related services and kept only Proximity Screen On and Proximity Screen Off options ON.
Any suggestions?
Sent from my Nexus 5
Achilles. said:
It doesn't seem to show up on the stock battery consumption screen but on BBS and Gsam, GravityScreen was consuming almost 7 to 12% battery per day.
Maybe I'm doing something wrong but I even turned off the wake by motion and all other accelerometer related services and kept only Proximity Screen On and Proximity Screen Off options ON.
Any suggestions?
Sent from my Nexus 5
Click to expand...
Click to collapse
same here...i have done all suggested tips...
[4] Q: I'm experiencing high battery usage, why?
A: The app should use about 6 percent extra energy per day if you are not using too much the Turn Screen On by Motion feature. If you frequently lay your phone face up on a table and the Turn Screen On by Motion Timeout is too long, the battery consumption can be much higher. Because the CPU has to be constantly analyzing the data of to acceleration sensor to catch the movement when you lift up the device. Thus if you want to reduce the battery usage it's recommended to keep your phone often lying face down when it's on a table. Because in this situation the proximity sensor is responsible for turning the screen back on which uses much less energy. Moreover, please, keep in mind that the android en-built battery consumption measurement can show much higher results, because it shows the battery usage relatively to another apps. If the phone was not in use or the measurement period was short, it looks like my app uses too much energy however there was not too much energy used all together.
Yes I frequently lay the phone face up for see the notification led....
ironia. said:
same here...i have done all suggested tips...
[4] Q: I'm experiencing high battery usage, why?
A: The app should use about 6 percent extra energy per day if you are not using too much the Turn Screen On by Motion feature. If you frequently lay your phone face up on a table and the Turn Screen On by Motion Timeout is too long, the battery consumption can be much higher. Because the CPU has to be constantly analyzing the data of to acceleration sensor to catch the movement when you lift up the device. Thus if you want to reduce the battery usage it's recommended to keep your phone often lying face down when it's on a table. Because in this situation the proximity sensor is responsible for turning the screen back on which uses much less energy. Moreover, please, keep in mind that the android en-built battery consumption measurement can show much higher results, because it shows the battery usage relatively to another apps. If the phone was not in use or the measurement period was short, it looks like my app uses too much energy however there was not too much energy used all together.
Yes I frequently lay the phone face up for see the notification led....
Click to expand...
Click to collapse
Update it and try using only the Proximity wake and sleep..
Battery drain is minimal. [emoji16]
Sent from my Nexus 5
Achilles. said:
Update it and try using only the Proximity wake and sleep..
Battery drain is minimal. [emoji16]
Sent from my Nexus 5
Click to expand...
Click to collapse
i will try, but i have already updated app, i can't live without table mode

Usage of proxomity sensor

How come the usage of proximity sensor under Android System is much higher whilst on mobile network than on wifi?
I think that plays a role in sub optimal battery life..
Here is a quick screenshot.
Proximity sensor doesn't have anything to do with your network connection. Other than when you're at home/work and connected to wifi, your phone is probably laying face up somewhere (proximity sensor off) and when you're not connected to wifi (you're out and about in the world) your phone is in your pocket/bag and the sensor is covered (on).
Just guessing.
According to Elixir, somehow it lists 2 proximity sensors?? using 0.1mA each, so 0.2 mA together. It doesn't say at what voltage, but at nominal battery 4 volts, you would use about 0.8 mW of power per hour. After 1000 hours of usage you would end up using 0.8 W of power and battery capacity is about 12-13W. I don't think you should worry about that sensor too much. Also according to Elixir, the biggest power users are rotation and orientation sensors (there are few) at about 1.5mA each. If you compare that to power used by screen and radios, the sensors use meaningless from power usage point of view. IMO the biggest culprit are programs running in the background and communicating with servers and there is no easy way to stop it.
akira888 said:
How come the usage of proximity sensor under Android System is much higher whilst on mobile network than on wifi?
I think that plays a role in sub optimal battery life..
Click to expand...
Click to collapse
because your phone is in your pocket/ purse/backpack more when you're out and about, when at home posted up it's sitting on the counter/couch/table. Why does this matter? Settings>Display>Keep screen turned off
"Prevent the screen from turning on accidentally while the device is in a dark place such as a pocket or bag"
This means the proximity sensor is more active in your pocket. And typically when you're on WiFi, it's not in your pocket.
Just a guess but I believe I'm right.
Sent from my SM-G955U using Tapatalk

Categories

Resources