Re: Android Orientation Woes

2012-09-01 Thread Colin Holgate
I think I know what I would do, but I want to try it first before describing 
the idea. Sadly, neither the mobileSensorReading or accelerationChanged 
features appear to be working.

Can you show the code you're currently using to read the accelerometer?


On Sep 1, 2012, at 1:22 AM, Dan Friedman d...@clearvisiontech.com wrote:

 Exactly!  So, what do you do?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Android Orientation Woes

2012-09-01 Thread Dan Friedman
Colin,

Here's what I am doing.  It works PERFECTLY on iOS.  On Android (Galaxy Tab 2), 
x is a out there number!

global currentAccel

on accelerationChanged x, y, z
  put round(x*10) into currentAccel
end accelerationChanged 

on doSetCar
  put the left of btn car + (currentAccel*abs(currentAccel)) into nLeft
  if nLeft  (the left of grp theBGGroup) then
put (the left of grp theBGGroup) into nLeft
  else if nLeft + (the width of btn car)  the right of grp theBGGroup then
put (the right of grp theBGGroup)-(the width of btn car) into nLeft
  end if
  
  set the left of btn car to nLeft
  
  send doSetCar to me in 1 tick
end doSetCar


 I think I know what I would do, but I want to try it first before describing 
 the idea. Sadly, neither the mobileSensorReading or accelerationChanged 
 features appear to be working.
 
 Can you show the code you're currently using to read the accelerometer?
 
 
 On Sep 1, 2012, at 1:22 AM, Dan Friedman d...@clearvisiontech.com wrote:
 
 Exactly!  So, what do you do?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Android Orientation Woes

2012-08-31 Thread Dan Friedman
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

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Android Orientation Woes

2012-08-31 Thread Colin Holgate
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?
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Android Orientation Woes

2012-08-31 Thread Dan Friedman
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

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Android Orientation Woes

2012-08-31 Thread J. Landman Gay

On 8/31/12 4:00 PM, Dan Friedman wrote:

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?


I've tried to figure that out too. My interpretation is that you need to 
provide a list of all supported devices and somehow indicate how each 
one is to be oriented. It almost sounds like we need to figure out in 
advance the name and type of every possible Android device, but that 
can't be right. The instructions aren't clear, and the format for the 
text file isn't described.


The problem isn't just LiveCode though, it seems to be universal. My 
Android tablet has three compass apps installed, and each one thinks 
north is a different direction. None of them are right, though one 
comes close. I also have two different bubble-level apps and neither one 
can figure out which way is up, they are both upside down.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Android Orientation Woes

2012-08-31 Thread Colin Holgate
But, aren't you reading the accelerometer in order to make something slide 
around? If you're assuming that a Y rotation is what happens in the user turns 
the left edge away from them, that will be right for phones but wrong for 
tablets.


On Aug 31, 2012, at 5:37 PM, Dan Friedman d...@clearvisiontech.com wrote:

 
 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. 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Android Orientation Woes

2012-08-31 Thread Dan Friedman
Exactly!  So, what do you do?


 But, aren't you reading the accelerometer in order to make something slide 
 around? If you're assuming that a Y rotation is what happens in the user 
 turns the left edge away from them, that will be right for phones but wrong 
 for tablets.
 
 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. 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode