[APP] Proximity Sensor for Screen Off v0.2

Search This thread

exidler

Senior Member
Oct 12, 2007
158
85
May be this tool will be usefull.
It switch off screen using proximity sensor detection.
Like alternative power button.
After proximity detected - screen switched off and proximity sensor don't used until screen will be switched on again manualy.

No screenshots
Second time running will unload program from memory, it can be used for switching on/off proximity lock feature.

All settings in registry, settings reloaded on each program run.

HKEY_CURRENT_USER\Software\Exidler\Hd2ProximityScreenOff
AfterCallReactivateSensor = dword:150 - time in ms when activate proximity sensor after call ended
SensorOffWhenProximity = dword:0 - time in ms when disabling proximity sensor on proximity detected. May be useful for disabling accident detection. This time proximity sensor is still active and if no porximity detected with this time - screen will be switched on automatically
ActiveOnlyIfLocked = dword:0 - Activate Proximity sensor only if Phone locked.

HKEY_CURRENT_USER\Software\Exidler\Hd2ProximityScreenOff\Exceptions
Create any named sub keys with values:
ClassName = string - name of windows class
WndTitle = string - title of window
ProcName = string - name of process

For exception windows proximity sensor will be disabled if this one window is active.
All criterias are optional. For example create only one value ProcName="Explorer.exe" for disabling proximity lock when Resco Explorer is active.

Proximity sensor activated only in portrait mode.

Change log
2010-01-29: v0.2
- full uninstallable cab
- add options: After Call Reactivate Sensor, Sensor Off When Proximity, Active Only If Phone Locked, Exception windows
- disbaling Proximity lock when landscape mode

2010-01-28: v0.1 Test version. Bugs possible.
 

Attachments

  • Hd2ProxmityScreenOff-0.1.CAB
    9.4 KB · Views: 1,849
  • Hd2ProximityScreenOff-0.2.CAB
    79.5 KB · Views: 11,436
Last edited:

richardirv

Senior Member
Mar 25, 2008
383
7
Great something to get us started, did you make this yourself? Are you willing to put some time in to perfect it & create some options etc. if we bug test it?
 

ET

Senior Member
Aug 20, 2006
389
1
May be this tool will be usefull.
It switch off screen using proximity sensor detection.
Like alternative power button.
After proximity detected - screen switched off and proximity sensor don't used until screen will be switched on again manualy.

No screenshots, not settings, just install and reboot phone (or run tool manual from Install directory)

Second time running will unload program from memory.

Test version. Bugs possible.

How will this effect the screen turning on after a phonecall, i wan't the screen automatically turned on after a call without having to press a button.
Will this tweak allow default function in that case?
 

exidler

Senior Member
Oct 12, 2007
158
85
Are you willing to put some time in to perfect it & create some options etc. if we bug test it?
I don't know which options may be added.
I'm can't full control proximity sensor. It's only possible to enable proximity sensor, and htc drivers switching off screen by itself. The i'm disable proximity sensor again :)

But if it's will be possible to implement some features - i can try to do this.
 

richardirv

Senior Member
Mar 25, 2008
383
7
Ok this is a good start, for me the following things need to be worked out for this to work good.

1. Only works when phone is upright, ie. Portrait. Reason being is if the screen goes off via Proximity in when holding the phone in landscape there will be allot of accidental activations, especially while playing games etc. It is much less likely that proximity will be detected when holding the phone upright.

2. Screen needs to come back on when proximity not detected, as to not cancel out the in call screen off feature.

Will keep thinking! Really hope you can work some magic here exidler!! Thanks
 

exidler

Senior Member
Oct 12, 2007
158
85
How will this effect the screen turning on after a phonecall, i wan't the screen automatically turned on after a call without having to press a button.
it will handle proximity sensor to default behavior after call. so i think (and shure) - screen will blink for short time (~200ms) and will be switched off by tool.
 

ET

Senior Member
Aug 20, 2006
389
1
it will handle proximity sensor to default behavior after call. so i think (and shure) - screen will blink for short time (~200ms) and will be switched off by tool.

Let me test, I assume the cab can be de-installed and everything is back to default behaviour?
 

exidler

Senior Member
Oct 12, 2007
158
85
1. Only works when phone is upright, ie. Portrait. Reason being is if the screen goes off via Proximity in when holding the phone in landscape there will be allot of accidental activations, especially while playing games etc. It is much less likely that proximity will be detected when holding the phone upright.

2. Screen needs to come back on when proximity not detected, as to not cancel out the in call screen off feature.
in call screen back on when no proximity
when not in call - it switch off. or you talking about switching on screen when not in call?

about landscape and portrait. it's make easy if screen orientation really changed (if not - polling g-sensor - is not a good idea for battery i'm think)
 

richardirv

Senior Member
Mar 25, 2008
383
7
in call screen back on when no proximity
when not in call - it switch off. or you talking about switching on screen when not in call?

about landscape and portrait. it's make easy if screen orientation really changed (if not - polling g-sensor - is not a good idea for battery i'm think)

I just ment you don't want it to interfere with the in call actions the HD2 already has.

As you say g-sensor polling etc. no good for battery. I have a feeling this maybe flawed before we get started.
 

exidler

Senior Member
Oct 12, 2007
158
85
I just ment you don't want it to interfere with the in call actions the HD2 already has.
program know about call and not be interferace with HD2 proximity call actions.

