Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator - Screen rotation

I would like to test the rotation of a phone on the emulator, I see everywhere that we have to use Ctrl+F11 but it only rotates the image of the emulator and does not launch a configuration change event or redraw the activity.

Here is what I have with Ctrl+F11 :

emulator rotation

So, what do I have to use to simulate a real rotation ?

like image 250
Stephane Mathis Avatar asked Jul 10 '12 19:07

Stephane Mathis


People also ask

How do you rotate the screen on an emulator?

Use Ctrl + F11 . This will rotate your emulator.


2 Answers

Also you can do:

disable accelerometer controlling rotation - just do this once

adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0

rotate landscape:

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1

rotate portrait:

adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0

rotate upside down landscape:

adb shell content insert --uri content://settings/system  --bind name:s:user_rotation --bind value:i:3

rotate upside down portrait:

adb shell content insert --uri content://settings/system  --bind name:s:user_rotation --bind value:i:2

If you have WRITE_SETTINGS permission you can write thru the content provider in java code as well.

like image 86
Tom Avatar answered Nov 09 '22 12:11

Tom


http://developer.android.com/tools/help/emulator.html this should do it

did you also support portrait and landscape mode

like image 35
KPath001 Avatar answered Nov 09 '22 12:11

KPath001