proximitysensor

Keep display on when the proximity sensor is covered

久未见 提交于 2019-12-03 05:39:10
I want to intercept the proximity sensor without turning off the display. I know by the documentation that I have two Bool variables: proximityMonitoringEnabled proximityState and this code [UIDevice currentDevice].proximityMonitoringEnabled = YES; When the proximity sensor detects something it turns off the display, same way it does when you're holding the phone to your ear when on a phone call. How do I keep the display on when the proximity sensor is covered? After reading different forums on the topic, its currently not possible for us in the public api to prevent the iPhone screen from

Detect if the phone is in pocket or not

£可爱£侵袭症+ 提交于 2019-12-02 23:52:22
This question is not exactly about code but rather implementation. I am working on an app that requires to check if the phone is in pocket or not. I have a simple algorithm to detect user steps when walking. The problem is movement in hand can also be registered as a step, e.g. when user runs the app and zeros the step values from the time that he/she does this to the point that the phone is in pocket, the app registeres a few steps. My idea is to check proximity sensor and see if the phone is in pocket. What I do with accelerometer sensor is that I continuesly read the accelerometer values in

onAccuracyChanged, why?

旧时模样 提交于 2019-12-01 20:41:02
问题 this is one of the auto-generated functions I get when implementing SensorEventListener i've searched and didn't find anymore than this description: "Do something if sensor accuracy changes." when and how does the proximity sensor accuracy changes ? and in what way can this be useful on my apps ? 回答1: According to my understanding, OnAccuracyChanged method is invoked whenever a sensor reports with different accuracy and onSensorChanged method is called whenever a sensor reports a new value. I

onAccuracyChanged, why?

梦想的初衷 提交于 2019-12-01 19:02:05
this is one of the auto-generated functions I get when implementing SensorEventListener i've searched and didn't find anymore than this description: "Do something if sensor accuracy changes." when and how does the proximity sensor accuracy changes ? and in what way can this be useful on my apps ? driftking9987 According to my understanding, OnAccuracyChanged method is invoked whenever a sensor reports with different accuracy and onSensorChanged method is called whenever a sensor reports a new value. I too had the same question, as in how to make use of onAccuracyChanged method. Let's say you

Android proximity sensor issue only in Samsung devices

核能气质少年 提交于 2019-11-28 11:13:44
Specific scenario to avoid problems: Behaviour for Activity in Samsung devices was different in the manner that every time there was a change detected, for proximity, it resulted in a call to onPause()/onResume() ONLY on SAMSUNG devices. I was clearing the proximity sensors in onPause() which resulted in a behaviour unique to Samsung devices. Hope this saves some time for anybody who's facing this. I removed the call of clearing proximity listeners from onPause() and now it works as expected on the mentioned devices. UPDATE: What is mentioned below is not the only issue, the proximity sensor

Android proximity sensor issue only in Samsung devices

浪尽此生 提交于 2019-11-27 06:02:43
问题 Specific scenario to avoid problems: Behaviour for Activity in Samsung devices was different in the manner that every time there was a change detected, for proximity, it resulted in a call to onPause()/onResume() ONLY on SAMSUNG devices. I was clearing the proximity sensors in onPause() which resulted in a behaviour unique to Samsung devices. Hope this saves some time for anybody who's facing this. I removed the call of clearing proximity listeners from onPause() and now it works as expected