Lack of the 'maScreenOrientation' syscall implementation on iPhone runtime

10 posts / 0 new
Last post
mbrown
mbrown's picture
Offline
Joined: 6 Nov 2011
Posts:
Lack of the 'maScreenOrientation' syscall implementation on iPhone runtime

Hi, I would just like to know whether the latest night build (February 1st) of the iPhone runtime (in MoSync SDK) implements the 'maScreenOrientation' syscall. Another blogger told that this implementation should be made in v3.0 of the MoSync SDK (see http://www.mosync.com/content/iphone-simulator-orientation-control). Thanks a lot indeed for any insights, help, ...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ovidiu
ovidiu's picture
Offline
Mobile Wizard
Joined: 27 Jan 2011
Posts:

That was me hoping for 3.0. In any case, it is done for iOS, almost done on Android and waiting its implementation on Windows Phone. And because of these, it won't get out on 3.0, but on a 3.0.1 version. In any case, it is one of the top priorities. Anyway, I was wrong and it's past the date I thought you'll have access to it.
Sorry,
Ovidiu

mbrown
mbrown's picture
Offline
Joined: 6 Nov 2011
Posts:

Hi Ovidiu,
Thanks for your reply. When you say that "it is done for iOS", does this mean that this snippet of Objective-C code can be diffed and added to the 2.7 code (i.e. iOS runtime), if not already done? I had a phone call with Patrick Broman yesterday, and it seems that an iOS runtime can be compiled with this feature on version 2.7. Is that correct?
I thank you very much for your answer.
Marc

kennethm
kennethm's picture
Offline
Joined: 22 Mar 2012
Posts:

Hi Ovidiu,

I've upgraded my mosync to 3.0.1 however the orientation for ios still does not work. Looking at the maapi.h i see the following comment :

/**

 * Set the screen orientation.
 * Currently implemented only on Android.
 * @param orientation One of the \link #SCREEN_ORIENTATION_LANDSCAPE
 * #SCREEN_ORIENTATION_PORTRAIT #SCREEN_ORIENTATION_DYNAMIC \endlink
 * constants.
 * @return \< 0 on error.

 */

IOCTLDEF int maScreenSetOrientation(int orientation) {
return (int) maIOCtl(139, orientation, 0, 0);
}

 

Does this mean that its still not included in 3.0.1 and (hopefully) scheduled for 3.1 ? 

Kenneth



Ovidiu
ovidiu's picture
Offline
Mobile Wizard
Joined: 27 Jan 2011
Posts:

Hi,

For iOS and WP7 check this out:

/**
* Set supported screen orientations.
* Currently implemented on iOS and WindowsPhone 7.1.
* @param orientations A bitmask consisting of flags describing the supported screen orientations.
* The bitmask can be created using \link #MA_SCREEN_ORIENTATION_ MA_SCREEN_ORIENTATION \endlink
* values.
* @return One of the next constants:
* - #MA_SCREEN_ORIENTATION_RES_OK
* - #MA_SCREEN_ORIENTATION_RES_NOT_SUPPORTED
* - #MA_SCREEN_ORIENTATION_RES_INVALID_VALUE
*/
int maScreenSetSupportedOrientations(in int orientations);

this is because on Android this is prety dificult to takle while the same thing can be said of maScreenSetOrientation regarding iOS and wWP7

 

kennethm
kennethm's picture
Offline
Joined: 22 Mar 2012
Posts:

Thanks for your quick reply.

So to see if I understood correctly, I simply call the method maScreenSetSupportedOrientations as follows

maScreenSetSupportedOrientations(
MA_SCREEN_ORIENTATION_LANDSCAPE_LEFT |   MA_SCREEN_ORIENTATION_LANDSCAPE_RIGHT);

and the orientation will be magically landscape ?

 

Ovidiu
ovidiu's picture
Offline
Mobile Wizard
Joined: 27 Jan 2011
Posts:

Not quite :)

maScreenSetSupportedOrientations(
        MA_SCREEN_ORIENTATION_LANDSCAPE_LEFT |             
        MA_SCREEN_ORIENTATION_LANDSCAPE_RIGHT);

This will tell the OS that the only orientations allowed are the 2 landscapes. Therefore, if the device is rotated to portrait for example, nothing will happen, but if the device is rotated from landscape right to landscape left, the change will happen. So this might not be what you want, i.e. to change the orientation through code no-matter the orientation of the device. However, we have this in mind and we've planned a meeting where to decide how to harmonize the setOrientation among the different platforms we support to date (especially Android, iOS and WP7)

kennethm
kennethm's picture
Offline
Joined: 22 Mar 2012
Posts:

That is exactly what I'm looking for. Forcing the orientation to landscape mode irrespective of the device's true orientation.

Many thanks!

 

Ovidiu
ovidiu's picture
Offline
Mobile Wizard
Joined: 27 Jan 2011
Posts:

I can't promise that it'll be done for 3.1 but you can help us prioritising by asking for it: http://www.mosync.com/content/put-all-new-feature-requests-mosync-issue-tracker :)

cheers

kennethm
kennethm's picture
Offline
Joined: 22 Mar 2012
Posts:

will do just that