4k display & Android emulator: fail - android

I'm moving to my new laptop which has 4k screen (3840x2160, to be exact). As my OS of choice I have Linux, and all scaling I have set up for this is done via Gnome (scaling-factor in gnome tweaks is set to 2). Overall, setup looks perfect, except for Android AVD run in IntelliJ IDEA.
AVD is configured to use skin with 1920x1080 dimensions, and I've expected that it would be roughly the height of the screen, however for some reason AVD is scaled up, which obviously looks.. weird and unusable.
I've took a look at relevant questions here about scaling the emulator, but it seems that IntelliJ interface has changed, as there is no Emulator tab in Edit Configurations menu (and answers to questions I've seen said to use that option to downscale the emulator). So, question is: how do I scale it down (or, to put more correctly, how do I disable the scaling for emulator)?

Ok, I've found out what the issue was. UI scaling is handled by Qt in case of android emulator. It was set to: QT_DEVICE_PIXEL_RATIO=2 somewhere in my configs. This made emulator act weird. Cheers!

Just delete the environment variable and restart Android Studio to get the new env variables.

Related

Android Studio Emulator Screen Flickers

I have a new laptop with configuration: -
List item
Windows 11 latest build
Ryzen 7 5800H
16GB DDR4 RAM
RTX 3060 Ti Mobile GPU
Latest Android Studio
Latest Android Emulator
I have tried reinstalling the android studio and its emulators but its the same issue. Is this related to the presence of AMD processor ?
I have some ongoing projects which are halted and would like the get this problem fix as soon as possiable.
I have to develop some flutter applications
Emulator Screen Image Here
Emulator Screen Image 2 Here
I think you can resolve this problem changing the render options to ones that best suit your system, test diffent values to find out what is best for you.
To reach this screen click on the 3 dots at the side of your emulator and then: Settings -> Advanced
Edit: I have used an computer with a Risen 5700G and a RTX3050 with no flickers, so It's probably a configuration issue, also check if you have virtualization enabled on your bios, it'll depend on the manifacturer of your motherboard so I can't provide clear guide on how to enable it on your system, if needed.
try to delete the current Emulator from .android/avd and install another one such as pixel 4 or pixel 3
It also works if you put the emulator in floating mode. At least it helped for me, and many others with similar problem. On he photos I only see that you have unpinned it, but not set it to "float".
Go to settings, view mode and then float:
I hope it helps, cheers!

Android Emulator screen is corrupt and stretched

I have been trying to get android emulator to work in a GCloud server instance with Ubuntu 18 installed, with KVM and virtualization settings are all done properly.
Because the server does not have an actual gpu, I am using -gpu swiftshader_indirect and forcing it to use software based rendering mode, i.e cpu instead of gpu.
Right after the emulator boots up, the view is in green and pinkish colors with overly stretched resolution. This both looks bad and prevents me to use it, please see the attached image below.
Please see the image of the problem
I had also had problems to get a proper view of the whole Ubuntu Desktop UI with using VNC Viewer, and kinda hacked some startup config file to get things proper (not sure If I did everything correct), could this be related to it all? Apart from the emulator screen, I have no problems elsewhere on the system UI though

Android emulator screen fills up only some fraction part of actual android emulator screen

