The place to discuss anything and everything about running your LiveCode on Android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
MaxV
- Posts: 1580
- Joined: Tue May 28, 2013 2:20 pm
-
Contact:
Post
by MaxV » Mon Feb 03, 2014 4:41 pm
Hi,
I have some question about orientation:
- In standalone application setting I put "portait" as initial orientation, but I also allow all orientations (using mobileSetAllowedOrientations). However the orientation changes correctly only when I rotate the device, but if I open the app landscape it remains "portrait", it doesn't rotate until I start to shake the device
. How can I open the app with the right orientation? Which message do I need to send?
- Orientation sensor sensitivity is to high, if I incline a little back my device, orientation starts to flick. Is there a way to set a lower sensitivity?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
Dixie
- Livecode Opensource Backer

- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
Post
by Dixie » Mon Feb 03, 2014 5:01 pm
send a 'resizeStack' message in the openStack handler, assuming that you are using that in conjunction with the orientationChanged message..
besides 'portrait', 'portrait upside down', 'landscape left' and 'landscape right'... you can also handle 'unknown', 'face up' and 'face down' orientation messages. I have used the 'face up' and 'face down' orientations before when experiencing the problems you are seeing.
-
MaxV
- Posts: 1580
- Joined: Tue May 28, 2013 2:20 pm
-
Contact:
Post
by MaxV » Mon Feb 03, 2014 5:30 pm
You solved my second question, I used
orientationChanged but for screen orientation is better
resizeStack, since
orientationChanged uses all three axis (x,y, z), and it is a mess.
About my first question, what code should I write?
I wrote
Code: Select all
on OpenStack
send resizestack to me
end OpenStack
without any result.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
Dixie
- Livecode Opensource Backer

- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
Post
by Dixie » Mon Feb 03, 2014 5:36 pm
something like...
Code: Select all
on orientationChanged
resizeStack
end orientationChanged
on resizeStack
/* update the screen to suit the change in orientation between 'portrait' & landscape' */
if environment() = "mobile" then
if "portrait" is among the words of mobileDeviceOrientation() then
-- do whatever
end if
if "landscape" is among the words of mobileDeviceOrientation() then
-- do whatever
end if
end if
end resizeStack
EDIT : if you want to send the resizestack then just issue the command 'resizeStack'.
-
MaxV
- Posts: 1580
- Joined: Tue May 28, 2013 2:20 pm
-
Contact:
Post
by MaxV » Thu Feb 06, 2014 2:29 pm
Dixie wrote:EDIT : if you want to send the resizestack then just issue the command 'resizeStack'.
I still can't obtain the correct orientation on opening the app:
- place may phone landscape
- open the app on my phone
- I get:

It' perfectly resized, but it still continue to mantain the "initial orentation setting" untill I rotate the mobile phone.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w