Let's say that I have a game where when I rotate my phone to the left, my players walks left etc. Everything is set on SensorEvent
on 'y'
position. Here comes an issue. The whole app is running on Landscape mode (which is set in AndroidManifest.xml
) and coded by:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
So. I have a method that checks if the device is a tablet or a smartphone and it's working, But - on half of the tablets the 'view'
is vertical - I mean they act like phones.
On Samsung Galaxy S4 (mobile phone) I check the y
and -y
position (cause I rotate the phone to hold in 2 hands) - it works.
On Samsung Galaxy Tab I keep the tablet in 2 hands normally, I use '-x'
position (no idea why it's reversed - should be x
) - it works.
ISSUE: Tablets like Prestigio. They are all VERTICAL - like smartphones. When I run my 'isTablet'
it checks the size of the screen and it says that it's a tablet, but the x
, y
, z
system of the sensor is acting like on a phone (I have to use 'y'
).
Does anyone know how to handle all the devices?