Android 4.4.x screen rotation - android

I'm using Android 4.4.2, and my need is to revert the screen in landscape mode.
On the previous versions of Android I was able to do this simply setting
ro.sf.hwrotation=180
in build.prop file, under /system.
Searching with google I've discovered that with Android 4.4.x this option is no more availalbe (in fact it doesn't work) .
Does anyone know how to solve this issue in another way?
Thx

Related

Android Studio API Level 28: Rotating emulator does not rotate the app contents or device UI

Foreword. I know this question has been asked several times in the past, but none of the solutions have actually worked for me. It's also been several years since a similar question has been asked (according to a time-filtered Google search), so most of the older answers are outdated. If there's any way I can edit the question to be clearer, please let me know.
Problem. When I click either of the rotation buttons, the emulator itself rotates, but the user interface and app contents do not get redrawn accordingly, such that I have to tilt my head (defeating the purpose of rotating the device).
Specifications
Android Studio 3.2
Android SDK 9.0 (Pie)
Nexus 5X API 28 (I've tried other devices, but the issue persists)
I do not have any Android Manifest orientation attributes set
Screenshots
Make sure auto-rotate is enabled on the virtual device. Pull down the notification bar and look for the Auto-rotate toggle and turn it on. Or, go into Settings->Display->Advanced and make sure Auto-rotate screen is turned on.

Forcing portrait orientation on Android stopped working after update to Lollipop, but only when debugging from Eclipse

I'm working on a libGDX application and based on this question I'm forcing portrait orientation in activity tag of AndroidManifest.xml like this:
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
This used to work fine on my devices until my Samsung Galaxy S4 got upgraded to Lollipop (5.0.1) from KitKat. Now it doesn't work on this device, while still working on others (with lower Android versions). On the S4 it just displays the application in landscape, ignoring rotation.
I was looking for differences in the 5.0 API that could explain this, but couldn't find anything.
Edit: I've just tried exporting my app to .apk and it displayed properly. Previously I was running it from Eclipse debug mode. It shouldn't be hard to pinpoint the issue, but I don't have time to investigate it at the moment.
Edit2: I've just tried running it from Eclipse on a different machine, where I have API 21 (so Lollipop) and it worked. However my working .apk has been exported on another machine, where I have API 20. It's really puzzling me. Might be something related to Android plugin versions, but I'm not sure if I will be able to pinpoint it.
try
android:screenOrientation="sensorPortrait"
I am not sure what your API level. But there was a google bug around this issue, which was fixed by API 16. If you are using anything earlier and if above line does not work, try
android:screenOrientation="sensorPortait"
instead.

Preview of widget not showing correct image after update

I have an app that has an widget preview image. I recently updated this image on the app, but in a device with Lollipop (5.0) version of android, the preview image of the widget shows the old image (the one I replaced). The same doesn't occur in devices without Lollipop.
I turned the resources folder upside down searching for the old image, but it is correctly updated in all the places (actually, it is only in one folder, as I have only one image of the preview).
Just to give more info, I'm using Android Studio 1.0-rc1, and this problem only occurs in my Nexus 4 with lollipop (5.0) running on it.
I tested in some emulators with Lollipop, and the same happened.
It's important to highlight that if I never installed any previous version of the app (with the old widget preview image), when I install the new version the preview image appears to be correct.
Is anyone having the same problem, or knows how to solve this?
Thanks.
I had the same problem. I managed to work around it (on Nexus 5) by going to the settings of the launcher app (Settings -> Apps -> Google App) and deleting the cache.
I also had this same issue and the answer by #spookypeanut put me on the right track.
My phone is running CyanogenMod so I had to go to app Launcher3 (com.cyanogenmod.trebuchet), clear cache and force stop it. After it reloaded all the previews updated.

How to test screen rotation in Android Emulator? [duplicate]

This question already has answers here:
Android emulator - Screen rotation
(5 answers)
Closed 8 years ago.
If I open a browser in emulator and press Ctrl+F11 or F9 or Ctrl+F11, the screen rotates but browser doesn't.
To test I downloaded a native app and installed it on my emulator and phone both. The app catches the rotation of phone but on emulator similar thing happened.
I googled it and read few posts on Stackoverflow, I found that its a bug in Emulator of particular version.
But which version of emulator runs it fine?
I simply downloaded the adt-bundle-windows-x86_64-20140702 and I have eclipse(juno) with it. Eclipse has Andoird SDK Manager inside it, which helped me to chose the latest APIs, SDK tools etc. I downloaded those, what did I miss that doesn't support rotation.
I also read that if I if uncheck Hardware keyboard Present then it would work but it didn't.
I also tried by uncheck Host GPU, no luck.
Finally I was told that need to specify in AndroidManifest.xml that I want to support both landscapeand portrait both. But I have not created any android project in eclipse I simply created a device and now checking its rotation with its own browser and by installing a apk file from internet.
Are there any concrete steps/tested way that work out screen rotation on android emulator?
But which version of emulator runs it fine?
4.3 (API Level 18) and below.
Are there any concrete steps/tested way that work out screen rotation on android emulator?
Download an emulator image for Android 4.3 (API Level 18) or below, create an emulator from it, and use that. You will find emulator images in your SDK Manager:
In the above screenshot, you will see API Level 17 and 18 emulator images towards the bottom of the picture.
Your problem can be solved by changing one setting as given below:
Open Menu
Goto Settings
Goto Accessibility
Check the check box for "Auto-rotate screen".
This may solve your issue.

Camera preview shows unwanted tiles only on Android 4.2.2 (S4, full HD screen)

My app runs with many devices but 2 users have send me simular images as below.
As far as I know the behaviour is only seen on Android 4.2.2 (Samsung S4).
On the full HD screen there seem to be 3 compressed tiles of 160x600 pixels.
I have tried an AVD with full HD screen but that fails to start.
On 4.03 devices I don't see this. I don't use tiles.
Does anybody have a hint what or where this goes wrong ?
This looks like a possible bug in the Android platform on Samsung's S4 devices with that particular Android version. My experience tells me that it's a very real possibility. It could also be that you do something wrong in your app that only causes actual problems on that version (and maybe even only on that device), but there is no indication of that from what you tell. Android 4.2.2 should be backwards compatible with 4.0.3, so in general it should work on the later version too, of course.
I would advice you (or anyone in the same situation) to try it out on other devices with the same Android version if possible. Also, double check that you're not violating anything in the Android API documentation.
Please add more info about what you're doing and how if you need more detailed answers. I guess you've probably found a solution or workaround by now, but still adding my answer here.

Categories

Resources