H Helihead Member Licensed User Longtime User Mar 10, 2013 #1 This is probably something easy and obvious but I have searched and can't find it. My screens display correctly on most devices but are upside down on some tablets. You can turn the tablets over and it works but it is awkward it you have cables connected to what we normally think of as the bottom. I also noticed that B4ABridge is upside down on those tablets as well. Anyway to flip the Y axis or otherwise correct so it displays right side up to match other programs?
This is probably something easy and obvious but I have searched and can't find it. My screens display correctly on most devices but are upside down on some tablets. You can turn the tablets over and it works but it is awkward it you have cables connected to what we normally think of as the bottom. I also noticed that B4ABridge is upside down on those tablets as well. Anyway to flip the Y axis or otherwise correct so it displays right side up to match other programs?
agraham Expert Licensed User Longtime User Mar 10, 2013 #2 Do those tablets have G-sensors? i.e. If you rotate the tablet 90 degrees does the screen automatically change from portrait to landscape. As far as I am aware it is Android itself that determines the orientation of a displayed Activity.
Do those tablets have G-sensors? i.e. If you rotate the tablet 90 degrees does the screen automatically change from portrait to landscape. As far as I am aware it is Android itself that determines the orientation of a displayed Activity.
H Helihead Member Licensed User Longtime User Mar 10, 2013 #3 agraham said: Do those tablets have G-sensors? i.e. If you rotate the tablet 90 degrees does the screen automatically change from portrait to landscape. As far as I am aware it is Android itself that determines the orientation of a displayed Activity. Click to expand... Yes they do. All other programs are correctly displayed as you rotate from portrait to landscape. Run b4ABridge and it will be upside down in portrait mode. Rotate the tablet 180 degrees and it will be correct. All other programs would respond to the 180 degree rotation but b4abridge does not. It just rotates around like a magazine going from upside down to right side up. My program does the same. I purposefully restrict my program to portrait mode if that helps. B4aBridge is not limited to portrait mode only. Last edited: Mar 10, 2013
agraham said: Do those tablets have G-sensors? i.e. If you rotate the tablet 90 degrees does the screen automatically change from portrait to landscape. As far as I am aware it is Android itself that determines the orientation of a displayed Activity. Click to expand... Yes they do. All other programs are correctly displayed as you rotate from portrait to landscape. Run b4ABridge and it will be upside down in portrait mode. Rotate the tablet 180 degrees and it will be correct. All other programs would respond to the 180 degree rotation but b4abridge does not. It just rotates around like a magazine going from upside down to right side up. My program does the same. I purposefully restrict my program to portrait mode if that helps. B4aBridge is not limited to portrait mode only.
agraham Expert Licensed User Longtime User Mar 10, 2013 #4 What happens if you rotate B4Bridge just 90 degrees to landcape orientation from when it is upside down in portrait orientation?
What happens if you rotate B4Bridge just 90 degrees to landcape orientation from when it is upside down in portrait orientation?
H Helihead Member Licensed User Longtime User Mar 10, 2013 #5 agraham said: What happens if you rotate B4Bridge just 90 degrees to landcape orientation from when it is upside down in portrait orientation? Click to expand... Ahh you may be onto something... ON a normal phone or tablet going from portrait to landscape has B4ABridge rotating to those modes as expected. On the tablets where it is upside down, it does not respond to rotating the tablet. It stays fixed in it's original position no matter how you turn the tablet. On that same "Bad" tablet, run something like email or a game and it DOES respond to tablet rotation by switching from landscape to portrait and back. That confirms that it has the sensor. Seems like on some tablets, B4ABridge (and my program written in B4A) can't detect the rotation. Last edited: Mar 10, 2013
agraham said: What happens if you rotate B4Bridge just 90 degrees to landcape orientation from when it is upside down in portrait orientation? Click to expand... Ahh you may be onto something... ON a normal phone or tablet going from portrait to landscape has B4ABridge rotating to those modes as expected. On the tablets where it is upside down, it does not respond to rotating the tablet. It stays fixed in it's original position no matter how you turn the tablet. On that same "Bad" tablet, run something like email or a game and it DOES respond to tablet rotation by switching from landscape to portrait and back. That confirms that it has the sensor. Seems like on some tablets, B4ABridge (and my program written in B4A) can't detect the rotation.
Erel B4X founder Staff member Licensed User Longtime User Mar 11, 2013 #6 Set the orientation attribute to: fullSensor Instead of the default value ("unspecified"). <activity> | Android Developers
Set the orientation attribute to: fullSensor Instead of the default value ("unspecified"). <activity> | Android Developers
H Helihead Member Licensed User Longtime User Mar 11, 2013 #7 Erel said: Set the orientation attribute to: fullSensor Instead of the default value ("unspecified"). <activity> | Android Developers Click to expand... Trying to add to the manifest: <activity android:windowSoftInputMode="stateHidden" android:launchMode="singleTop" android:screenOrientation="fullSensor"> </activity> I'm obviously putting this in the wrong place and keep getting "AndroidManifest.xml:9: error: Error: String types not allowed (at 'screenOrientation' with value 'fullSensor')."
Erel said: Set the orientation attribute to: fullSensor Instead of the default value ("unspecified"). <activity> | Android Developers Click to expand... Trying to add to the manifest: <activity android:windowSoftInputMode="stateHidden" android:launchMode="singleTop" android:screenOrientation="fullSensor"> </activity> I'm obviously putting this in the wrong place and keep getting "AndroidManifest.xml:9: error: Error: String types not allowed (at 'screenOrientation' with value 'fullSensor')."
NJDude Expert Licensed User Longtime User Mar 11, 2013 #8 You have to add that line in your code, look under "Project attributes" region.
H Helihead Member Licensed User Longtime User Mar 11, 2013 #9 NJDude said: You have to add that line in your code, look under "Project attributes" region. Click to expand... Not trying to be dense but I have added it in the code under Module Attributes, Project Attributes, and Activity Regions and in the manifest editor. It always says "Error description: Attribute not supported: screenorientation" Tried it as : #screenOrientation: fullSensor #screenOrientation="fullSensor" screenOrientation="fullSensor" The online help for this is very vague for where to add and exact syntax.
NJDude said: You have to add that line in your code, look under "Project attributes" region. Click to expand... Not trying to be dense but I have added it in the code under Module Attributes, Project Attributes, and Activity Regions and in the manifest editor. It always says "Error description: Attribute not supported: screenorientation" Tried it as : #screenOrientation: fullSensor #screenOrientation="fullSensor" screenOrientation="fullSensor" The online help for this is very vague for where to add and exact syntax.
NJDude Expert Licensed User Longtime User Mar 11, 2013 #10 Just do THIS no need to touch the manifest.
H Helihead Member Licensed User Longtime User Mar 11, 2013 #11 NJDude said: Just do THIS no need to touch the manifest. Click to expand... Copied yours EXACTLY and put it in a code region at the top of my program NOT in the manifest. Still get "AndroidManifest.xml:22: error: Error: String types not allowed (at 'screenOrientation' with value 'fullSensor')."
NJDude said: Just do THIS no need to touch the manifest. Click to expand... Copied yours EXACTLY and put it in a code region at the top of my program NOT in the manifest. Still get "AndroidManifest.xml:22: error: Error: String types not allowed (at 'screenOrientation' with value 'fullSensor')."
NJDude Expert Licensed User Longtime User Mar 11, 2013 #12 What's the SDK version you are using to compile?, that setting requires SDK 9 + if I'm not mistaken
H Helihead Member Licensed User Longtime User Mar 11, 2013 #13 Looks like I have 8. I will update tonight and retry. Thanks for sticking with me. Jeff
H Helihead Member Licensed User Longtime User Mar 12, 2013 #14 Upgraded SDK all the way to 15. fullSensor works but it doesn't do what I need. I want to restrict my App to Portrait only but I want portrait to know which way is up. Looking through the docs it seems that sensorPortrait would be the correct value so I can limit to Portrait only but it does use the sensor to determine the correct orientation (not upside down). "portrait" works. "fullSensor" works. Problem is that "sensorPortrait" throws the same "string not allowed" error. "sensorPortrait" Portrait orientation, but can be either normal or reverse portrait based on the device sensor. Added in API level 9.
Upgraded SDK all the way to 15. fullSensor works but it doesn't do what I need. I want to restrict my App to Portrait only but I want portrait to know which way is up. Looking through the docs it seems that sensorPortrait would be the correct value so I can limit to Portrait only but it does use the sensor to determine the correct orientation (not upside down). "portrait" works. "fullSensor" works. Problem is that "sensorPortrait" throws the same "string not allowed" error. "sensorPortrait" Portrait orientation, but can be either normal or reverse portrait based on the device sensor. Added in API level 9.
Erel B4X founder Staff member Licensed User Longtime User Mar 12, 2013 #15 Seems like an error in Android documentation: android - Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait') - Stack Overflow This mode is only supported on API level 16 (Android 4.1?).
Seems like an error in Android documentation: android - Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait') - Stack Overflow This mode is only supported on API level 16 (Android 4.1?).
H Helihead Member Licensed User Longtime User Mar 12, 2013 #16 Erel said: Seems like an error in Android documentation: android - Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait') - Stack Overflow This mode is only supported on API level 16 (Android 4.1?). Click to expand... I upgaded my sdk and selected version 17. Setting "sensorPortrait" now works although it is a little quirky. On the phones that oriented correctly before, it still works correctly. I have portrait only (as I wanted) and it knows which way is up. Rotating the phones 180 degrees has the application respond and upright itself in the new portrait orientation. On the tablets that were upside down before, it is limited to portrait only (as I wanted) and it is no longer upside down. It now finds the right side up no matter which of the two portrait modes you hold your tablet in. Much Better! Only odd thing is that on these tablets, it does not respond if you rotate the tablet 180 degrees after start up. Example: Hold your tablet in portrait with connectors at the bottom. Start the app and it starts right side up. Hold your tablet in portrait mode with connectors at the top, start the app and it starts right side up. Start up in portrait mode with connectors on the bottom or the top and it starts the app rightside up. Now rotate the tablet 180 degrees and the app stays as it was and ends up upside down. It's much better than the way it was as it always starts right side up now and at least follows rotation on most of the phones. Not perfect but good enough for me for now. Thanks for your help!
Erel said: Seems like an error in Android documentation: android - Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait') - Stack Overflow This mode is only supported on API level 16 (Android 4.1?). Click to expand... I upgaded my sdk and selected version 17. Setting "sensorPortrait" now works although it is a little quirky. On the phones that oriented correctly before, it still works correctly. I have portrait only (as I wanted) and it knows which way is up. Rotating the phones 180 degrees has the application respond and upright itself in the new portrait orientation. On the tablets that were upside down before, it is limited to portrait only (as I wanted) and it is no longer upside down. It now finds the right side up no matter which of the two portrait modes you hold your tablet in. Much Better! Only odd thing is that on these tablets, it does not respond if you rotate the tablet 180 degrees after start up. Example: Hold your tablet in portrait with connectors at the bottom. Start the app and it starts right side up. Hold your tablet in portrait mode with connectors at the top, start the app and it starts right side up. Start up in portrait mode with connectors on the bottom or the top and it starts the app rightside up. Now rotate the tablet 180 degrees and the app stays as it was and ends up upside down. It's much better than the way it was as it always starts right side up now and at least follows rotation on most of the phones. Not perfect but good enough for me for now. Thanks for your help!
Eric H Active Member Licensed User Longtime User Oct 28, 2013 #17 I can't get sensorPortrait to work on my Samsung Galaxy S4. I have tried typing this in the manifest: Code: SetActivityAttribute(main,android:screenOrientation, "sensorPortrait") and according to some other folks, Google misspelled sensorPortrait as sensorPortait (missing the "r" in portrait) so I have tried this as well but get an error (AndroidManifest.xml:17: error: Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait').): Code: SetActivityAttribute(main,android:screenOrientation, "sensorPortait") I am using this line also in my manifest, since it has been mentioned that it requires version 16 or higher to work: Code: <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="18"/> Any idea why?
I can't get sensorPortrait to work on my Samsung Galaxy S4. I have tried typing this in the manifest: Code: SetActivityAttribute(main,android:screenOrientation, "sensorPortrait") and according to some other folks, Google misspelled sensorPortrait as sensorPortait (missing the "r" in portrait) so I have tried this as well but get an error (AndroidManifest.xml:17: error: Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait').): Code: SetActivityAttribute(main,android:screenOrientation, "sensorPortait") I am using this line also in my manifest, since it has been mentioned that it requires version 16 or higher to work: Code: <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="18"/> Any idea why?
Erel B4X founder Staff member Licensed User Longtime User Oct 28, 2013 #18 You do not need to set minSdkVersion. You just need to reference android.jar from API 16 or above. Seems like this orientation mode is not supported on all devices. You can just write it in the attribute: Code: #SupportedOrientations: sensorPortrait
You do not need to set minSdkVersion. You just need to reference android.jar from API 16 or above. Seems like this orientation mode is not supported on all devices. You can just write it in the attribute: Code: #SupportedOrientations: sensorPortrait
Eric H Active Member Licensed User Longtime User Oct 28, 2013 #19 Thanks Erel, I have tried that also and am referencing SDK 17 or 18, so like you said, it must not be supported on this device. Ty for your response Edit: although, oddly enough, sensor portrait and reverse portrait both work using this app: https://play.google.com/store/apps/details?id=nl.fameit.rotate I bet he has written custom code that isn't based off from the standard android orientation controller. Last edited: Oct 28, 2013
Thanks Erel, I have tried that also and am referencing SDK 17 or 18, so like you said, it must not be supported on this device. Ty for your response Edit: although, oddly enough, sensor portrait and reverse portrait both work using this app: https://play.google.com/store/apps/details?id=nl.fameit.rotate I bet he has written custom code that isn't based off from the standard android orientation controller.