Orientation - setting test

Gargoyle

Member
Licensed User
Longtime User
Can a few kind people test this code and see if it matches to what it says it should be. These are the values needed for my tablet, just checking if they're universal.

Phone library needed to be ticked/included.

If you test, can you comment whether they all match or only some.

Thanks.

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim Orient As ListView
   Dim phn As Phone
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Orient.Initialize ("Orient")
   Orient.AddSingleLine2("-1 = Auto (Sensor)",-1)
   Orient.AddSingleLine2(" 0 = Landscape - Set",0)
   Orient.AddSingleLine2(" 1 = Portrait - Set",1)
   Orient.AddSingleLine2(" 6 = Landscape - Sensor",6)
   Orient.AddSingleLine2(" 7 = Portrait - Sensor",7)
   Orient.AddSingleLine2(" 8 = Reversed Landscape - Set",8)
   Orient.AddSingleLine2(" 9 = Reversed Portrait - Set",9)
   Activity.AddView(Orient,20,20,Activity.Width -40,Activity.Height-40)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Orient_ItemClick (Position As Int, Value As Object)
   phn.SetScreenOrientation(Value)
End Sub

Edit: Here's a zip containing example. View attachment Orientation.zip
 
Last edited:

Gargoyle

Member
Licensed User
Longtime User
Thanks Klaus, can some others test it please, I want to know if these values are universally constant.

Thanks.

I've added a zip to first post for easier testing.
 
Upvote 0

positrom2

Active Member
Licensed User
Longtime User
Yes, works as expected by me on Archos Internet tablet 70b.
Thanks, I will incorporate the method to fix the orientation to be comfortable (see my posts). The previous suggestions to my question had been too hard for me.
Positrom2
 
Upvote 0

Vansdan

Member
Licensed User
Longtime User
Works with Asus Transformer TF 101

Hi,
everything okay with my Asus Transformer TF 101. All Items working okay!

Best regards
Daniel
 
Upvote 0

Gargoyle

Member
Licensed User
Longtime User
@ta1dr, positrom2 & Vansdan, thanks, looking good so far, seems the values may be universal, hopefully a few more testers/devices will be able ensure it.
 
Upvote 0

kcorey

Member
Licensed User
Longtime User
Hi Gargoyle,

All working fine on:
Sumvision Cyclone Astro (android 2.3.4)
Ainol Novo 7 Android 4.0.1 (really unfortunate name)
Nexus 7 4.1.1
Samsung Galaxy Tab 2 10" 4.0.4

The reverse portrait mode wouldn't appear with a sensor (though if 'Reverse Portrait' were selected, it would display it)

Nexus One, CyanogenMod 7.0 (Android 2.3.7)

Hope that helps.

-Ken
 
Upvote 0
Top