How to get Android emulator to rotate its window - android-emulator

The new Android emulator installed with Android Studio Bumblebee has two buttons in its toolbar to rotate the emulated device 90 degrees clockwise or anticlockwise. On the old emulator rotating the device would rotate the emulator's window as well, but on the new one it doesn't.
So if you start the emulator in portrait mode and rotate you get a tiny landscape device image stuck across the middle of the emulator's portrait window, and if you start the emulator in landscape mode and rotate you get a tiny portrait device image stuck up the middle of the emulator's landscape window.
Is there any way to recreate the old behaviour where pressing the rotate buttons would rotate the emulator's window to fit the rotated phone image inside it?
[Running on Linux with kde window system, in case it make any difference]

I think to recreate old behavior with regards to separate emulator window and rotation you may want do the following:
1. Disable the docking and may be open in Window mode to keep emulator window separate from the main IDE as shown below
2. To rotate, Virtual sensors option can be utilized as follows. Steps are marked 1,2,3 & 4. Beware seems the button marked 4 only appears for few seconds.
Also, one can horizontally expand the emulator window pane when device is in landscape position, to get a feel of landscape window like below:
Following blog post can also be helpful in this regard:
https://android-developers.googleblog.com/2020/10/android-studio-41.html
In case important e.g. if options do not appear the same, i'm using Moonlight(Material) theme

Related

When I change the orientation of the device, there is a small black flash on the screen, Flutter

I have a sin up page that works very well, but when I switch to landscape mode, there is a small black flash on the screen that also disappears very early. flutter
I created a sign up page on flutter but when I switch from portrait to landscape mode, I see a black square appear on the screen before it disappears
When change the device orientation (by rotate the device) an black screen is painted in the bounds
what are the cases that can cause this?
I wanted to share my solution which is quite easy compared to my question above. Maybe it will save someone's time.
the black edge that appears when the device pivots (see image) disappeared during the execution of a release (flutter run apk --release).
suddenly everything is going well.

Set a Drawer to portrait even if image goes to landscape

I am using this template to build out an App. First attempt at App building but want to use this for an online exhibition platform for my paintings and photography etc. This is from a Google Flutter demo on Youtube.
https://github.com/MarcinusX/drawer_challenge/blob/master/lib/main.dart
When you run the app in custom guitar drawer mode(set the flip Bool to true ) the Drawer is set to the left side of the screen(portrait mode). I want to use the length of the screen for info and other menu items for the App.
however i need to display the images and paintings in landscape mode.
this is the issue. Is there a way to leave the Drawer as it would be in portrait mode?
ie when the user turns the device to landscape mode, then the Drawer will turn up from the bottom of the screen, and not the left side of the screen as it currently does?
or is there a way to set an image into landscape mode through ratio change that could be done without orientating the device to landscape?
I tried transform.rotate on the image but that means it get renders in portrait mode in landscape orientation. I also tried playing with the Transform.translate but can't work out how to set the Sizebox differently
I am new to this and wish to use the lockdown time to have a place for my work of the last 15 years so can work out how to code the images and place the controls and audio player for the App but if i can get the basic structure set then i can get going with the design.
any help would be great but if need be I will have to design the App around this
....
app in portrait mode
app in landscape mode, want drawer to turn in from bottom of screen not left edge

Run flutter application into iOS virtual device on virtualized OSX

I have some performance problems running my Flutter application inside iOS simulator installed inside a VirtualBox OSx machine. The simulator run and the application is deployed without any problem. But there is lag when the screen has to be redrawn. For example, when I click on a button which opens a modal sheet, the image is stuck, I can unlock it simply dragging the IOs bottom bar of a few pixels. It's difficult to test the application since every time I have to move that bar a few pixels in order to update the phone image. This is an example of my problem:
As you can see the image is redrawn just after I click and move the iOS bottom bar.
Here a simulation of a native iOS app:
Here as you can see the screen has to redraw, I don't need to move the bottom bar.
Any suggestion?

Unity Standalone App: Resolution Scaling Issue (OSX)

I have developed a Mac-OSX standalone app in Unity3D (Scale with Resolution: 1920x1080). Most of the time I present the app on my laptop, connected to an external screen, which works pretty well.
But when I'm on the road and use the app on my laptop screen (1440x900), the UI's are all over the place...
I know, BUT is there a way to run the app in a 16:9 ratio (with black bars on the top and bottom), the same as I can do it in the Unity3D editor?
I don't want to go back and re-scale everything to a lower resolution, as this would be a crazy job :(
Is there any solution without re-doing it?
Cheers
Thanks, but sadly this didn't work for me. The problem is my Reference Resolution in the Canvas Scaler is already set to 1920x1080. To fix this, I have to lower the reference, but this means re-doing all the UI's.
However, I found a workaround, which is strange but working. I have set the Default Screen Resolution in Unity to 1920x1080 as in the image/link below.
Now the strange part :)
1. Start the app with the option key on an HD screen and set the resolution to 1920x1080.
2. Save and Quit
3. Now the app is scaled down to 16:9 and keeps everything in place.
This works as long as you don't start this app or any other Unity build, with the option key on a lower resolution screen. In this case it will scale everything back again. You can redo the steps 1-3 and it will work again.
Not sure if there is another way to do this, but at least I have kind of a solution.
Default Screen Resolution in Unity to 1920x1080
There are two things you should check; 'Resolution and Presentation' under 'Player Settings', and canvas scalers. I have being in a situation similar to yours, I had built an iOS application meant for the vertical orientation, but also wanted to test it on macOS, the application launched correctly in fullscreen mode looking like this (The top status bar was intentionally brought down to show the aspect ratio):
Instead of using black bars on the sides, it seems like that Unity simply used the colour of the canvas of the current scene to fill in the gaps. This was my settings to get this result:
Only the 16:10 ratio (MacBook Pro) was checked, but the application functions in the iPhone's vertical ratio, I did not have to manually rescale the canvas,I simply switched the build platform, this was allowed by the canvas scalers I have added onto every canvas with the following setting (UI Scale mode: Scale with screen size | Screen match mode: expand), this would allow the canvas to expand automatically and scale to any aspect ratio, without messing up the UI:
Hope this Helps!

Landscape mode not working with no keyboard in AVD?

I've created two AVDs, one with hardware keyboard, and other without..the one with keyboard shows the landscape mode in the android screen when I click CTRL + F11/F12 or 7/9 on numpad, but in the AVD with no hardware keyboard, the hardware things all change orientation, like the first AVD, but the android screen stays and doesn't change orientation to landscape, like this: http://img571.imageshack.us/img571/3624/landscapeh.jpg
This is a bug in the 2.3 AVD and it is already answered here
Android - Emulator in landscape mode, screen does not rotate
Run 'Android SDK and AVD Manager'
Select AVD
Edit
check Keyboard lid support
if value is no, set to yes.
Run AVD and try
Good luck!!
I had the same problem with an API 19 (Android 4.4.2). I had wanted to only support running in Landscape mode. Despite setting Orientation to Portrait when editing the device (under Startup size and orientation), the device would always start Portrait.
I ended up manually switching the width and height in the hardware-qemui.ini file.
So, edit this file in a text editor:
C:\Users\<user>\.android\avd\<deviceName>.avd\hardware-qemu.ini
Switch the values of the width and height, so that the width is longer than the height:
hw.lcd.width = 800
hw.lcd.height = 480
The AVD now boots in Landscape mode. The orientation may still be changed with shortcut keys.