Android :: How To Turn On / Off Screen Using Proximity Sensor?
Sep 21, 2009
I have an application that needs to turn on/off the screen using the proximity sensor like what most dialer applications do when a user is making a phone call. I cannot seem to find a way to turn on/off the screen at will.
I have a HTC Hero here, and when I tried to get the list of available sensors on the device by calling ((SensorManager) getSystemService (Context.SENSOR_SERVICE)) .getSensorList(Sensor.TYPE_ALL); I get only the following sensors: D/SensorManager( 6302): found sensor: BMA150 3-axis Accelerometer, handle=0 D/SensorManager( 6302): found sensor: AK8973 3-axis Magnetic field sensor, handle=1 D/SensorManager( 6302): found sensor: AK8973 Orientation sensor, handle=2 D/SensorManager( 6302): found sensor: AK8973 Temperature sensor, handle=3 According to the specs, there should be a light and a proximity sensor on the Hero, and I've seen it in action (the automatic screen brightness adjustment) - so at least the ambient light sensor is definitely there. My question is then, why doesn't the getSensorList return for me the light and the proximity sensors?
I've experienced the problem that when the desire is in my pocket and I receive a notification, the screen gets accidentally unlocked and the phone starts doing things that I don't want it to do. I know I can add an unlock pattern so that it won't unlock as easily but this is at the expense of me having to enter it even in situations I would not have needed it. So I thought that maybe we could use the proximity sensor to tell the phone to never unlock the screen if an object is close to the phone. Quickly looking at the android docs, it seems that the support for this is in the SDK, but I was wondering if anyone had created an application that does this. If time permits, I might even have a look at doing it myself, but as I'm very new to Android development, it will take me quite a long time to get to a usable state, hence my question about an existing app that does this.
I bought and installed a new screen (digitizer) in my Eris. The install went very well but now the proximity sensor doesn't seem to work properly. Most times when I place a call the screens goes blank and won't respond to any button inputs, Once the other party hangs up I get the screen back. But even this is erratic at times, not often, with the screen staying on all the time.
I installed Screebl Lite to force the screen on all the time and it works most of the time but seems to have a hard time figuring out the proximity sensor too.
Is there something I could have done to screw up the sensor when I took the phone apart? Everything else is working fine.
Where abouts is the sensor that detects if you are holding the phone up to your ear and dims the screen? Need to modify my wife's case (like what I did with her old iPhone case) as it doesnt turn the screen off, or if it does it doesnt turn it back on afterwards!
I had real problems until with my phone until I loaded the proximity sensor. I had a little trouble getting it to work but when it did, it remedied the one thing that I disliked about the Hero. I loaded 2.1 yesterday and generally I like it EXCEPT I cannot get the proximity sensor app to work again. Has any one else had this issue? Suggestions?
Anyone still having problems with the black screen? Have downloaded and installed the ota update and if anything the problem is worse! Seems ok on incoming calls but if I make an outgoing call the screen goes blank and the only way to reactivate is to hit the power key. This is starting to sound like faulty hardware to me. I read that the ota update was supposed to sort this! Any advise would be appreciated as other than this really annoying problem the phone is great!
First of all, I love my Desire, but there's something bothering me that's been costing me some money and trouble: Whenever I accidentaly call someone, I press the back button thinking it hangs up the call. But then I realise it's still calling! So I try to bring up the notification bar, though whenever I try to place my finger near the top of the phone, it automatically turns of the screen. After 20 seconds of trying, I've already lost money and afterwards people call back or message me why I've been calling them. Anyone else had this problem yet?
Somehow I keep managing to hang up on calls/call other people during calls. The proximity sensor does work but i think I must inadvertently move the sensor away from the screen, activating the screen. Is there an app that requires the screen to be unlocked during a call when the screen re-activates?
Is there any app, flag or something similar that can be used to bypass the proximity sensor in the HTC Legend? I mean something that makes the screen stay on all the time during a call, neglecting the proximity sensor, as if it is in the speaker mode (but without the speaker on, I don't like people listening my conversations.My problem is the proximity sensor not working. I purchased an unlocked Legend a month ago in the Manchester (UK) airport free shop. I live in Brazil and travel to USA frequently.The phone is under warranty, but for me is too far to send it to Europe for fixing (no maintenance for Legend in Brazil and even in USA, if I knew it I would never buy this thing.)When in a call, the screen and keys go off and there is no way to bring them back.The sensor seems to "think" that the phone is near my head all the time immediately after a call is made or received. Only way to bring the screen and keys back is soft reset even after the end of the call.I already tried all the typical solutions and I don't use any kind of cover over the device, and by comparison with one that works I am sure that there is a problem with the sensor. I just don't want to stay more than a month without the phone and spend nearly the same that I spent in the phone in transportation to send it for fixing, so if there is something just to bypass the sensor it will be much better for me.
Is there a way that a ROM could disable the proximity sensor during a call? I have a huge problem where I constantly hang up on people (usually my girlfriend) and that doesn't go very well . If its possible for the end buttonor volume button to wake the screen instead of the proximity, that would save me a lot of hassle. Is this doable, either standalone or through a rom setting?
It says everywhere that it does, but my screen never turns off when its close to my face. The black thing next to the earpiece should be the sensor, why doesn't it work? Does it have something to do with android 1.6 not supporting it?
I have been having this issue for quite some time, but just figures it was a bug in one of the BB roms I was using. Well, since then I have been through about 10 different versions of bugless beast, droid mod, and several others. My issue seems to be that when I make a phone call and put the phone next to my head, although the screen turns off, the touch is still activated.I will be in a call and I will feel the phone vibrate against my head. I usually hit the pound of star key on the phone, and as soon as buttons are pressed in a call, it seems to mute my voice to the person on the other side of the call. I have to remove the phone from my face, wait for the sensor to realize i moved my face, and have to press the backspace button till all the random characters are deleted at which point the person on the other side can hear me again. This happens to me on about 80% of my calls, and is by far the most frustrating issue I have had. Do you think I should re-install stock and bring it in? btw, I posted this in root sub-forum cause I am rooted, and wasn't sure if it was just a rom issue.
Is there any way to disable it? I put a body skin on it and its barely off center off but its enough to cover the sensor so when i'm in a call its constantly black and i can't do anything . I would just take the skin off and put it back on but i was stupid enough to put it over my invisible shield and im to paranoid to put any more water on my phone and wait another 24 hours. So is there anyway to disable it or do anything?
My phone (Xperia mini pro) unlocks itself way too often when it's sitting in my pocket. I was using a MIUI ROM for some time and there was that cool feature that didn't allow to unlock the screen when the proximity sensor sensed something in its... proximity. I really miss it, but I don't feel like switching from CM to MIUI just for it.
I know there are lots of apps like Gravity Screen Off or Cover Algorithm, but they don't do exactly what I wan't to have (or I didn't explore them enough), as I don't want to lock/unlock my phone by the sensor or anything. just a simple thing:
0. the screen is locked and turned off 1. the home/power button is pressed 2. the app checks the proximity senor's state 2a. if something's covering the sensor (e.g. my pocket's inside), the touchscreen is disabled (and some message appears to say so) 2b. if nothing's covering the sensor, then unlocking the screen is allowed
I'm using the CM11 4.4 Kitkat on my Galaxy S4 and recently found out that my proximity sensor isn't working (when I dial the screen goes black and won't turn on until the call is over). all I want now is to disable it but there isn't such option in the Cyanogenmod. Is there anyway to disable it, like with a terminal or something?
I have searched the forums and cannot find the answer. I need to know if there is a way this sensor was disabled through software. My sensor quit working over the last few days and I cannot find any settings that will reset it. Ive tried many reboots to include pulling the battery for about 15 minutes. The only thing out of the usual the phone has been subjected to recently is 10 25 degree weather for a little over an hour while I tried to let its gps find itself.(Eris users Buy a REAL gps and Ill save the rant)Oh, and none of the only three additional apps have been installed in the last few weeks. So someone please save me a trip to VZW.
i bought a mtk6577 clone s3. My problem is sometimes i rebooted phone, after opening proximity and light sensor doesn't work. screen don't turn off in call and doesn't call the person displayed on screen when i take ear. And battery drains too much. (example: when proximity and light sensor works with %90 battery, when it doesn't work after reboot plummets to %50).Another issue is when i reboot phone, boot animation doesn't show when proximity and light sensors don't work.
I bought a xolo q700 recently ,n i did an official software update, now proximity sensor isnt working and i dont know if it is due to the update or is it a hardware issue.. The proximity sensor is shown when I checked hardware with some app, but its not giving values... just showing waiting
I got an Otterbox (IMPACT) case for my wife's Droid Eris. I have verified that when the case is on, the proximity sensor does not operate at all. Take case off, works fine. Case is on correctly (there's not a whole lot of ways to have it on wrong). Pressing it harder onto my head (which one shouldn't have to do) or holding it farther away don't help, either. Does the other Otterbox case do this?
Anyone know if there is a way to fix this? Not being able to bring the screen back up during a call pretty much makes it impossible to call any automated line, or even delete voicemail messages.I really love this ROM but this particular issue is causing me quite a headache
I have not seen this mentioned but I have trouble with it every day. When I make a call the proximity sensor does not always work. During the call my cheek will pull up the keypad and then start dialing. Sometimes this will happen even if I remember to hit the sleep/wake button as I start the call (to turn off the screen). Very embarrassing to explain to the other party why your phone is touch-toning over their conversation. Does this happen to everyone or just me? It did it with the I4 and now the K4 firmware.
Is anyone having this issue? Friend of mine has the D2. Says the display does not turn off when next to her face and registers any touches.I don't have a D2, so I don't know what the phone options/settings might be.
Does anyone notice that when you are using bluetooth headset, the proximity sensor doesn't work? Is it a bug in Android v2.1 or am I missing something? I'm using MW-600 with X10i Android 2.1 if that matters.
My wife and i both have the EVO and for some reason she is always hanging up on people. is there any way to turn off the sensor so that when the phone is takin away from your face it doesnt light up the end call button?
Does your brightness sensor seem to be a bit too sensitive? When I have my Incredible on auto brightness and I am reading a website I can watch it adjust up and down when there are no changes in the brightness of the room I am in. My fix was to just select a brightness and turn auto off.
When I make a phone call the proximity sensor turns the screen off... great, no accidental screen pressing. However, when I finish the phone call or take the phone away from my ear... I get the lock screen. Why? Why doesn't the screen just go back on to whatever screen was on before the phone call... like the dial pad. To hang up a phone call, I have to unlock the screen first.
Does anyone know the difference between the orientation sensor and magnetic field sensor on Android?Since I've read that magnetometer is synonymous with digital compass I'm a little bit confused. What are they really?