Why has TYPE_ORIENTATION been deprecated since API 8.0?
In the Google I / O 2012 conference on sensors here: http://youtu.be/Q0V_ld7iNw4?t=23m23s 23 minutes and 23 seconds later she talked about giving up this feature because on different devices like tablets and smartphones, The default orientation is landscape in tablet and portrait in tubes. If the encoder is unaware of this, it will cause their device to perform differently in those environments or when it rotates 45 degrees. Better to get the default orientation of the device first using SensorManager.getOrientation (), then do your sensor calculations accordingly.
source to share
Because tablets usually differ from the default orientation. (It was a portrait, meaning the screen was taller than it was wide when it was normally expected. Pills mean the default is a screen that's wider than tall).
This means that you need to find the best gear that android.view.Display.getOrientation()
.
For more information see this blog post .
Deprecated
means "This has been replaced by something better. It will still work, but you should look for a new replacement because it may stop working in the future," which explains why the code "works great" "for you. It may work many years (or stop working in the next release), so you get a warning.
source to share