Android Orientation Woes

Dan Friedman dan at clearvisiontech.com
Sat Sep 1 13:32:51 EDT 2012


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 <dan at clearvisiontech.com> wrote:
> 
>>> Exactly!  So, what do you do?




More information about the use-livecode mailing list