Accelerometer in Kindle Fire HD flipped vs Kindle Fire?
I'm finding that the accelerometer in the Kindle Fire HD is returning Y-axis results polar opposites of those returned by Kindle Fire and all other Android devices tested. Can someone confirm? Is this intentional?
Hi qtoppler, Yes, this is intentional. The Kindle Fire HD has a default landscape orientation different than that of the Kindle Fire. From our "Kindle Fire Development Best Practices" page: "The default landscape orientation for the Kindle Fire (1st Generation) and Kindle Fire (2nd Generation) is ROTATION_90. The default landscape orientation for the Kindle Fire HD tablets is ROTATION_270." (In other words, in landscape, if the Kindle Fire HD is oriented with the camera at the top of the device, that is ROTATION_270).
https://developer.amazon.com/sdk/fire/best-practices.html#SettingOrientation contains additional information on orientation, the accelerometer, and best practices. You may want to pay particular attention to "Specifying Orientation to Ensure Accelerometer Games Behave Correctly." Thank you.
I have 3 related apps in the Amazon store. They are landscape-only. I use corona. The 3 apps were built using the same version of corona. All 3 have the same setting for orientation. 2 have passed testing on all kindle fires, 1 failed on kindle fire HD because it starts upside down, according to support. Support has sent me the same info you posted here about the 270 default orientation/etc. Corona said my code to support landscape-only looks right and I shouldn't be having an issue with orientation. You can see the discussion thread here where Joshua responds to my (Luciane) posts:
http://developer.coronalabs.com/forum/2012/08/25/about-orientation-event#comment-131300 Something is not right as it doesn't make sense that 2 apps done in the same way passed on HD and one didn't. I am at a loss of what to do to fix..... Message was edited by: raindogresearch
> "The default landscape orientation for the Kindle > Fire (1st Generation) and Kindle Fire (2nd > Generation) is ROTATION_90. The default landscape > orientation for the Kindle Fire HD tablets is > ROTATION_270." (In other words, in landscape, if the > Kindle Fire HD is oriented with the camera at the top > of the device, that is ROTATION_270). And this is backwards (or upside-down, more specifically). If you have code that uses these ROTATION_90/270 values, and works on every other Android tablet out there, it'll be wrong on the Kindle HD. The same issue also affects accelerometer-based apps and games. You need the opposite rotation parameters to what works on every other tablet. I only have a 7" Fire HD; can anyone confirm that this is also true on the 8.9" HD+? Sterling
@ Sterling Kindle Fire HD 8.9" also supports front-facing cameras and thus the default landscape orientation for it is ROTATION_270. If your app is designed to work in landscape mode, then we recommend that you use sensor-based orientation rather than relying upon the rotation value, e.g. setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);