Lock screen rotation for **ALL** Android Apps on a device - android

this is my first post so please correct me if I do any mistake regarding rules :-)
Heres my problem:
I am trying to set a fixed screen rotation for all Apps on an Android device
(not just my App). I searched a lot but found only solutions for single Apps.
I had the following Ideas:
1) Use the API ==> seems not possible
2) Change accelerometer values ==> seems not possible
3) virtually open a hardware keyboard ==> seems not possible
Turning off autorotation keeps all Apps in portrait mode, but I would like all
Apps to be in landscape mode.
Can anybody help me please?

At least for Android 4.2. (Nexus 7) you can hold device in landscape mode and then disable autorotation. Afterwards all apps work in landscape mode.

Related

setRequestedOrientation changes the global system orientation preference

good evening people.
Simple question
why
mActivity.setRequestedOrientation(force ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
turns 'auto rotate' from device's quick settings icon ON ?
seems like setRequestedOrientation() globally changes system preference regardless activity which called setRequestedOrientation is running or not.
I bet its some additional "feature" or behavior of your Android version modified by manufacturer. check on some other device from different manufacturer or at least different Android version. you can also try to use emulator
I have some old tablet with clean Android version, which have broken gyro/accelerometer, works only for few hours after device reset. so I've disabled auto-rotate and set fixed horizontal orientation on it. still when I run my app with similar code to yours forcing portrait mode then it will show in portrait mode as intended, but when I exit my app then whole interface/previous app runs in horizontal - still no auto-rotate option enabled

Android emulator will not rotate

The shortcuts for putting the Android emulator into landscape view do not work for me. Searching through related questions I see a lot of information about an old bug where the emulator would change orientations, but the rotation event would not be triggered. However, this is different, my emulator won't even change orientation (the keyboard shortcuts do nothing).
Attempting to turn off the portrait orientation in the emulator manager also does nothing, nor do any of the QEMU options relating to the display size (eg. I can't start it in fullscreen or change the geometry of the display at all).
This happens with both a 4.4 image or a 5.0 image. Keyoard support is on and works in general.
Is this a known issue, or is there some trick to getting newer versions of the Android Emulator to change orientation at all?

Screen rotation not working as intended on some devices

This issue seems to occur on some Android devices, notably the Kindle Fire. I'm currently developping an app that runs in Landscape Right and Landscape Left modes, but it seems on some Android devices it starts up on one side then cannot be rotated afterwards.
I'm using Unity 4.3.4f, and my settings are set to support both landscape modes and is set on Auto-Rotation.
Also, I've made sure the problem isn't about the auto-rotation being locked on my device, so it must be something related to my app settings.
Any reason this works on some devices and not on others ?
Note : This issue doesn't occur on iOS devices.
UPDATE : This issue occurs only sometimes on some devices. Sometimes rotation will work fine, other times it just will stay stuck in one direction. Same build, upon killing the app and restarting it may work. Kinda confused as to why this is happening !
Check if in this devices you dont have the rotation blocked in settings.

Air Android app crashes when phone changes orientation

... or at various settings in the app xml (<appName>-app.xml or application.xml) when holding the phone in Portrait-orientation instead of landscape-orientation.
Depending on various settings our testphone, Samsung Galaxy s3, crashes right at launch when we do debug on the phone in FlashDevelop. Actually we are debugging with a release so we don't get any traces, but all the same we are running the app on the phone.
For instance if we set
<aspectRatio>landscape</aspectRatio>
<autoOrients>true</autoOrients>
and hold the phone in landscape orientation when we start the debug, then the app runs as should be.
However if we with the same settings hold the phone in portrait orientation when starting the debug, then the app crashes on startup.
The exact same happens if we set auto orient to false and/or remove the Aspect Ratio.
It also doesn't matter what we set stage.scaleMode to in my Main class... or at least i've not been able to figure out any combo with aspectRatio/autoOrients/ that works.
I read something at a glance here at Stack Overflow in another thread about something that seemed similar was a bug in earlier Android versions, but that it should be fixed in ICS (which we have on the test devices).
And I may also have seen something at a glance about it being related to the virtual keyboard and to add some code in the xml Manifest at various actions..
Does anyone have a clue for sure please? :-)
edit:
The App is built to only ever be shown in Landscape orientation. It can't work in portrait.
I have also encountered same problem; app crashes everytime orientation changes. What I did was very simple:
FIRST, create two folders for your layout:
layout
layout-land
Then, put your portait layouts in layout and landscape layouts in layout-land.
This will do the trick. Hope you can get idea from my experience.

why does the gingerbread emulator orientation get stuck in apps?

At first I thought this was a problem with my app, but it seems to be happening in any app (though interestingly, not the home screen) in the gingerbread emulator.
To replicate my issue, open eclipse and fire up the android emulator for gingerbread (I'm using the "Google APIs - API Level 9" as my target)
So the procedure to duplicate once the emulator loads is
press LCtrl-F11 to shift orientation to landscape, then again to switch to portrait
Result:
In the homescreen:
The view rotates to landscape, and then back to portrait, as expected
In any app (i've tried browser, calculator, maps, and the app i'm currently working on):
the view rotates to landscape, and then nothing, it stays in landscape even the emulator is displaying the phone in landscape mode (see below)
Has anyone else had this issue, or have I installed the emulator in some incorrect way - this hasn't been an issue with any of the previous emulators
This is a bug with the Android emulator running 2.3.x. Bug is already acknowledged here
Actually, I have run into that problem occasionally before, though it does seem to get progressively worse with each passing tools release. There is nothing wrong with your installation or how you are using the program, AFAIK. You might try using Ctrl-F12 to switch back rather than Ctrl-F11 and see if that improves matters. I think the problem may stem from the emulator trying to emulate four-way orientation, but that is just a guess.
I just got stuck with the same problem in my own application. The app always stays in lanscape mode after using the camera. The only workaround I found is to click on the home button (emulator changes to portrait mode) and then click again on my application to get back to it also in portrait mode.
Did anybody report that bug already?
(Gingerbread emulator, Eclipse 3.5.x, Android Development Tools 8.0.1.v201012062107-82219)

Categories

Resources