What is the best way to handle orientation change in Android - screen-orientation

What is the best way to handle orientation change in Android? Is it by adding android:configChanges="orientation|keyboardHidden|screenSize" to the Manifest? By bundling everything in onSavedInstanceState() or by using fragments?

Related

How to check whether another app is using camera in flutter?

I'm trying to create an app which will look for when another app is trying to use camera and override it and choose a pic from gallery and forward it to that app. Can I do that with flutter? If yes then how can I implement it?
No, that does not work. It does not make sense to change the behavior of apps apart from you own.

Detect if device auto orientation mode turned on or off in Flutter

I'm working on this app that uses a video player. In here I use 2 main options to change the orientation of the player, which are the fullscreen button, and the auto rotation feature (changes according to device orientation). For this I'm using 2 libraries,
Auto orientation and
Native device orientation
The functionality works perfectly fine, when the device auto rotation mode is turned on. But it misbehaves when it is turned off. I know how to fix this issue. But can't find a suitable library for this.
So basically what I need is, I want to run a specific set of code on the condition , if the device's auto orientation mode turnes on/off. So are there any flutter libraries available to check the auto rotation status? Basically I need to detect whether it is turned on or off.
Any help would be highly appreciated :)
PS: I didn't add any code, because it's not the code I need help with. Thanks
There is a plugin for this, although it doesn't look like it's been updated in a while:
auto_rotate_get
On Android it uses this:
Settings.System.getInt(activity?.contentResolver, Settings.System.ACCELEROMETER_ROTATION, 0) == 1
I don't think it supports iOS.

Storyboard orientation

I'm creating one iOS app and I'm using Storyboards to create the UIs. App should support iOS5 and above devices
In MainStoryboard_iPhone and MainStoryboard_iPad I have the UIs designed for the portrait mode.
Now I need to design them to work in landscape mode as well.
What is the best way to do that? Do I need to create another storyboard for landscape mode or is there a easier way?
For each UI I have set a background image using Imageview. Is there a image naming convention, when I used for e.g like myimage-Landscape.png it automatically detects the landscape mode image and sets it?
You could go ahead and create a separate storyboard.
However the actual recommended Apple Guidelines would state that this is what Constraints are designed for.
I learnt from this fantastic tutorial:
http://www.raywenderlich.com/50319/beginning-auto-layout-tutorial-in-ios-7-part-2

How can I fix the webpage orientation to Portrait only for iPad and iPhone?

I have developed a web app/website for the iPad but I can not get it stay in a fixed portrait view only.
I do not want it to rotate and work in landscape mode, because of the way the app has been designed.
I've tried various configurations of the viewport settings but that still has not worked.
I'm not very good at JavaScript so a copy paste option would be best or something in CSS/HTML.
Thanks in advance.
Unfortunately, there is no way to explicitly "lock" the orientation of a web-app in Mobile Safari, as you can also see from the link that Alex posted above in the comment:
How do I lock the orientation to portrait mode in a iPhone Web Application?
However, you can have multiple CSS files for different screen orientations. There's a handy JavaScript snippet that you can copy-paste here:
http://www.catswhocode.com/blog/10-useful-code-snippets-to-develop-iphone-friendly-websites
This should at least allow you to design around the rotation without having to use JS but just CSS.

May I handle moving icon of my iPhone application

Is it possible to handle the animation of moving icons in an iPhone application? If so, how?
As far as I know, you cannot. The icon motion animation is generated by iOS based on the still icon, and you have no control of it.
I think without .gif image you can not make animated icon and ios will not support that so you have no control on it.