Is it possible to control screen properties in Android - General Questions and Answers

hello everyone,
I've a question I'd like to ask regarding android, as I'm not that experience with coding, so I was hoping someone could help me with this.
to make a long story short: I've an android stick that I want to use for a Magic Mirror, but those sticks do not have a gyroscope sensor (for obvious reasons) so the screen is always set to horizontal mode. you can change the screen orientation through basic android configurations or apps, but all that does is setting the width of the screen to 50% and the height to 200%, where I really need the screen to actually rotate 90 degrees (as for the mirror I need to use the screen of the stick vertically)
my question now is if it's possible to perhaps edit the android code, through rooting or something alike, where I can control the screen properties, so I'd be able to actually rotate the screen 90 degrees.

Related

[IDEA/REQ] In-Call Lock Screen with Light and G-Sensors

Hi,
I recently bought a HTC Touch HD, and I think that the "shutdown-screen-when-you-answer-a-call" function of phones like Diamonds, Touch Pro and HD is the dumbest way to prevent accidental presses on the touch screen.
Our devices have a light sensor, that could be used to switch off the screen if the phone is near the ear (like the phone using an "i" word ) and keep it on when you answer with loudspeaker for example.
The "problem" with this function is that when you're already in a "no-light" environment, the screen lock function doesn't work.
To resolve this issue, I think we could use the G-Sensor. Indeed, if the place has no light, then, the phone cannot detect the proximity of a ear. But when you put the phone next to the ear, you hold it a the vertical...
To make it short, the app should do :
Do nothing in normal use.
When a call arrives :
- it monitors the ambient light
If there's light :
- when you answer the call, if there's light then no more (you stick the phone next to the ear), it switches off the screen and continue to monitor.
- while in call, if there's light again (you want to see some info on the screen for example), it switches on the screen and continue to monitor.
- and so on until you end the call
If there's no light :
- when you answer the call, but let it at the horizontal (you let it on the desk for example), it does nothing
- if you take the phone on the vertical position (you stick the phone next to the ear), it switches the screen off.
- if the phone, during a call, goes from vertical to horizontal of horizontal to vertical, the screen is switches on/of
- and so on until you end the call
Obviously, you could replace the "switch on/off screen" with "lock/unlock screen".
What do you think about ?
UPDATE :
After playing a bit with the HD, it appears that HTC DOES use the light sensor for turning the screen off during a call.
Let's do a test :
In a place with plenty light :
- put your mobile with the face up
- call a number (always face up) : the screen will not be switched off until the light sensor detects a loss of luminosity or a timeout set in the registry.
So, my conclusion is that HTC already use the light sensor to switch the screen off during a call, but they do it in an absurd way :
- they poll the sensor just to shut down the screen, not to switch it on.
- once the screen has been switched off, they do not longer poll at all.
Do you think it could be a way to "hack" their system to do what we want to do ?
no one has an opinion on this idea ? if there's nobody that want / have the time to develop a soft, I understand, but at least please, give me just your opinion
I agree with your idea for such an application. I must admit that I am very used to just pushing the power button when I answer a call (from Polaris use) to ensure I am not going into other programmes as I rub the phone against my ear. On the other hand I am trying to get used to the Touch HD's modern automatic method but I can't help not feeling relaxed that it has worked and keep trying to look at the screen in the corner of my eye to see if it did go off or not.
If it does not come now I am sure there will be such an app very soon just as you describe especially as all the latest models now have it.
i'd use the half of it that doesn't require the G-sensor as i don't have a diamond or HD...
but i'm certainly sick and tired of my ear operating my touch screen while i'm speaking.
I've written a prototype to do exactly what you are talking about although the one crucial part I am missing is the lock code. Every example or suggestion for locking the screen is very hacky and never feels like a good approach. If anyone has a good solution for locking the screen (especially in managed code) I would be happy to complete what I have started and release it with source so it could be improved upon.
So far, the best locking utility I have seen is PocketShield although I'm not sure what approach was used for locking in that case. It almost feels like a form that captures all windows events but I'm not sure exactly.
fireweed said:
I've written a prototype to do exactly what you are talking about although the one crucial part I am missing is the lock code. Every example or suggestion for locking the screen is very hacky and never feels like a good approach. If anyone has a good solution for locking the screen (especially in managed code) I would be happy to complete what I have started and release it with source so it could be improved upon.
So far, the best locking utility I have seen is PocketShield although I'm not sure what approach was used for locking in that case. It almost feels like a form that captures all windows events but I'm not sure exactly.
Click to expand...
Click to collapse
Maybe the simpliest way to "protect" the screen is to switch it off. I suppose it must be some API to do that ?
Concerning the "locking", I think the simpliest way is to put on focus an empty window (transparent if it can be ).
I'm really happy to know that you're working on an app like that
lpaso said:
Hi,
I recently bought a HTC Touch HD, and I think that the "shutdown-screen-when-you-answer-a-call" function of phones like Diamonds, Touch Pro and HD is the dumbest way to prevent accidental presses on the touch screen.
Our devices have a light sensor, that could be used to switch off the screen if the phone is near the ear (like the phone using an "i" word ) and keep it on when you answer with loudspeaker for example.
The "problem" with this function is that when you're already in a "no-light" environment, the screen lock function doesn't work.
To resolve this issue, I think we could use the G-Sensor. Indeed, if the place has no light, then, the phone cannot detect the proximity of a ear. But when you put the phone next to the ear, you hold it a the vertical...
To make it short, the app should do :
Do nothing in normal use.
When a call arrives :
- it monitors the ambient light
If there's light :
- when you answer the call, if there's light then no more (you stick the phone next to the ear), it switches off the screen and continue to monitor.
- while in call, if there's light again (you want to see some info on the screen for example), it switches on the screen and continue to monitor.
- and so on until you end the call
If there's no light :
- when you answer the call, but let it at the horizontal (you let it on the desk for example), it does nothing
- if you take the phone on the vertical position (you stick the phone next to the ear), it switches the screen off.
- if the phone, during a call, goes from vertical to horizontal of horizontal to vertical, the screen is switches on/of
- and so on until you end the call
Indeed, you could replace the "switch on/off screen" with "lock/unlock screen".
What do you think about ?
I searched the forum for an existing app that could do this, but I didn't find anything.
If there's already an app that do this stuff, I'm truely sorry for this post.
Click to expand...
Click to collapse
I'm looking for this.. If you find a solution send me a PM, I will do the same
Thanks!
We need this app, how does the iphone acheive this?
I think the 'easiest' way to make this app would be to keep the phone doing what it does currently (put the phone on standby when answering a call) then have the light sensor take the phone out of standby when it receives light, (taking it away from your ear)?
Obviously if its dark then we would have to use the power butten as we currently do now or have the Gsensor do it with a twisting motion (vertical to horizontal).
If anyone has an idea how to program this i'm willing to help in any way, the current systems seems so crude on such tech devices!
DB
lpaso said:
Hi,
I searched the forum for an existing app that could do this, but I didn't find anything.
Click to expand...
Click to collapse
There a program, that can help you. Not full, but it can switch off screen, using g-sensor. However its using not vertical aligment of the phone. There are using changing orientation of the phone to decide when phone near the ear.
http://forum.xda-developers.com/showpost.php?p=2622590&postcount=45
I have always wondered why our WM phones don't do what the iphone does...
For the SE Xperia X1, the light sensor is right near the earpiece (along with the little front facing camera), so it would go to virtually 100% darkness when near the ear. I would presume unless you are using the phone also in 100% darkness (which should be pretty rare I would guess) then it would work like the iphone.
I have also been quite annoyed by the fact that after a phonecall, sometimes I found i'm in a note taking program or weather program or something else. It just seems dumb, considering our phone HAVE these lightsensors?!
I think it's a fantastic idea to solve a VERY FRUSTRATING PROBLEM
lpaso said:
no one has an opinion on this idea ? if there's nobody that want / have the time to develop a soft, I understand, but at least please, give me just your opinion
Click to expand...
Click to collapse
I would rank myself this way:
Not a newbie who's just gotten a touchscreen phone and is now discovering the quirks when holding screen to ear,
and not a developer,
but a power-user. I have installed all sorts of XDA-developed features/enhancements for my phone.
But now I have 4 years experience -- starting with the T-Mobile MDA, and its successor, the T-Mobile WING. And despite all of the advancements expected in that time, STILL, I inadvertently end a call, or put it on hold accidentally, ALL THE TIME. Between that and trying to retrieve the phone from my pocket just to answer the damn ringing phone, I would say I have, on the average, a 20% success rate -- and 80% of the time the call is disrupted. And at least once a day my ohone, in my pocket, even when using s2u2, manages to REDIAL my latest conversation, so mcuh so that all my friends say "why don;t you get rid of that phone. It does all these whiz bang things but still can't reliably manage a basic phone call.
My most recent experiment was to call someone, then when they answered, press the s2U2 key to lock the phone screen. Only I came to find out from A_C that this is no good: S2u2 does not have recognition that you're ending the call, thus, since it's in lock-mode, the "END CALL" or Hang-Up hard key does not work.
So by all means, I would even pay for an app that once and for all handles the baseline problems of simply making a phone call. Thanks for making this request.
fireweed, have you contacted A_C, author of s2u2 ?
There may just be perfect synergy between the two of you. His "best of breed" screen-lock app is widely used -- and other developers, like supbro, for example, author of iDialer, have collaborated on small code-bits from A_C to solve some integration problems.
If for any reason you are unfamiliar with A_C, go to his website: www.ac-s2.com -- where his apps are explained, and all link back to XDA.
He's even managed to make the screen lock work, yet, have it selectively overridden when you insert headphone jack -- such that his s2p (slide to play) app opens and allows you to switch music tracks etc while otherwise the screen and buttons are all fully locked...
fireweed said:
I've written a prototype to do exactly what you are talking about although the one crucial part I am missing is the lock code. Every example or suggestion for locking the screen is very hacky and never feels like a good approach. If anyone has a good solution for locking the screen (especially in managed code) I would be happy to complete what I have started and release it with source so it could be improved upon.
So far, the best locking utility I have seen is PocketShield although I'm not sure what approach was used for locking in that case. It almost feels like a form that captures all windows events but I'm not sure exactly.
Click to expand...
Click to collapse
Hi,
After playing a bit with the HD, it appears that HTC DOES use the light sensor for turning the screen off during a call.
Let's do a test :
In a place with plenty light :
- put your mobile with the face up
- call a number (always face up) : the screen will not be switched off until the light sensor detects a loss of luminosity or the timeout set in the registry expires.
So, my conclusion is that HTC already use the light sensor to switch the screen off during a call, but they do it in an absurd way :
- they poll the sensor just to shut down the screen, not to switch it on.
- once the screen has been switched off, they do not longer poll at all.
Do you think it could be a way to "hack" their system to do what we want to do ?
I think HTC does not only switch off the display but goes to standby (phone works independent if you didn't know yet). Your idea is a lot different in terms of programming.
I don't know if it goes to standby : when the screen is switched off during a call, a press on any button switch it on again. In the registry, the key controlling the timeout before the screen is shut off is named "LightSensorToScreenOff" so I think it is just switching off the screen...
lpaso said:
I don't know if it goes to standby : when the screen is switched off during a call, a press on any button switch it on again. In the registry, the key controlling the timeout before the screen is shut off is named "LightSensorToScreenOff" so I think it is just switching off the screen...
Click to expand...
Click to collapse
Well if thats the case, its HALF of what the iphone does... it turns off the screen based on the light sensor going dark suddenly (next to ear) but then fails to turn the screen back on after you move the phone away from your ear...
Anyone know how to enable this?
Interested in having this feature too. Isn't it possible to have the G-Sensor determine when the phone is vertical and shut the screen and then when it is lying flat to turn the screen back on again. Believe that the Iphone does it this way, not with the light sensor.
Hmm... I never had my ear 'navigating' my phone during in-call before....
I never allowed the screen to touch my face anyway, and the speaker is facing the ear canal, when I receive or make calls...
But i do understand that s2u2 can do what you guys might need, it locks the screen during in call.
Hennyb said:
Interested in having this feature too. Isn't it possible to have the G-Sensor determine when the phone is vertical and shut the screen and then when it is lying flat to turn the screen back on again. Believe that the Iphone does it this way, not with the light sensor.
Click to expand...
Click to collapse
I think the Iphone has something called proximity sensor, which senses the distance from the ear to the phone, hence when the phone rest on the outer ear, the phone screen shut off.
Or am I wrong?
Section9 said:
I think the Iphone has something called proximity sensor, which senses the distance from the ear to the phone, hence when the phone rest on the outer ear, the phone screen shut off.
Or am I wrong?
Click to expand...
Click to collapse
No, you're right. It uses an iR sensor to know if there's something near the phone.

[Q] Increasing Screen Rotation Speed

Is it possible to make the screen rotation happen any faster? Using an accelerometer app to view the sensors values, it looks like the values for a rotated screen are produced pretty quickly after a screen rotation takes place. Could the process responsible for detecting this change increase the sample rate of the accelerometer values, resulting in a faster response? Or is the pause due to error prevention, to help eliminate false rotations?
I would like to bring this back to the top, as it is a valid concern for me, as well. There is a full 1.5-second delay for switching orientation. Far too slow.
Thank you,
Andy
Hi,
I just asked this same question in another thread yesterday so I would also like to know. I'm using a Huawei u8100 running android 2.1.
Thanks!

[Q] Android & CCTV / Wake Screen on notification

Hi All,
I've been looking around for some options to help me wake the screen up.
I had 2 ideas one as if the device detected someone in the room (PIR almost) and simply turned on the screen to resume its last action.
or
Everytime a certain app made a notification - again simply turning on the screen and resuming its last action.
Otherwise ideally to trigger a app to load......
Logic behind this for example is use an old tablet as a digital photo frame, but not on all the time. Only when there is motion dected.
Equally, there is some many smart tech like Nest cam's for example, using an old tablet simply as a dsiplay source - when there is motion in the room, wake the screen or when the app makes a notification wake the screen!
Yes there is an argument for and against these things, but I am curious if anyone's got any ideas on apps or ways to make an android device behave like this?!
Anyway thanks all!

Ambient Display edit feature settings - turn touchscreen off

Could anyone help me solving this annoying useless bothering "issue" that activates the touchscreen whenever i use ambient sisplay ? What i mean is that, unlike before ( marshmallow i guess ), when you're using ambient display and a notification pops up or if you take out your phone out of your pocket, if you unavoidable touch the screen, it directs you into the lock screen. I want to disable this thing just like it used to be before. Unfortunately i have almost no start point. Afaik i have to edit some apks, i took a look into firmware-res.apk into values folder for some strings but i couldn't find anything related to ambient display which seems to be attached to doze. If anyone can help by any mean i would be very pleased. Thanks.

rotate the AOD? + what is sunlight-booster?

heya good day!
i am working on reusing this second hand xperia 5 ii as a car dash computer.
getting pretty close. I've managed to rotate apple music and edit it's scaling to be fit for landscape use.
i also need to try and get the always on display rotated.
but i cant seem to find the package or whatever is responsible for the AOD
in setting's it's called ambient display. but even with those search tag's i couldn't find the process..
does anyone know what the package name is for sony's AOD? or perhaps know how to modify the AOD to be usable in landscape?
while searching i did find something interesting. a package called "Sunlight-booster"
i did notice whenever i have my brightness maxed. and i then move the phone into a bright light. the display boosts the brightness.
is there a way to get that extra bit of brightness on the normal brightness slider? or to manually activate the extreme brightness?
since this will be mounted in a car's dash. the sensor might never actually face direct sunlight. while the screen could still be hard to see. so I'd like to make it a tad more sensitive.
Thank you in advance!

Categories

Resources