Landscape alternative - Programs (windows) exceptions - when it's active - promity sensor may be disabled. (but this feature need more time for apply)
 

ET

Senior Member
Aug 20, 2006
389
1
Just tested the app and maid an incomming call with an other phone, the screen will automaticly turn on after moving from my ear as should be.

Great app I must say!
 

richardirv

Senior Member
Mar 25, 2008
383
7
My fear is when using apps like fpsece etc, the screen will keep going off. Need to put our heads together and brainstorm some ideas to prevent acidental proximity.

The landscape idea with g-sensor was the first thing that came to me but hopefully there will be a better idea. Maybe only when the phone is perfectly horizontal (i.e as it goes into a pocket) The problem is keeping the g-sensor active will drain battery....

Idea's peeps!! ;)
 

ET

Senior Member
Aug 20, 2006
389
1
Hmm no way of de-installing it. If I use the app and then push the on button and then try to remove the app via start/settings, after about 10 seconds the device freezes.
Even after trying to install the app again (wich usually workes to remove apps witch can't be completely removed via start/settings) the device freezes.

Taking battery out is only way to restart. App remaines on device though.

Noticed also that the app is flawed, trying to go with my right finger to the left top of the screen to push start makes the screen turn of and that simply sucks.

HOW TO REMOVE THIS APP?
 

exidler

Senior Member
Oct 12, 2007
158
85
HOW TO REMOVE THIS APP?
Before uninstalling go to install folder (defaul is \Program Files\Hd2ProxmityScreenOff) and run exe file inside Hd2ProxmityScreenOff.exe
You will see message about that programe closed. Tap Ok and then uninstall.
All be fine.

about freezing when uninstalling without stopping in memory process i'm know.
 

ET

Senior Member
Aug 20, 2006
389
1
Before uninstalling go to install folder (defaul is \Program Files\Hd2ProxmityScreenOff) and run exe file inside Hd2ProxmityScreenOff.exe
You will see message about that programe closed. Tap Ok and then uninstall.
All be fine.

about freezing when uninstalling without stopping in memory process i'm know.

OK thanks, it's de-installed correctly. Maybe will use it in the future when it has matured a bit.
 

Bib_x

Senior Member
Oct 10, 2007
962
38
The programm should look on proximity-sensor, when i turn on my phone with the power-button.

--> if proximity detectet, screen should be staying off
--> if no proximity, phone should be wake up

Is this possible with your app? This would be a very great feature off our hd2! Perfect locking solution!
 

exidler

Senior Member
Oct 12, 2007
158
85
The programm should look on proximity-sensor, when i turn on my phone with the power-button.

--> if proximity detectet, screen should be staying off
--> if no proximity, phone should be wake up

Is this possible with your app? This would be a very great feature off our hd2! Perfect locking solution!
it's not possible until full hack of promitiy sensor.
i'm not have a fule of knowlendge fo arm assembler interpereting.
it' not difficlt for poples, how have knowledge of arm programs research.
but for me, i'm only can handle simple events :(

We are waiting for full promitiy API :)

so all of yours requests is impossimle.
 

MichelDiamond

Retired Recognized Developer
Jul 6, 2009
2,222
272
perhaps a little bit easier to develop and to get various possibilities:

could you add 2 parameters to your app:
-activate
-deactivate
or so.
then it could be called also from other apps depend on its needs and states.

And also one scenario: It should only work if screen is locked(using notification).Then it's sure,that it should switch off because sensor detection

Keep up your great work.A really good idea,which can be very useful, if adaptable and a little configurable.

Thanx
Micha
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    May be this tool will be usefull.
    It switch off screen using proximity sensor detection.
    Like alternative power button.
    After proximity detected - screen switched off and proximity sensor don't used until screen will be switched on again manualy.

    No screenshots
    Second time running will unload program from memory, it can be used for switching on/off proximity lock feature.

    All settings in registry, settings reloaded on each program run.

    HKEY_CURRENT_USER\Software\Exidler\Hd2ProximityScreenOff
    AfterCallReactivateSensor = dword:150 - time in ms when activate proximity sensor after call ended
    SensorOffWhenProximity = dword:0 - time in ms when disabling proximity sensor on proximity detected. May be useful for disabling accident detection. This time proximity sensor is still active and if no porximity detected with this time - screen will be switched on automatically
    ActiveOnlyIfLocked = dword:0 - Activate Proximity sensor only if Phone locked.

    HKEY_CURRENT_USER\Software\Exidler\Hd2ProximityScreenOff\Exceptions
    Create any named sub keys with values:
    ClassName = string - name of windows class
    WndTitle = string - title of window
    ProcName = string - name of process

    For exception windows proximity sensor will be disabled if this one window is active.
    All criterias are optional. For example create only one value ProcName="Explorer.exe" for disabling proximity lock when Resco Explorer is active.

    Proximity sensor activated only in portrait mode.

    Change log
    2010-01-29: v0.2
    - full uninstallable cab
    - add options: After Call Reactivate Sensor, Sensor Off When Proximity, Active Only If Phone Locked, Exception windows
    - disbaling Proximity lock when landscape mode

    2010-01-28: v0.1 Test version. Bugs possible.

    Woooow!
    excellent application!!

    Why not continue the development?

    can you make "Proximity Sensor for Screen Off / ON" ????