Change Screen Orientation - Android 3.2 on VirtualBox - android

I am running android 3.2 RC2 eeepc on Virtual Box.
The OS assumes it a tablet and sets the orientation to landscape by delfault.
How can I manually change the orientation between landscape and portrait?
Is there a way to do this through the commandline in the android OS?
Is there a shortcut key like the emulator from AVD Manager?
I tried Numlock off 7 and Ctrl F11. No use. Kindly help
I use the VM to run an app that I am currently building.
My app has many views and most are set to work in both portrait and landscape.
One view is strictly set to portrait. When I launch this, the entire OS turns to portrait.
How to revert to landscape mode?

download apps like "Set Orientation" so u can set it as potrait, lanscape or automatic

Sadly, VBox is really bad at handling screen orientation. There is no shortcut to change screen orientation on the go I'm afraid. However, there are ways to force the screen into one orientation always. This is however probably not what you were looking for.
You could however try going with BuilDroid - which is a type of addon for VBox to try and support Android as best as possible. It makes sure that screens are "managed". I have no experience with BuilDroid myself, but it could have what you're looking for.
Try it out! You can find it here: http://www.buildroid.org/blog/?page_id=121
Alternatively, there's a blog post giving information on how to change the orientation permanently, as I mentioned before, here: http://davematthew.blogspot.com/2011/09/app-development-with-android-x86-on.html
I have no idea if that helps you either though! But I hope one of these answers your question.
EDIT: The problem seems to have been solved by apps such as the one user2835272 referred to. I have not tried the app personally, but trying "Set Orientation" might be a proper solution for the problem now. Even better, if F9 - F12 works now, that is the functionality that should be used. Again, I haven't played around with VM Android for a while, so I cannot confirm this.

Try just using F9 or F11. It worked for me.

I encountered this problem when trying to run QQ on Android 4.4 running in VirtualBox. F9-F12 were ineffective as soon as QQ started. The app "Ultimate Rotation Control" does the trick but does not resize the QQ window. So part of it gets to lie out of the virtual screen. Finally, I ended up redefining the screen size of the virtual Android to 360x640 (portrait) as described here. It seems that QQ detects which side of the screen is longer and rotates according to this. So if you start with a portrait aspect ratio it will not rotate sideways. I do not about other apps, but guess they operate the same way.

If you are trying to set the display to a portrait resolution. There is one way to set the resolution manually in VBox
I set it to 600x800 successfully in Android x86 4.4.
So basically do the following:
VBoxManage setextradata "Android" "CustomVideoMode1" "360x640x16"
Start Android in VBox in Debug mode
At the Linux prompt, enter the following commands:
mkdir /boot
mount /dev/sda1 /boot
vi /boot/grub/menu.lst
Find the line with tile like "Android-x86 4.4", add "UVESA_MODE=360x640" (replace 360x640 with your resolution) at the end of the line
Save the file.
Clean up and then restart the VM.
umount /boot
rmdir /boot
reboot –f

For those who want to change the screen orientation on Windows.
To run VB on the full-screen mode on a vertical screen, select different sizes and scales from view>>virtual screen x>>resize to ../scale to xx%. After trying different combinations you will find the right settings for you.

Related

setRequestedOrientation changes the global system orientation preference

