Is android app by default support both orientation? - android

I'm not developer. I'm wondering when design an android app, by default, is both orientation portrait and landscape supported?
Only when specifically required, then developer can set it locked to portrait mode only.
The reason I'm asking this, developer request to have such statement mentioned in the spec.
As a analyst, I supposed if not mentioned specifically, then the app just follow device setting.
When device is set to auto rotate, then app rotate as it.

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

Disallow multi-window (split-screen) without setting `android:resizeableActivity` in the manifest

We are an OEM working with an external app developer. The app they have written locks to portrait with android:screenOrientation="portrait" in its manifest. It also disallows resizing with android:resizeableActivity="false".
Our device is designed for use in vehicles and as such operates as a vehicle control head. It does not support portrait mode; any apps that request it are resized to allow landscape display. Because of the aforementioned attributes in the manifest, the app always displays in screen compatibility mode, with the UI squashed in the centre of the screen.
We've tried a number of different solutions. We tried setting the orientation programmatically instead of the in the manifest, but this causes an initial rotation on some handset devices that the app already supports, and which was deemed unacceptable by their QA team. They maintain that the attributes in their manifest mentioned above MUST NOT be removed.
Has anyone been in this situation? Are there any fixes on the application side that we've missed? Would they have to revise their decision to statically disallow resizing?

Android preconfigure lock to portrait on phone and allow landscape on tablet

I am aware of configuration change in manifest. I am also aware of this answer from 2013.
My question is, can this be done using Gradle rather than having to use code in runtime?

Set system level default screen orientation for an android device

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

sensorLandscape and handling configuration changes

I have a game activity which was previously declared as "landscape" in AndroidManifest.xml.
I experimented with using "sensorLandscape" in order to support the reverse landscape mode, and I expected the activity to be recreated each time I rotate it - like the switch from portrait to landscape.
To my surprise, the activity just rotated without recreation (tested on Nexus 4, stock Android ROM).
The question is - can I count on this behavior? Or am I supposed to add code to handle configuration changes just because I support reverse landscape? It looks like I don't need to do anything, but who knows what devices I might encounter... Writing the state saving code might be really time consuming in my project, that's why I'm concerned whether it's even needed.
Interesting question. Here's what I found here:
Note: When you declare one of the landscape or portrait values, it is considered a hard requirement for the orientation in which the activity runs. As such, the value you declare enables filtering by services such as Google Play so your application is available only to devices that support the orientation required by your activities. For example, if you declare either "landscape", "reverseLandscape", or "sensorLandscape", then your application will be available only to devices that support landscape orientation. However, you should also explicitly declare that your application requires either portrait or landscape orientation with the element. For example, . This is purely a filtering behavior provided by Google Play (and other services that support it) and the platform itself does not control whether your app can be installed when a device supports only certain orientations.
In general - the sensorLandscape is not re-creating the Activity.

Categories

Resources