Android Orientation Woes

Dan Friedman dan at clearvisiontech.com
Fri Aug 31 17:37:59 EDT 2012


Colin,

Yes.  My app is portrait only.   I selected "Portrait" as the Initial Orientation in the Standalone App Settings and I don't alter the orientation settings in code.  If you (or anyone else) has some advice, I'm all ears!!

-Dan


> I didn't know about that text file, but I do know about the issue. Generally speaking Android phones are in a default orientation when portrait, and generally speaking Android tablets are in a default orientation when landscape. So, for LiveCode to really let you know what's going on you have to help it know which way is default.
> 
> It does all look somewhat complicated. Are you making any assumptions in your code about whether default is portrait or landscape?
> 
>> Hi!
>> 
>> In an iOS project I have a button on the screen that when you tilt the device, it slides left or right.  Using the accelerationChanged message, this is easy.  However, now that I am trying to replicate this on Android, it's not working.  The "x" value retuned by accelerationChanged is all wrong!  I see a discussion in the Android Release Notes about this but I can't make any sense of what they are talking about:
>> 
>> "In order to correct orientation handling for this device, you must include a file named lc_device_config.txt in your APK bundle. Do this by adding the file in the Copy Files pane of the Standalone Builder. This file is used to map a device's to orientation to accelerometer value and is parsed by the Android engine on startup. If the current device matches an entry in the file, the orientation settings in that entry will be used."
>> 
>> Does anyone know what this means?  How to implement it? Or another way to deal with different devices having different 0 degree settings?
>> 
>> Thanks in advance,
>> -Dan




More information about the use-livecode mailing list