When I run the emulator the screen size is smaller than the device frame as in the image below. It only happens in a computer with a screen resolution of 3840 x 2160
The best way to create a responsive layout is to use ConstraintLayout as the base layout in your UI. ConstraintLayout enables you to specify the position and size of each view according to spatial relationships with other views in the layout. All the views can then move and resize together as the screen size changes.
THis will work for sure
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. Restart Android Studio and that's it, problem solved :)
I have a Dell XPS 13 with a screen resolution of 3200 x 1800 and I had exactly the same problem.
After playing with the settings I found a (temporary) solution in Android Studio:
Navigate to Tools -> Android -> AVD Manager
This way the rendering is made from software and not from the graphics card. It definitely effects the performance but maybe for a test it's ok.
Alternative suggestion: I tested the emulator from Genymotion and it works. It is free for personal users and maybe a good option if you want something faster.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With