Launch Android emulator in landscape orientation - android

Is there any way to tell Eclipse to launch the Android Emulator (4.1.2) in landscape mode?
My reason for asking is that changing the orientation (using one of the keyboard shortcuts) after starting the emulator does not seem to affect the home and other system screens, although it works fine with apps.
I am aware of the -skin command line option, but it has been deprecated.
I suppose that I could also create a custom device in Android Virtual Device Manager but I'd rather use the Nexus 7 preset.

Try:
ctrl+fn+F11 in Mac to change the landscape to portrait and vice versa.
left-ctrl+F11 in Windows 7.
ctrl+F11 in Linux.

This can be achieved by creating a new AVD using custom resolution.
Simply fire up the AVD manager, create new AVD, choose your target and tick the resolution and add a resolution fit for landscape, like 480 x 640.

This is a known bug when using the 4.4 emulator. You can rotate the emulator using the ctrl+F11 shortcuts mentioned above, or using the 9 key on your keypad.
Once you have the emulator in landscape, open the camera app in the emulator, which will rearrange all the controls to where they should be in landscape mode. You can then launch your app from eclipse/android studio and it will properly appear in landscape mode.

Instead of creating a new AVD you can use the current AVD you're using and just Edit it (from AVD manager) and then you can change the option of "Orientation" between Portrait and Landscape.

Related

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

Odroid-XU4 Android full-screen portrait orientation

I want to install an Android OS to an Odroid-XU4 device and connect it to a vertical touchscreen through HDMI. I want the content be displayed as portrait and fit the screen.
I installed 4.4.4, 6.0 (Cyanogenmod 13.0) and 7.1(Lineage 14.1) android images to the Odroid. By default, all of them display the screen as landscape , so I must configure the OS to get it displayed as portrait.
I first used AndroidUtility (a tool included in the OS image) and set HDMI orientation as portrait. The screen is displayed great (portrait and full screen) with the 4.4.4 OS image. Unfortunately, 4.4.4 OS doesn't work for me because the device has to be a COSU and this needs 6.0 or above OS version.
But using AndroidUtility , the screen is displayed like this in both 6.0 and 7.1 OSs:
After looking it over forums, blogs... I found out that the solution should be editting these lines in OS build.prop config file:
persist.demo.hdmirotation=portrait
ro.sf.hwrotation=270 (I have tried 90 too)
windowsmgr.support_rotation_270=true
Doing this, 7.1 OS version looks as portait and fills all the screen... but it's displayed upside down.
And 6.0 OS version looks not only turned, but also cropped:
How can I get it displayed as portrait and full-screen?
I had this same issue using LineageOS from here
(Source)
I ran the update to the most recent release from the ODROID Utility and it changed the "HDMI Landscape / HDMI Portrait 90+270" to a straight 0, 90, 180, 270. To change it required a reboot.
(Fetched)
All Android devices manages the screen sizes in the same way, so that has nothing to do with your android odroid, unless you have forced to be in landscape, and your monitor source is with a portrait orientation.
You just need to adjust your screen display monitor source orientation usually is using your screen menu, `
Menu->Display->(Horizontal or Vertical)

Changing Android Emulator Size to fit on my Screen

this may be a stupid question, but I've been doing Android Development for quite some time but just installed the new version of the SDK and ADT Eclipse plugin.
I've noticed that when I create a new AVD I can choose a specific device, I.e. Nexus 7 or Nexus Phone. I've selected the Galaxy Nexus but the emulator doesn't fit on the screen so I can't see the bottom of the device. At the moment I'm working on my Desktop which has a 21 inch monitor (1600 x 900) not the most highest spec in the world but I want to be able to fit the device on the screen. I also have a secondary screen which I usually keep the emulator on so I can see the code and the emulator, handy for debugging purposes, but this screen is much smaller and only has a resolution of 1280 x 800. At the moment, it would be impossible to press on the back and home buttons, and if I do development on my laptop, which is obviously a much smaller screen, probably wouldn't be able to see most of the device, as the AVD doesn't seem to scale to fit the screen.
Is there a way that this can be done. Below is a screen shot of how the device looks on my screen.
Right click your project -> Run Configuration -> select target -> in additional emulator command line option text box, type '-scale 0.75' and run your app
For those using Ionic CLI or other solutions, the following worked for me:
ionic run android -scale=0.75
In Android Studio, the option is set in the AVD Manager, under "Startup size and orientation".

Orientation change ignored in Android AVD

I set up the Android SDK in Eclipse on Linux and I am trying some AVDs. I have created a 2.3.3 (API 10) device and a 4.1 (API 16) device. Both use the default values provided in the dialog box for creation.
When I run the 2.3.3 AVD and press ctrl + F11 to change orientation, the orientation of the screen changes from portrait to landscape and the keyboard moves below the screen BUT all activities (mine as well as the standard apps) continue to be drawn in portrait mode. The configuration change does not seem to be registered and handled.
The 4.1 AVD works as expected: the screen orientation changes and the running Activities are terminated and redrawn in layout-land.
Is this a bug or a configuration issue that I can fix?
Yes it's a bug: Issue 13189: Orientation does not change from landscape to portrait on Emulator on 2.3 It's was fixed for AVD images post 2.3.3, but it seems the fix was never backported to 2.3.x
The work around is to add Keyboard support as a hardware property to Gingerbread AVDs, though as noted in the bug report, this isn't perfect.

How to add emulator for tablet(7inch,800x480) in Eclipse?

Today is my first day with Android.
My need is very specific. I want to develop a application for a 7inch tablet with resolution 800x480.
Though I was able to add Emulator for Samsung Galaxy tab, its resolution is different, that the reason that's not helping me that much.
Can any body please help me.
You have to open Window > AVD Manager, create a New emulator, name it and set the screen size, heap size and android version.
I should add that you should then go to Run > Run Configurations and set your current project to run with the new emulator.
see yellow color highlighted box to specify target device resolution on avd on time of creation of avd.
To change orientation you have to use Ctrl + f12

Categories

Resources