GMan Well-Known Member Licensed User Longtime User Mar 3, 2014 #1 Is it possible to GET the actual ScreenOrientation ? I searched the forum, but all questions belongs to SET it... P.S.: i know that its working this way, but think maybe there is a better way: Code: Copy Dim Orientation As String If Activity.Width > Activity.Height Then Orientation = "Landscape" Else Orientation = "Portrait" End If
Is it possible to GET the actual ScreenOrientation ? I searched the forum, but all questions belongs to SET it... P.S.: i know that its working this way, but think maybe there is a better way: Code: Copy Dim Orientation As String If Activity.Width > Activity.Height Then Orientation = "Landscape" Else Orientation = "Portrait" End If
JoanRPM Active Member Licensed User Longtime User Mar 3, 2014 #3 Gman, I use this way. Works fine. Upvote 0
GMan Well-Known Member Licensed User Longtime User Mar 3, 2014 #4 I need a combination of the Accelerator +Y-Axis (away from me) and the ScreenOrientation (for users that dont have a Gyro build in). So i used the written way and that works but thought, i can get the orientation by an own event. Upvote 0
I need a combination of the Accelerator +Y-Axis (away from me) and the ScreenOrientation (for users that dont have a Gyro build in). So i used the written way and that works but thought, i can get the orientation by an own event.
GMan Well-Known Member Licensed User Longtime User Mar 3, 2014 #5 I need a combination of the Accelerator +Y-Axis (away from me) and the ScreenOrientation (for users that dont have a Gyro build in). So i used the written way and that works but thought, i can get the orientation by an own event. Upvote 0
I need a combination of the Accelerator +Y-Axis (away from me) and the ScreenOrientation (for users that dont have a Gyro build in). So i used the written way and that works but thought, i can get the orientation by an own event.
Erel B4X founder Staff member Licensed User Longtime User Mar 4, 2014 #6 If you are interested with other orientations (reverse portrait and reverse landscape) then you can use the code posted here: http://www.b4x.com/android/forum/threads/reverse-screen-orientation-and-compass.21565/#post-124997 Upvote 0
If you are interested with other orientations (reverse portrait and reverse landscape) then you can use the code posted here: http://www.b4x.com/android/forum/threads/reverse-screen-orientation-and-compass.21565/#post-124997
GMan Well-Known Member Licensed User Longtime User Mar 4, 2014 #7 Hoi Erel, TOP - thats what i was looking for Upvote 0
ivan.tellez Active Member Licensed User Longtime User Mar 23, 2015 #8 This could be usefull Code: Copy Sub GetOrientation As Int Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod("getResources") r.Target = r.RunMethod("getConfiguration") Dim Result As Int = r.GetField("orientation") Return Result End Sub Upvote 0
This could be usefull Code: Copy Sub GetOrientation As Int Dim r As Reflector r.Target = r.GetContext r.Target = r.RunMethod("getResources") r.Target = r.RunMethod("getConfiguration") Dim Result As Int = r.GetField("orientation") Return Result End Sub