First thing first,
Using Android Studio 2.3.3
Problem:
My emulator screen is covering the only partial amount of screen available for emulator, i.e top left of the emulator and rest part is just a black screen.
See the pic I have attached.
Things I tried:
1) Restarting emulator
2) trying different emulator
3) changing pixels, density of emulator device,
4) run -> edit configuration ..blah blah blah...
Nothing helped!!
Note:
My issue is not emulator's size but effective screen size.
please help if somebody could have come across this issue :(
IMPORTANT EDIT: I guess, this issue has something to do with the laptop I am using, DELL Latitude, touch screen (14-inch QHD touch display (2,560×1,440 resolution).
Because the same emulator works properly in other display laptops.
*Software rendering is very slow to be usable
Better Fix
You can fix the scaling issue when using the Hardware rendering by simply making windows override the scaling setting. How?, it's very easy.
Simply locate the .exe file for the emulator that you are using, (e.g. "qemu-system-armel.exe" for ARM and "qemu-system-x86_64.exe" for x86).
To make sure which .exe file, just run the emulator then use task manager to locate the .exe file is running, see the screenshot.
locate the .exe file using task manager
In my case it was in this location:
"C:\Users[Username]\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe"
Now just right click on the file then click on properties then choose the "Compatibility" tab. Under "Settings" at the bottom, click on "Change high DPI settings".
A new window will open. Tick the last checkbox "Override high DPI scaling behavior." under "High DPI scaling override".
Then select from the drop down below it "System" (this is very important or it will not make any difference!), see the screenshot below. Now just hit OK and OK. And that's it, problem solved :)
I was having the same problem too. I think it started happening when I updated to Android Studio 3.0 Beta 1, but I'm not 100% sure of that.
FIX:
Anyway, to fix this, you can use Software Graphics in the emulator options, rather than Hardware. Slower, but at least it works.
I have this similar issue. It happened after using an external monitor that has lower resolution (1440 x 900) than my laptop (2160 x 1440) has. There are couple of ways you can fix it until Google fix the issue.
if you match your PC's resolution to your external monitor's resolution. Then you can return back to your PC's resolution.
If you lower the scaling of your PC ( mine was 150% > 125% or 100%) from Display Settings. Run the emulator. Again, you can return back to your original scaling, emulator screen won't change. This is the one I prefer.
Note: this is not a permanent solution. You may need to change scaling/resolution again if you change your scaling or resolution to the one you had issue with. I have tested this only on Windows 10 Pro, but this approach might work on Mac as well.
I am running Archlinux and I had exactly the same problem because I have $QT_SCALE_FACTOR set to 2 by default. Setting it back to 1 for the emulator fixed the problem:
env QT_SCALE_FACTOR=1 Android/Sdk/emulator/emulator -avd api25
Open the Emulator and press Ctrl+Up_Key to increase the scale and Ctrl+Down_Key to scale down. (Cmd+KUp / Cmd+KDown if you are on mac)
Try this and hopefully it works for you -
Go to Tools in Android Studio and open AVD Manager
It will open all your virtual devices. Click on the Virtual device you want to edit and click the Pencil icon which will enable you to edit the device.
Click on Change where it lists the device name. For example, for me my device name is Nexus 5X and lists the resolution of the device.
In the Select a Device screen, click on New Hardware Profile and change the resolution to 1080 x 1920 px.
Save the changes and run it again. If it still doesn't work, change the skin of the device.
If still doesn't work, then make a new hardware profile with a new device.
Have you already tried other emulator? I suggest Try bluestacks
go the tab Emulator (next to the General tab), and in Additional command line options, write
-scale 100.X
Press alt + space + M
Pls. see landscape also and revert back to portrait
This looks like an incompatibility with windows scaling.
Try setting scale to 100% in display settings of Windows (right click on desktop).
In case someone ran into this issue on Linux, here is a fix:
QT_AUTO_SCREEN_SCALE_FACTOR=0 emulator -avd <Name of your virtual device>
I ran into this issue a while ago and have been struggling for it until now.
Solution seems to be:
Go to C:\Users\YourUser\AppData\Local\Android\Sdk\emulator
Here, right click on emulator.exe, click Properties and go to Compatibility. Here, check: "Override high DPI scaling behavior. Scaling performed by: APPLICATION".
This should fix the issue on any Windows 10 machine with display scaling activated.
Just go to display setting and change it to 100%.this normally happens if you have a fourteen inch laptop and below
Best and simplest way to do it on Windows 10:
Close your Android Emulator if it is open
Right-click desktop
Click Display Settings
Set Scale and layout to 100%
Open Android Emulator
Revert your Scale and layout to the (Recommended) percentage

Why does the Skin in my AVD not show the contol/keyboard/menu section?

How can I build a standard ADV to test my Hello World app. I've just built my Hello World app on Android - using eclipse, and am having real problems getting the AVD to work properly. My setup Android 3.1 level 12, and I set the skin to 800 x 600 as the default WXGA, seem to make a massive screen. When it loads, I get just the Android screen but no side keyboard.
In addition, why do I get completely different looking skins when I play around with the skin size. Sometimes, I get a nice sea scape sometimes, but its portrait not landscape - how do I turn it? One time I get a lock?
Any help would be really appreciated. (I using Java 1.6 64 bit).
Thank you very much.
Ed Ryan
My setup Android 3.1 level 12, and I set the skin to 800 x 600 as the default WXGA, seem to make a massive screen.
Use the scale option when launching the emulator to resize it to something manageable. There are no 800x600 Honeycomb devices, so you are far better served using WXGA.
When it loads, I get just the Android screen but no side keyboard.
Correct. You won't get the side keyboard for WXGA, either. You do not need it, as everything on that side keyboard is available to you from your own physical keyboard on your development machine.
The skins are only available for the out-of-the-box skins or the ones you create manually (see here). However, you can access all of the keys using other keyboard shortcuts, which I personally found way more convenient. Plus, you save space.

Small font size in Android emulator

Sometimes I notice the Android emulator starts with a very small font size. This seems to happen randomly. Other times it has a normal font size.
I use ADT 10.0.1.
Do you know what is the problem?
This happens very often, and although I'm not sure about the exact reason behind this, it seems that somehow the wrong density was detected for this and resources for a lower dpi is loaded inside a higher dpi emulator. That's why everything is smaller, but the layout works properly and aligns things at their own places. And you're right: when this happens, network doesn't work in emulator! These two things seem unrelated, but my guess is that emulator fails at loading config for the current virtual machine successfully, and that includes density and network capabilities.
Anyways, there doesn't seem to be any official info on this, and similar reports in android-developers mailing list didn't get any response for developers of Android, although this is a very popular bug.
And the solution right now is only restarting the emulator. Sometimes you have to do this more than once, but finally it works.
Make sure your computer's display resolution can satisfy your emulator's exact resolution. If you are using Mac with Retina Display, this problem may occur. Try changing display resolution via Display settings.

Categories

Resources