I have developed an application that runs images and videos (with a default application to display them) for a certain time period.
However I want to run all these images and videos only in a landscape view. I want to lock this, irrespective of rotation settings. If possible, I would also like make it to only portrait view in future. Please advise.
It is not possible to change device orientation programmatically, you can redirect user to those setting but not possible to change from app side. e.g you can redirect user to GPS setting screen but not set it from app. Same concept apply for rotation as well.
Related
Does anybody know if there is a generic way to check if the screen is currently being presented, e.g. via Miracast, Chromecast or any other app?
My app runs in the background and shows notifications every now and then. I'd like to avoid that while the screen is visible to others.
I am developing a mobile app with Delphi XE5, Android platform.
I need one form in my mobile FireMonkey app to keep it's set orientation and not change when device is turned. Other forms however can change orientation when device is turned.
How can I accomplish this?
Delphi XE5 does not provide any setting on the form to do this, and one cannot make one form never rotate whilst others do. You can perhaps create a work-around solution but a lot of testing would be required to ensure it works on all devices. Probably not a good idea.
The FormPaint event is fired after the form repaints (when rotation is changed and other actions). The form Height & Width will give you the current size and if you have a list of devices form sizes you could work out whether the form is currently in portrait / landscape mode. You cannot force the form to another orientation, but you can hide controls and display a message.
Not easy and possibly not worth the effort.
I have a project requirement to create a kiosk based application which will always be in the landscape mode,for which I am making use of a tablet running on 4.2.2.One of the modules has the functionality to make phone calls.For making the calls from my app, I invoke the default android dialer app.However,I notice that even if my device is physically in the landscape mode,at times when the default dialer app is called,it first displays its portrait layout and the quickly switches to the landscape one(which is not visually appealing).Now,since I do not have access to modify the source code of the default dialer app,I was wondering if there is a way that I can specify a system level screen orientation as landscape ?
PS: I have root access for my tablet.
Any help would be appreciated.Many thanks !
There's an app for that: Rotation Locker
You can also add the switch ro.sf.hwrotation 90 in your build.prop file
I have a question on the control of android device's screen on.
What I want to implement on android framework is that:
depend on specific application, I can control the screen to be on or not.
That is to say, if I don't want some application, let's say the AngerBirds, to make the
screen from state off to on, can I do it?
From the source code of PowerManagerService.java:
I found there is one line of code:
`policy.screenTurningOn(mScreenOnListener);`
so, is this the code to turn on the screen?
Then if I add some condition here, such as, if the current command of turnning on the screen is from
the application AngryBird, then I just ignore, and make the screen keep state off.
is this possible?
If possible, then can I get the Application context and the reason of turnning on the screen?
I want to zoom in out on any screen including home screen or any other app screen.I have tried to change Screen resolution by changing lcd_density in build.prop file by rooting device but it requires rebooting of device.Can't it be done just like iphone where text/screen zooming can be done at runtime without rebooting.
This is an accessibility thing, most Android have a setting for this under settings>accessibility
If you search around on the web it should be there.
I have seen some rooted devices that let you change the default text size can't remember what the app was called though sorry.