Virtual buttons not appearing on emulated Android 4.2 system - emulation

I have created an Android 4.2 AVD. For the need of my current project, the main screen orientation is landscape. The software keys option is selected.
The mode is set to xhdpi, like a Galaxy Nexus phone.
As I start the emulator, I see a black stripe on the right where the buttons should appear, but it remains black. Thus, there is no way to trigger a Back action since the emulated physical keys are disabled.
The problem can be fixed by configuring the emulator in portrait mode then rotate it once started; the buttons appear as expected. This causes problems since the window is automatically scaled down to fit on my monitor; I did not find any shortcut to restore 1:1 scaling at runtime, after the rotation is done. This is important since I would like to see pixel-perfect results.
I am using SDK version 21 and platform-tools version 16.0.2, as updated yesterday.

Found the solution myself... this is a workaround that allows getting 1:1 scale and the software buttons working.
Leave the AVD (Galaxy Nexus or cloned from it) on portrait mode.
Run the emulator from the command line, using the -scale 1 option; this is the magic that forces 1:1 pixel perfect ratio even if the window does not fit in screen at startup. By default, automatic downsizing happens to fit the monitor.
Rotate the display using Ctrl+F11 or Ctrl+F12 to get landscape mode.

Related

Android Virtual Keyboard affect screen rotation ( Using Cocos Creator to build )

I using Cocos Creator 3.5.2 for this project.
When I start testing input text field in android phone either in app or web browser, after the virtual keyboard appear and I try rotate screen from landscape to portrait, the keyboard got change but the screen layout dint resize still is landscape but only smaller n at top.
It need to close the keyboard then the screen layout will start resize and this is in app.
Any idea that can cause this happen?
And any solution for it.

how can I get the exactly right size screen emulator in Android Studio?

I'm working with flutter in Android Studio in windows.
I set the screen size 768*1024(ipad mini size) when I create my virtual devices in android studio, but I find the height is smaller than expected. Actually when I call function window.physicalSize it shows that the size is 768*796.
I have gotten the fact that the function only shows the size of the screen that flutter can render.(So the hidden part is about what? bottom navigation bar,including three buttons, back, home, and the other one, or something else, I'm not sure.)
So, the question is how can I get exact size screen I want(768*1024)?

Android Studio start view resolution problem in Ubuntu

I am using Ubuntu 20.04 on an FHD monitor with 1920x1080 resolution but I am getting this type of Android Studio start view. It's not properly adjusting the content within the screen.
If I try to resize the view, I get this.
You should access System Settings -> Display. There you'll see a Resolution drop-down menu. Just click on it and check the resolution you desire, like 1600x900. Then, just click Apply and you should see the changes.
I was having the same issue with my Android-Studio on my Ubuntu 20.04.
I was able to fix it by changing the dpi settings in ~/.Xresources file from 180 to 96.
Xft.dpi: 96
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.autohint: true
Xft.hintstyle: hintfull
Xft.lcdfilter: lcdfilter
Make sure to reboot your machine after the changes.

Tool bars are getting rearranged

I am using VC++ MFC and have the following toolbars in my software.
While working with different screens and software is minimized, if we disconnect the other screen, the toolbars get messed up after restoring the application.
Also that issue occurs, sometimes, when using single screen and change screen resolution or laptop lid is closed and re-open it, most of the cases when application is minimized at time we change anything.
We are not executing any code as such to draw the toolbars every time. While software is starting up, we read the toolbar positions from registry and create toolbars, and while closing application, we read the toolbar current position and save it back to registry.
Please suggest what should I do to fix this..
Thanks...
From the details what i can say is, while you were working on screen of one size the application considering the toolbar co-ordinates in relation to that screen. But when screen changes the old co-ordinates are no more valid as new screen may have different size and that's what causing the issue.

Android Studio 3.3, Layout Preview, Zoom In, Zoom Out and Zoom to Fit Screen buttons not working

When I open an activity layout on Layout Preview, I want to zoom in but when I click to zoom in button nothing happens. Also, zoom out and zoom to fit screen buttons not working.
What I tried:
Updated Android Studio to version 3.3.
Done all Android SDK updates.
Updated NDK.
Clean Project.
Rebuild Project.
Create a new project.
How can I fix this problem?
Edit:
I think I found the solution. If your zoom level on 24%, zoom in and zoom out buttons not working. To fix the bug, lower layout preview window size till zoom level become 23% and lower. After this, zoom buttons starts to work again.
Screenshots:
https://prnt.sc/mgkphw |
https://prnt.sc/mgkpxu
It is a bug in Android Studio; at some zoom levels (e.g 24% or 9% or whatever) the zoom buttons stop working. One fix is to keep changing the 'Device for Preview' type and find the one on which zoom buttons work.
But the best fix that worked for me was to minimize all the tools on the bottom, i.e Run, Logcat, TODO, Terminal, Build and more ... Then the zoom buttons start working. Even you open the tools back again, the zoom will keep working.
Just to verify the solution; re-open one of the bottom tools (e.g Logcat) and click 'Zoom to fit screen (ctl+0)', most likely the zoom buttons will stop working again. Simply minimize the tools again and it's fixed.

Resources