RomansUP Member Licensed User Longtime User Sep 10, 2015 #1 Hi, I have a problem with screen oriantation and Accelerometer sensor. My program must run only in lanscape orientation. I set it in Project Attributes region like #SupportedOrientations: landscape it's OK On my 10 inch ASUS tablet it's work perfect But on 7 inch tablet Accelerometer sensor returns values like tablet still in portrait orientation. I mean that x values and y values of Accelerometer sensor are swapped together. So as I understand if I change screen orientation it does not changes orientation of Accelerometer sensor values. Is it possible to fix this problem? MoreOver I try to use program from Play Market "sensorbox" This program works correctly with 7 inch tablet but on this time incorrect with 10 inch tablet (x values again swapped with y values). It seems to me that programs for phones wich are using Accelerometer sensor are not usable for tablets and viceversa.
Hi, I have a problem with screen oriantation and Accelerometer sensor. My program must run only in lanscape orientation. I set it in Project Attributes region like #SupportedOrientations: landscape it's OK On my 10 inch ASUS tablet it's work perfect But on 7 inch tablet Accelerometer sensor returns values like tablet still in portrait orientation. I mean that x values and y values of Accelerometer sensor are swapped together. So as I understand if I change screen orientation it does not changes orientation of Accelerometer sensor values. Is it possible to fix this problem? MoreOver I try to use program from Play Market "sensorbox" This program works correctly with 7 inch tablet but on this time incorrect with 10 inch tablet (x values again swapped with y values). It seems to me that programs for phones wich are using Accelerometer sensor are not usable for tablets and viceversa.
Erel B4X founder Staff member Licensed User Longtime User Sep 10, 2015 #2 See this post: https://www.b4x.com/android/forum/threads/sensor-orientation.36828/#post-216794 Upvote 0
RomansUP Member Licensed User Longtime User Sep 11, 2015 #3 Thank you Erel This code really helped me. Upvote 0