good evening people.
Simple question
why
mActivity.setRequestedOrientation(force ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
turns 'auto rotate' from device's quick settings icon ON ?
seems like setRequestedOrientation() globally changes system preference regardless activity which called setRequestedOrientation is running or not.
I bet its some additional "feature" or behavior of your Android version modified by manufacturer. check on some other device from different manufacturer or at least different Android version. you can also try to use emulator
I have some old tablet with clean Android version, which have broken gyro/accelerometer, works only for few hours after device reset. so I've disabled auto-rotate and set fixed horizontal orientation on it. still when I run my app with similar code to yours forcing portrait mode then it will show in portrait mode as intended, but when I exit my app then whole interface/previous app runs in horizontal - still no auto-rotate option enabled

Android emulator will not rotate

The shortcuts for putting the Android emulator into landscape view do not work for me. Searching through related questions I see a lot of information about an old bug where the emulator would change orientations, but the rotation event would not be triggered. However, this is different, my emulator won't even change orientation (the keyboard shortcuts do nothing).
Attempting to turn off the portrait orientation in the emulator manager also does nothing, nor do any of the QEMU options relating to the display size (eg. I can't start it in fullscreen or change the geometry of the display at all).
This happens with both a 4.4 image or a 5.0 image. Keyoard support is on and works in general.
Is this a known issue, or is there some trick to getting newer versions of the Android Emulator to change orientation at all?

Android emulator not rotating to landscape

When i try to switch the orientation of my emulator, the emulator window rotates and the orientation of the emulator screen stays as it were. Can anyone tell me what is the reason for this?I have tried all the answers from StackOverflow and nothing seem to help
Some of the emulator targets like 4.4 (API level 19) and 2.3 have a bug. Change your emulator to target version 4.2 or 4.3 and try to change the orientation.
See the history of this bug:
https://code.google.com/p/android/issues/detail?id=13189
Related question: Impossible to rotate the emulator with android 4.4
If everything else fails (it did for me), as a workaround you can use application for screen orientation.
In the other question (Impossible to rotate the emulator with android 4.4), user vldmrrr wrote that:
Until it is fixed I use this free application "Set Orientation".
Install the apk into emulator using adb install.
The application displays a shortcut in the notification status bar.
(I know it's an old question, but it's pretty high in google).
With the android L emulator you can go into landscape by opening your app, then opening the camera app (you will need to set an emulated camera in AVD) record a video. Then press ctr-f12 of 11. In the camera app click the video thumbnail and play it back. The video should go to landscape. Then press the multitasking button and multitask into your app. DO NOT GO TO THE HOME SCREEN OR YOU WILL HAVE TO GO INTO THE CAMERA APP, GO TO LANDSCAPE AND REPLAY THE VIDEO! please let me know if this works for any other android emulator versions.
My solution was to enable the accelerometer in the device profile.
These answers help me to do this.. Please try these and you can see what u wanted to do
https://stackoverflow.com/a/4057309/1063861
https://stackoverflow.com/a/4535315/1063861
This is a bug in android emulator. Add Keyboard Support - yes in emulator properties to fix this problem. You can track this bug : http://code.google.com/p/android/issues/detail?id=34237
Other answers cover this pretty well, but there seem to be some restrictions on using the Ctrl key bindings (at least in Linux).
Summary: Key bindings for changing emulator orientation
Note that there are relevant bugs for emulator targets v2.3 and v4.4. See the bug reports for more info and workarounds.
Emulator shortcuts are listed here.
Prev Layout: KEYPAD_7 or Ctrl-F11
Next Layout: KEYPAD_9 or Ctrl-F12
Notes on Ctrl key bindings (in Linux)
Although the docs claim Ctrl-F11/12 work, I've found that these bindings only work using the left control key (LeftCtrl-F11/12). Someone mentioned this happening in Windows, so it's not just Linux.
LeftCtrl-F11/12 using a key remapped to LeftCtrl doesn't work for me. I need to use the physical LeftCtrl key. I don't know whether this affects non-X11 systems as well.
Note on KP_n key bindings
Keep in mind that a few numeric keypads actually emit scancodes for the number-row digits, rather than the proper keypad digits. Such keypads won't work for any keypad-specific bindings.
you can try in two ways.
1.left ctrl+F11
2.enable num lock then press 9.
Is only your application is not rotating or other applications in the emulator also not rotating?
If only your application is not rotating, then there must be android:screenOrientation parameter set somewhere in the manifest file.
If all other apps on the emulator are also not rotating, no problem with your application, delete and create a new emulator..
Check in your manifest if there is android:screenOrientation
<activity
android:name="com.your.activity"
android:screenOrientation="sensorPortrait" >
</activity>
If this is the case, delete the lines.
try pressing numpad 7 ... it will rotate your emulator screen.

How do I get the Android tablet emulator to be right-side up?

I just downloaded the Android 3.0 SDK and booted up an emulator with it. I rotated the emulator to portrait mode with Ctrl-F12 and then opened and the activity that was build with 2.2 and the whole emulator is upside down ( as in the emulator is upside down, home buttons are on the top and screen is upside down) . Is there a way to rotate it the other way or am I missing something entirely? ( I have already tried doing Ctrl-F11 or the Num pad, same result)
open your androidmanifest file. In the application tab select an activity. Then scroll down to screen orientation and select sensorPortait in the drop-down menu. It's only available from api-level 9 (2.3.1) and higher.
Well , there can be one of the 2 cases ,
1 - I misinterpreted your question , in which case i am extremely sorry
2 - The problem has been solved in the latest download of the android 3.0 Sdk(i just downloaded 1 right now )
Here , i am posting the screen shot of my AVD running 3.0 and a 2.2 Hello World Activity .
I had this same issue when I was forcing portrait by setting screen orientation to "portrait" in the manifest file. When I made my app support rotation, and switched screen orientation back to "unspecified" the issue went away.
If you don't want to support rotation, just change the manifest while you test, and before you open the app, rotate the emulator so it opens in portrait.
I encountered this problem on running the Android SDK (Eclipse) on an Intel (Core i5) Mac. I was able to fix it by disabling the "Use Host GPU" option for the AVD.
I had the same problem, in my case when I rotated the emulator to portrait, the "desktop" would show correct. However the app would run upside down.
(This worked for v4 Ice Cream)
So, in portrait mode, in the bottom right corner of the emulator, select the settings and set "Auto-rotate screen" to OFF.
Run the app now and it will show correct.
Some of the emulator targets like 4.4 (API level 19) and 2.3 have a bug. Change your emulator to target version 4.2 or 4.3 and try to change the orientation or try to disable hardware keyboard.
The same thing just happened to me with a KitKat emulator whenever I setup the AVD with a default orientation of Landscape. Switching the default to Portrait fixed the problem.
The easiest way to tackle that problem is to just flip the display of your host system.
On the Mac you can do this in System Preferences > Display on Windows there is a keyboard shortcut: ctrl + alt + arrow key. (see here: https://superuser.com/questions/554589/how-can-i-horizontally-flip-invert-my-monitor-not-rotate and here: http://osxdaily.com/2010/12/28/rotate-mac-screen-orientation/)
And if you have a standalone trackpad you can just turn it around physically to have your mouse pointer move naturally.

How to get screenshot with Android phone bezel in Eclipse AVD?

I have an Android presentation coming up and would like to get some screenshots of my application. Thing is, I'd like to have a screenshot of the phone with the app running on it.
I could use a camera and take a pic of a droid phone+app, but seems to me the AVD used to run inside a picture of the Nexus phone. Just wondering if it's an Eclipse config option somewhere?
Thanks!
Try using image editing software to superimpose the screenshot into an image of the phone. That's what the designers I work with do when they need to make PR screenshots.
run the DDMS from the location where ever you have installed the Android and then chose Device menu and screen capture
just do alt+printscreen from keyboard keep in mind AVD is focused you will get screen shot of AVD..

Categories

Resources