MoSync 3.3
maapi.h File Reference

Syscall declarations. These system calls and low-level functions provide access to the basic features of a device. They are implemented by the MoSync runtimes in code native to the device. More...

#include "maapi_defs.h"

Defines

#define MAIDL_HASH   ((int)0x71cb80f9)
 A hash of the abstract representation of the API described in this file. Identifiers, declarations and definitions are included in the calculation of the hash, but documentation is not.
#define EXTENT_Y(e)   ((short)(e))
 Returns the height of an MAExtent.
#define EXTENT_X(e)   ((short)((e) >> 16))
 Returns the width of an MAExtent.
#define EXTENT(x, y)   ((MAExtent)((((int)(x)) << 16) | ((y) & 0xFFFF)))
 Creates an MAExtent.
#define TRANS_NONE   0
 The image is copied unchanged.
#define TRANS_ROT90   5
 The image is rotated clockwise by 90 degrees.
#define TRANS_ROT180   3
 The image is rotated clockwise by 180 degrees.
#define TRANS_ROT270   6
 The image is rotated clockwise by 270 degrees.
#define TRANS_MIRROR   2
 The image is reflected about its vertical center.
#define TRANS_MIRROR_ROT90   7
 The image is reflected about its vertical center, then rotated clockwise by 90 degrees.
#define TRANS_MIRROR_ROT180   1
 The image is reflected about its vertical center, then rotated clockwise by 180 degrees.
#define TRANS_MIRROR_ROT270   4
 The image is reflected about its vertical center, then rotated clockwise by 270 degrees.
#define HANDLE_SCREEN   0
 This handle refers to the back buffer, which is initially black.
#define HANDLE_LOCAL   0
#define RES_OUT_OF_MEMORY   -1
#define RES_BAD_INPUT   -2
#define RES_OK   1
#define MAS_CREATE_IF_NECESSARY   1
#define STERR_GENERIC   -2
 Generic error.
#define STERR_FULL   -3
 The storage medium is full.
#define STERR_NONEXISTENT   -5
 The store does not exist.
#define CONNERR_GENERIC   -2
 Generic error.
#define CONNERR_MAX   -3
 The maximum number of open connections allowed has been reached.
#define CONNERR_DNS   -4
 DNS resolution error.
#define CONNERR_INTERNAL   -5
 Internal error. Please report any occurrences.
#define CONNERR_CLOSED   -6
 The connection was closed by the remote peer.
#define CONNERR_READONLY   -7
 You attempted to write to a read-only connection.
#define CONNERR_FORBIDDEN   -8
 The OS does not trust you enough to let you open this connection.
#define CONNERR_UNINITIALIZED   -9
 No operation has been started yet.
#define CONNERR_CONLEN   -10
 The Content-Length header could not be found.
#define CONNERR_URL   -11
 You supplied a malformed URL.
#define CONNERR_UNAVAILABLE   -12
#define CONNERR_CANCELED   -13
 You canceled the operation.
#define CONNERR_PROTOCOL   -14
 The server gave an invalid response.
#define CONNERR_NETWORK   -15
 The network connection could not be established.
#define CONNERR_NOHEADER   -16
 The requested header could not be found.
#define CONNERR_NOTFOUND   -17
 The requested object could not be found.
#define CONNERR_SSL   -18
 An error occurred during SSL negotiation.
#define CONNERR_DOWNLOAD_IN_PROGRESS   -19
 A download is already in progress.
#define CONNERR_NO_ACTIVE_DOWNLOAD   -20
 There is no active download.
#define CONNERR_READER_UNAVAILABLE   -21
#define CONNERR_REDIRECT   -22
#define CONNERR_USER   -1000000
#define CONNOP_READ   1
#define CONNOP_WRITE   2
#define CONNOP_CONNECT   7
#define CONNOP_FINISH   11
#define CONNOP_ACCEPT   16
#define CONN_MAX   32
 The maximum number of open connections allowed.
#define BTADDR_LEN   6
#define CONN_FAMILY_INET4   1
#define CONN_FAMILY_BT   2
#define CONN_FAMILY_INET6   3
#define HTTP_GET   1
#define HTTP_POST   2
#define HTTP_HEAD   3
#define HTTP_PUT   4
#define HTTP_DELETE   5
#define MA_RESOURCE_OPEN   0x1
#define MA_RESOURCE_CLOSE   0x2
#define MAK_UNKNOWN   0
#define MAK_FIRST   0
#define MAK_BACKSPACE   8
#define MAK_TAB   9
#define MAK_CLEAR   12
#define MAK_RETURN   13
#define MAK_PAUSE   19
#define MAK_ESCAPE   27
#define MAK_SPACE   32
#define MAK_EXCLAIM   33
#define MAK_QUOTEDBL   34
#define MAK_POUND   35
#define MAK_HASH   35
#define MAK_GRID   35
#define MAK_DOLLAR   36
#define MAK_AMPERSAND   38
#define MAK_QUOTE   39
#define MAK_LEFTPAREN   40
#define MAK_RIGHTPAREN   41
#define MAK_ASTERISK   42
#define MAK_STAR   42
#define MAK_PLUS   43
#define MAK_COMMA   44
#define MAK_MINUS   45
#define MAK_PERIOD   46
#define MAK_SLASH   47
#define MAK_0   48
#define MAK_1   49
#define MAK_2   50
#define MAK_3   51
#define MAK_4   52
#define MAK_5   53
#define MAK_6   54
#define MAK_7   55
#define MAK_8   56
#define MAK_9   57
#define MAK_COLON   58
#define MAK_SEMICOLON   59
#define MAK_LESS   60
#define MAK_EQUALS   61
#define MAK_GREATER   62
#define MAK_QUESTION   63
#define MAK_AT   64
#define MAK_LEFTBRACKET   91
#define MAK_BACKSLASH   92
#define MAK_RIGHTBRACKET   93
#define MAK_CARET   94
#define MAK_UNDERSCORE   95
#define MAK_BACKQUOTE   96
#define MAK_A   97
#define MAK_B   98
#define MAK_C   99
#define MAK_D   100
#define MAK_E   101
#define MAK_F   102
#define MAK_G   103
#define MAK_H   104
#define MAK_I   105
#define MAK_J   106
#define MAK_K   107
#define MAK_L   108
#define MAK_M   109
#define MAK_N   110
#define MAK_O   111
#define MAK_P   112
#define MAK_Q   113
#define MAK_R   114
#define MAK_S   115
#define MAK_T   116
#define MAK_U   117
#define MAK_V   118
#define MAK_W   119
#define MAK_X   120
#define MAK_Y   121
#define MAK_Z   122
#define MAK_DELETE   127
#define MAK_KP0   256
#define MAK_KP1   257
#define MAK_KP2   258
#define MAK_KP3   259
#define MAK_KP4   260
#define MAK_KP5   261
#define MAK_KP6   262
#define MAK_KP7   263
#define MAK_KP8   264
#define MAK_KP9   265
#define MAK_KP_PERIOD   266
#define MAK_KP_DIVIDE   267
#define MAK_KP_MULTIPLY   268
#define MAK_KP_MINUS   269
#define MAK_KP_PLUS   270
#define MAK_KP_ENTER   271
#define MAK_KP_EQUALS   272
#define MAK_UP   273
#define MAK_DOWN   274
#define MAK_RIGHT   275
#define MAK_LEFT   276
#define MAK_INSERT   277
#define MAK_HOME   278
#define MAK_END   279
#define MAK_PAGEUP   280
#define MAK_PAGEDOWN   281
#define MAK_FIRE   284
#define MAK_SOFTLEFT   285
#define MAK_SOFTRIGHT   286
#define MAK_PEN   291
#define MAK_BACK   292
#define MAK_MENU   293
#define MAK_RSHIFT   303
#define MAK_LSHIFT   304
#define MAK_RCTRL   305
#define MAK_LCTRL   306
#define MAK_RALT   307
#define MAK_LALT   308
#define MAK_SEARCH   309
#define MAKB_LEFT   0x00001
#define MAKB_UP   0x00002
#define MAKB_RIGHT   0x00004
#define MAKB_DOWN   0x00008
#define MAKB_FIRE   0x00010
#define MAKB_SOFTLEFT   0x00020
#define MAKB_SOFTRIGHT   0x00040
#define MAKB_0   0x00080
#define MAKB_1   0x00100
#define MAKB_2   0x00200
#define MAKB_3   0x00400
#define MAKB_4   0x00800
#define MAKB_5   0x01000
#define MAKB_6   0x02000
#define MAKB_7   0x04000
#define MAKB_8   0x08000
#define MAKB_9   0x10000
#define MAKB_ASTERISK   0x20000
#define MAKB_STAR   0x20000
#define MAKB_HASH   0x40000
#define MAKB_POUND   0x40000
#define MAKB_GRID   0x40000
#define MAKB_CLEAR   0x80000
#define EVENT_BUFFER_SIZE   256
#define EVENT_CLOSE_TIMEOUT   2000
 In milliseconds.
#define EVENT_TYPE_CLOSE   1
#define EVENT_TYPE_KEY_PRESSED   2
#define EVENT_TYPE_KEY_RELEASED   3
#define EVENT_TYPE_CONN   4
 Connection.
#define EVENT_TYPE_BT   5
 Bluetooth discovery.
#define EVENT_TYPE_POINTER_PRESSED   8
#define EVENT_TYPE_POINTER_RELEASED   9
#define EVENT_TYPE_POINTER_DRAGGED   10
#define EVENT_TYPE_FOCUS_LOST   13
#define EVENT_TYPE_FOCUS_GAINED   14
#define EVENT_TYPE_LOCATION   16
 Has MAEvent::data point to an MALocation.
#define EVENT_TYPE_LOCATION_PROVIDER   17
 MAEvent::state is one of the MA_LPS constants.
#define EVENT_TYPE_AUDIO_PREPARED   19
 Event which is triggered when an audio has been asychronous prepared The MAEvent::audioInstance contains the prepared MAAudioInstance, or <0 if a problem happened while preparing.
#define EVENT_TYPE_AUDIO_COMPLETED   20
 Event which is triggered when a streaming audio has finished playing The MAEvent::audioInstance contains the MAAudioInstance which finished.
#define EVENT_TYPE_SCREEN_CHANGED   21
 The size of the screen has changed. Use maGetScrSize() to get the new size.
#define EVENT_TYPE_CHAR   22
 Character input. Uses MAEvent::character.
#define EVENT_TYPE_TEXTBOX   23
 The text box created by maTextBox() was just closed. Uses MAEvent::textboxResult and MAEvent::textboxLength.
#define EVENT_TYPE_HOMESCREEN_SHOWN   24
 The home screen became visible. Currently implemented only on Android and Symbian.
#define EVENT_TYPE_HOMESCREEN_HIDDEN   25
 The home screen was hidden because an application came to front. Currently implemented only on Android and Symbian.
#define EVENT_TYPE_SCREEN_STATE_ON   26
 The screen was turned on (the device went out of sleep state). Currently implemented only on Android.
#define EVENT_TYPE_SCREEN_STATE_OFF   27
 The screen was turned off (the device went into sleep state). Currently implemented only on Android.
#define EVENT_TYPE_WIDGET   28
 An event sent from a native widget.
#define EVENT_TYPE_BLUETOOTH_TURNED_OFF   29
 The bluetooth chip was turned off. Bluetooth functions will return CONNERR_UNAVAILABLE. Currently implemented only on Android.
#define EVENT_TYPE_BLUETOOTH_TURNED_ON   30
 The bluetooth chip was turned on. Bluetooth functions will now work normally again. Currently implemented only on Android.
#define EVENT_TYPE_IMAGE_PICKER   31
 The ImagePicker dialog was dismissed either by Cancel, either by OK.
#define EVENT_TYPE_SMS   32
 SMS result message. The field status contains one of the This event is sent on Android and iOS.
#define EVENT_TYPE_SENSOR   33
 Provides data from active sensors.
#define EVENT_TYPE_ALERT   34
 The maAlert message box was dismissed by one of the available buttons. See EVENT_TYPE_ALERT for the event.
#define EVENT_TYPE_NFC_TAG_RECEIVED   35
 A new NFC tag was received A new tag has been received, use maGetNextTag to retreive it.
#define EVENT_TYPE_NFC_TAG_DATA_READ   36
 New tag data was read An asynchronous NFC tag read operation was completed.
#define EVENT_TYPE_NFC_TAG_DATA_WRITTEN   37
 New tag data was written An asynchronous NFC tag write operation was completed.
#define EVENT_TYPE_NFC_BATCH_OP   38
 A batch operation was performed.
#define EVENT_TYPE_NFC_TAG_AUTH_COMPLETE   39
 Tag authentication was performed An asynchronous NFC tag authentication read was completed.
#define EVENT_TYPE_NFC_TAG_READ_ONLY   40
 Tag was made read only An asynchronous NFC tag read only operation was completed.
#define EVENT_TYPE_OPTIONS_BOX_BUTTON_CLICKED   41
#define EVENT_TYPE_ADS_BANNER   42
 Send by a banner ad.
#define EVENT_TYPE_LOCAL_NOTIFICATION   43
 Send when the application receives a local notification.
#define EVENT_TYPE_PUSH_NOTIFICATION_REGISTRATION   44
 Send when the application receives a registration result. The application tries to register to Apple Push Service, or Google GCM/C2DM Service, and the received result ( either success, either fail) is sending this event. After this event is received, get the result of the registration request by calling maNotificationPushGetRegistration.
#define EVENT_TYPE_PUSH_NOTIFICATION_UNREGISTRATION   45
 Send when the application receives an unregistration result. The application unregistered from Google GCM/C2DM Service, and will not receive anymore push messages. Platform: Android only.
#define EVENT_TYPE_PUSH_NOTIFICATION   46
 Send when the application receives a push notification.
#define EVENT_TYPE_CAPTURE   47
 Send before the Native Image Picker is dismissed. This event will contain a MACaptureEventData struct.
#define EVENT_TYPE_PURCHASE   48
 Send by the Purchase API. This event will contain a MAPurchaseEventData struct.
#define EVENT_TYPE_CAMERA_PREVIEW   49
 A camera event fired when you get any of the camera preview events.
#define EVENT_TYPE_NETWORK   50
 The telephone network status changed. MAEvent::state is the new state, one of the MA_NETWORK constants.
#define EVENT_TYPE_ORIENTATION_DID_CHANGE   51
 Sent when the current screen orientation has changed. MAEvent::orientation is the new screen orientation. One of the constants MA_SCREEN_ORIENTATION .
#define EVENT_TYPE_ORIENTATION_WILL_CHANGE   52
 Sent just before the current screen orientation starts changing. Platform: iOS only.
#define EVENT_TYPE_CAMERA_SNAPSHOT   53
 Used to notify when the snapshot taken via maCameraSnapshotAsync, is completed. The events of this type contain the handler for the image data, the image size, the data representation and a return code.
#define EVENT_TYPE_ALERT_DISMISSED   54
 Send by maAlert dialog being canceled by user dimissing it.
#define EVENT_TYPE_MEDIA_EXPORT_FINISHED   55
 Used to notify when an operation of exporting files, from the application to the device storages, reached the finish point.
#define RUNTIME_MORE   1
 The MoSync Reference Environment, also known as the Emulator.
#define RUNTIME_JAVA   2
 Java ME.
#define RUNTIME_SYMBIAN   3
 Symbian.
#define RUNTIME_WINCE   4
 Windows CE, also known as Windows Mobile.
#define REPORT_PANIC   1
 Caused by a MoSync Panic. MAPanicReport::code is the panic code.
#define REPORT_EXCEPTION   2
 Caused by a native exception. MAPanicReport::string describes the exception.
#define REPORT_PLATFORM_CODE   3
 Caused by a platform-specific error. MAPanicReport::code is valid.
#define REPORT_USER_PANIC   4
#define REPORT_TIMEOUT   5
 Caused by the Close event timeout. Neither code or string are valid.
#define MA_EXTENSION_MODULE_UNAVAILABLE   -1
#define MA_EXTENSION_FUNCTION_UNAVAILABLE   -1
#define FONT_TYPE_SERIF   0
#define FONT_TYPE_SANS_SERIF   1
#define FONT_TYPE_MONOSPACE   2
#define FONT_STYLE_NORMAL   0
#define FONT_STYLE_BOLD   1
#define FONT_STYLE_ITALIC   2
#define RES_FONT_OK   1
 Indicates that the call to a font syscall was successful.
#define RES_FONT_INVALID_HANDLE   -1
 Indicates that an invalid font handle was passed.
#define RES_FONT_INDEX_OUT_OF_BOUNDS   -2
 Indicates that the index was off the list size.
#define RES_FONT_NO_TYPE_STYLE_COMBINATION   -3
 Indicates that a default font with that combination does not exist.
#define RES_FONT_NAME_NONEXISTENT   -4
 Indicates that there is no font with that name on the device.
#define RES_FONT_LIST_NOT_INITIALIZED   -5
 Indicates that maFontGetCount() was not called first.
#define RES_FONT_INSUFFICIENT_BUFFER   -6
 Indicates that the buffer is not big enough to store the font name.
#define RES_FONT_INVALID_SIZE   -7
 Indicates that an invalid size was passed.
#define RES_FONT_DELETE_DENIED   -8
 Indicates that the font cannot be deleted because it is in use. maFontDelete(handle) fails with this return code.
#define MA_LOC_NONE   1
#define MA_LOC_INVALID   2
#define MA_LOC_UNQUALIFIED   3
#define MA_LOC_QUALIFIED   4
#define MA_LPS_AVAILABLE   1
#define MA_LPS_TEMPORARILY_UNAVAILABLE   2
#define MA_LPS_OUT_OF_SERVICE   3
#define MA_ACCESS_READ   1
#define MA_ACCESS_READ_WRITE   3
#define MA_SEEK_SET   0
 Beginning of file.
#define MA_SEEK_CUR   1
 Current position.
#define MA_SEEK_END   2
 End of file.
#define MA_FL_SORT_NONE   0
 Don't sort the files.
#define MA_FL_SORT_DATE   1
 Sort the files by date. See maFileDate().
#define MA_FL_SORT_NAME   2
 Sort the files by name. Case-sensitive?
#define MA_FL_SORT_SIZE   3
 Sort the files by size. See maFileSize().
#define MA_FL_ORDER_ASCENDING   0x10000
 Oldest / smallest / A first.
#define MA_FL_ORDER_DESCENDING   0x20000
 Newest / biggest / Z first.
#define MA_MEDIA_TYPE_UNKNOWN   -1
 Indicatest an unknown multimedia type.
#define MA_MEDIA_TYPE_IMAGE   0
 Indicates an image type. This is used in multimedia operations.
#define MA_MEDIA_RES_OK   0
 Indicates that the multimedia operation was successful.
#define MA_MEDIA_RES_IMAGE_EXPORT_FAILED   -2
 Indicatest that the operation of exporting an image failed.
#define MA_FPROP_IS_BACKED_UP   1
#define MA_FERR_GENERIC   -2
#define MA_FERR_NOTFOUND   -3
#define MA_FERR_FORBIDDEN   -4
#define MA_FERR_RENAME_FILESYSTEM   -5
#define MA_FERR_RENAME_DIRECTORY   -6
#define MA_FERR_WRONG_TYPE   -7
#define MA_FERR_SORTING_UNSUPPORTED   -8
 The sorting method requested is unsupported on the current platform.
#define MA_FERR_NO_SUCH_PROPERTY   -9
#define MA_SMS_RESULT_SENT   1
 The SMS was sent.
#define MA_SMS_RESULT_NOT_SENT   2
 The SMS was NOT sent.
#define MA_SMS_RESULT_DELIVERED   3
 The SMS was delivered.
#define MA_SMS_RESULT_NOT_DELIVERED   4
 The SMS was NOT delivered.
#define MA_NETWORK_UNKNOWN   0
#define MA_NETWORK_NO_SERVICE   1
#define MA_NETWORK_EMERGENCY_ONLY   2
#define MA_NETWORK_SEARCHING   3
#define MA_NETWORK_BUSY   4
#define MA_NETWORK_HOME   5
#define MA_NETWORK_DENIED   6
#define MA_NETWORK_ROAMING   7
#define MA_IAP_METHOD_STANDARD   1
#define MA_IAP_METHOD_WLAN   2
#define MA_IAP_FILTER_NOT_WLAN   1
 All IAPs except WLAN.
#define MA_IAP_FILTER_WLAN   2
 Only WLAN IAPs.
#define MA_IAP_FILTER_ALL   3
 All IAPs. This is the default.
#define MA_CAMERA_SNAPSHOT_MAX_SIZE   -1
 A constant that represents the maximum snapshot size.
#define MA_CAMERA_CONST_BACK_CAMERA   0
 A constant that represents the flash being on.
#define MA_CAMERA_CONST_FRONT_CAMERA   1
 A constant that represents the flash being in the automatic mode.
#define MA_CAMERA_RES_OK   1
 A constant that represents successful camera operation.
#define MA_CAMERA_RES_FAILED   -2
 A constant that represents a failed camera operation.
#define MA_CAMERA_RES_NOT_STARTED   -3
 A constant that represents a camera failing to start.
#define MA_CAMERA_RES_PROPERTY_NOTSUPPORTED   -4
 A constant that represents a property not supported by the device.
#define MA_CAMERA_RES_INVALID_PROPERTY_VALUE   -5
 A constant that represents an invalid value for that property.
#define MA_CAMERA_RES_VALUE_NOTSUPPORTED   -6
 A constant that represents a property value not supported by the device.
#define MA_CAMERA_RES_EVENTS_ALREADY_ENABLED   -7
 Another type of camera preview events has aldready been enabled.
#define MA_CAMERA_RES_INVALID_PREVIEW_SIZE   -8
 The size of the screen which you want to read from the preview is not withing the visual area.
#define MA_CAMERA_RES_SNAPSHOT_IN_PROGRESS   -9
 Snapshot operation is in progress. Used when trying to restart a camera or when trying to take another snapshot while a snapshot is in progress.
#define MA_CAMERA_FLASH_ON   "on"
 A constant that represents the flash being on.
#define MA_CAMERA_FLASH_AUTO   "auto"
 A constant that represents the flash being in the automatic mode.
#define MA_CAMERA_FLASH_OFF   "off"
 A constant that represents the flash being off.
#define MA_CAMERA_FLASH_TORCH   "torch"
 A constant that represents the flash being in the torch mode.
#define MA_CAMERA_FOCUS_AUTO   "auto"
 A constant that represents the focus mode being automatic.
#define MA_CAMERA_FOCUS_INFINITY   "infinity"
 A constant that turns the camera to focus to infinity.
#define MA_CAMERA_FOCUS_MACRO   "macro"
 A constant that turns the camera to macro mode.
#define MA_CAMERA_FOCUS_FIXED   "fixed"
 A constant that sets the camera to fixed focus mode.
#define MA_CAMERA_IMAGE_JPEG   "jpeg"
 A constant that represents JPEG image format.
#define MA_CAMERA_IMAGE_RAW   "raw"
 A constant that represents RAW image format.
#define MA_IMAGE_REPRESENTATION_UNKNOWN   -1
 An integer constant that represents unknown image format.
#define MA_IMAGE_REPRESENTATION_RAW   0
 An integer constant that represents RAW image format.
#define MA_IMAGE_REPRESENTATION_JPEG   1
 An integer constant that represents JPEG image format.
#define MA_IMAGE_REPRESENTATION_PNG   2
 An integer constant that represents PNG image format.
#define MA_CAMERA_FLASH_MODE   "flash-mode"
 Sets the flash mode for the camera.
#define MA_CAMERA_FOCUS_MODE   "focus-mode"
 Sets the focus mode for the camera.
#define MA_CAMERA_IMAGE_FORMAT   "image-format"
 Sets the image format for the camera.
#define MA_CAMERA_ZOOM   "zoom"
 Sets the zoom level for the camera.
#define MA_CAMERA_MAX_ZOOM   "max-zoom"
 Provides the information about the maximum supported zoom level on the device.
#define MA_CAMERA_ZOOM_SUPPORTED   "zoom-supported"
 Indicates that if the device supports zoom or not.
#define MA_CAMERA_FLASH_SUPPORTED   "flash-supported"
 Indicates that if the device has a flash or not.
#define MA_CAMERA_PREVIEW_FRAME   1
#define MA_CAMERA_PREVIEW_AUTO_FOCUS   2
#define MA_TB_TYPE_ANY   0
 The user is allowed to enter any text, including line breaks.
#define MA_TB_TYPE_EMAILADDR   1
 The user is allowed to enter an e-mail address.
#define MA_TB_TYPE_NUMERIC   2
 The user is allowed to enter an integer value.
#define MA_TB_TYPE_PHONENUMBER   3
 The user is allowed to enter a phone number.
#define MA_TB_TYPE_URL   4
 The user is allowed to enter a URL.
#define MA_TB_TYPE_DECIMAL   5
#define MA_TB_TYPE_SINGLE_LINE   100
 The user is allowed to enter any text, except for line breaks. Unavailable on some platforms. In that case, maTextBox() will return MA_TB_RES_TYPE_UNAVAILABLE. You can use MA_TB_TYPE_ANY instead.
#define MA_TB_TYPE_MASK   0xFFFF
#define MA_TB_RES_OK   1
 The user chose OK.
#define MA_TB_RES_CANCEL   2
 The user chose Cancel.
#define MA_TB_RES_TYPE_UNAVAILABLE   -3
 The specified type is unavailable on this platform.
#define MA_TB_FLAG_PASSWORD   0x10000
#define MA_TB_FLAG_UNEDITABLE   0x20000
 Indicates that editing is disallowed.
#define MA_TB_FLAG_SENSITIVE   0x40000
#define MA_TB_FLAG_NON_PREDICTIVE   0x80000
#define MA_TB_FLAG_INITIAL_CAPS_WORD   0x100000
#define MA_TB_FLAG_INITIAL_CAPS_SENTENCE   0x200000
#define NOTIFICATION_TYPE_APPLICATION_LAUNCHER   1
#define MA_WAKE_LOCK_ON   1
 Application will run with screen on (consumes power).
#define MA_WAKE_LOCK_OFF   2
 Turn off the wake lock.
#define MA_TOAST_DURATION_SHORT   0
 The toast timeout. Toasts can be displayed using maToast.
#define MA_TOAST_DURATION_LONG   1
#define MA_IMAGE_PICKER_ITEM_ENCODING_PNG   1
#define MA_IMAGE_PICKER_ITEM_ENCODING_JPEG   2
#define MA_IMAGE_PICKER_EVENT_RETURN_TYPE_IMAGE_HANDLE   1
#define MA_IMAGE_PICKER_EVENT_RETURN_TYPE_IMAGE_DATA   2
#define SENSOR_TYPE_ACCELEROMETER   1
#define SENSOR_TYPE_MAGNETIC_FIELD   2
#define SENSOR_TYPE_ORIENTATION   3
#define SENSOR_TYPE_GYROSCOPE   4
#define SENSOR_TYPE_PROXIMITY   5
#define SENSOR_TYPE_COMPASS   6
#define SENSOR_RATE_FASTEST   0
#define SENSOR_RATE_GAME   -1
#define SENSOR_RATE_NORMAL   -2
#define SENSOR_RATE_UI   -3
#define SENSOR_ERROR_NONE   0
#define SENSOR_ERROR_NOT_AVAILABLE   -1
#define SENSOR_ERROR_INTERVAL_NOT_SET   -2
#define SENSOR_ERROR_ALREADY_ENABLED   -3
#define SENSOR_ERROR_NOT_ENABLED   -4
#define SENSOR_ERROR_CANNOT_DISABLE   -5
#define UIDEVICE_ORIENTATION_UNKNOWN   0
#define UIDEVICE_ORIENTATION_PORTRAIT   1
#define UIDEVICE_ORIENTATION_PORTRAIT_UPSIDE_DOWN   2
#define UIDEVICE_ORIENTATION_LANDSCAPE_LEFT   3
#define UIDEVICE_ORIENTATION_LANDSCAPE_RIGHT   4
#define UIDEVICE_ORIENTATION_FACE_UP   5
#define UIDEVICE_ORIENTATION_FACE_DOWN   6
#define SENSOR_PROXIMITY_VALUE_FAR   0
#define SENSOR_PROXIMITY_VALUE_NEAR   1
#define MA_NFC_NOT_AVAILABLE   -1
#define MA_NFC_NOT_ENABLED   -2
#define MA_NFC_INVALID_TAG_TYPE   -2
#define MA_NFC_TAG_CONNECTION_LOST   -3
#define MA_NFC_TAG_NOT_CONNECTED   -4
#define MA_NFC_FORMAT_FAILED   -5
#define MA_NFC_TAG_IO_ERROR   -127
#define MA_NFC_TAG_TYPE_NDEF   1
#define MA_NFC_TAG_TYPE_MIFARE_CL   2
#define MA_NFC_TAG_TYPE_MIFARE_UL   3
#define MA_NFC_TAG_TYPE_NFC_A   4
#define MA_NFC_TAG_TYPE_NFC_B   5
#define MA_NFC_TAG_TYPE_ISO_DEP   6
#define MA_NFC_TAG_TYPE_NDEF_FORMATTABLE   128
#define MA_NFC_NDEF_TNF_EMPTY   0
#define MA_NFC_NDEF_TNF_WELL_KNOWN   1
#define MA_NFC_NDEF_TNF_MIME_MEDIA   2
#define MA_NFC_NDEF_TNF_ABSOLUTE_URI   3
#define MA_NFC_NDEF_TNF_EXTERNAL_TYPE   4
#define MA_NFC_NDEF_TNF_UNKNOWN   5
#define MA_NFC_NDEF_TNF_UNCHANGED   6
#define MA_NFC_NDEF_TNF_RESERVED   7
#define MA_NFC_MIFARE_KEY_A   1
#define MA_NFC_MIFARE_KEY_B   2
#define MA_DB_TYPE_NULL   1
#define MA_DB_TYPE_INT   2
#define MA_DB_TYPE_INT64   3
#define MA_DB_TYPE_DOUBLE   4
#define MA_DB_TYPE_BLOB   5
#define MA_DB_TYPE_DATA   6
#define MA_DB_TYPE_TEXT   7
#define MA_DB_OK   0
#define MA_DB_ERROR   -2
#define MA_DB_NO_ROW   -3
#define MA_DB_NULL   -4
#define MA_AUDIO_DATA_STREAM   1
#define MA_AUDIO_ERR_OK   0
#define MA_AUDIO_ERR_INVALID_INSTANCE   -2
#define MA_AUDIO_ERR_INVALID_DATA   -3
#define MA_AUDIO_ERR_INVALID_FILENAME   -4
#define MA_AUDIO_ERR_INVALID_FILE   -5
#define MA_AUDIO_ERR_STREAMING_NOT_SUPPORTED   -6
#define MA_AUDIO_ERR_VOLUME_OUT_OF_RANGE   -7
#define MA_AUDIO_ERR_POSITION_OUT_OF_RANGE   -8
#define MA_AUDIO_ERR_INVALID_SOUND_FORMAT   -9
#define MA_AUDIO_ERR_OUT_OF_MEMORY   -10
#define MA_AUDIO_ERR_ALREADY_PREPARED   -11
#define MA_AUDIO_ERR_PREPARE_FAILED   -12
#define MA_AUDIO_ERR_IS_PLAYING   -13
#define MA_AUDIO_ERR_GENERIC   -14
#define MA_ADS_RES_OK   0
 Indicates that the call was successful.
#define MA_ADS_RES_INVALID_LAYOUT_HANDLE   -1
 Indicates that the call to a maAdsAddBannerToScreen or maAdsRemoveBannerFromScreen received an invalid layout handle.
#define MA_ADS_RES_INVALID_BANNER_HANDLE   -2
 Indicates that the call to a banner function received an invalid banner handle.
#define MA_ADS_RES_INVALID_PROPERTY_NAME   -3
 Indicates that the call to maAdsBannerSetProperty or maAdsBannerGetProperty received an invalid property name.
#define MA_ADS_RES_INVALID_PROPERTY_VALUE   -4
 Indicates that the call to maAdsBannerSetProperty or maAdsBannerGetProperty received an invalid property value.
#define MA_ADS_RES_INVALID_STRING_BUFFER_SIZE   -5
 Indicates that the call to maAdsBannerSetProperty needs a larger buffer.
#define MA_ADS_RES_ERROR   -6
 Indicates that the call to an Ad syscall was unsuccessful.
#define MA_ADS_RES_UNSUPPORTED   -7
 Indicates that ads are not supported on current platform.
#define MA_ADS_ERROR_INTERNAL   -1
 Indicates that something happened internally: for instance, the Activity may have been destroyed mid-refresh. Platform: Android.
#define MA_ADS_ERROR_INVALID_REQUEST   -2
 Indicates that the ad request is invalid. Platform: Android.
#define MA_ADS_ERROR_NETWORK   -3
 Indicates that the connection to the advertisements server failed. Platform: Android, iOS and Windows Phone 7.1.
#define MA_ADS_ERROR_NO_FILL   -4
 Indicates that no ad was returned due to lack of ad inventory. Platform: Android, iOS and Windows Phone 7.1.
#define MA_ADS_ERROR_CONFIGURATION   -5
 Indicates that your application has not been configured to receive advertisements. Platform: iOS.
#define MA_ADS_ERROR_NO_CONTENT   -6
 Indicates that the banner is visible, but no advertisement is shown. Your application must always hide the banner when it does not have an advertisement to display. Platform: iOS.
#define MA_ADS_ERROR_APPLICATION_INACTIVE   -7
 Indicates that ad content is not available because the application is not currently active. Platform: iOS.
#define MA_ADS_HEIGHT   "height"
 Gets the height of the ads banner. The view will have no size until the ad is loaded.
#define MA_ADS_WIDTH   "width"
 Gets the width of the ads banner. The view will have no size until the ad is loaded.
#define MA_ADS_VISIBLE   "visible"
 Sets whether the banner is visible or not. Layouts ignore invisible widgets. The banner is visible by default.
#define MA_ADS_ENABLED   "enabled"
 Sets whether the banner is enabled or not. If disabled, the user cannot interact with it. Ads are enabled by default.
#define MA_ADS_TEST_DEVICE   "testDevice"
 Sets the devices that are going to receive test ads only. You should utilize this property during development to avoid generating false impressions. Available only on Android.
#define MA_ADS_REQUEST_CONTENT   "requestContent"
 Sets the request state of the ads. If set to true ads are starting to be requested, if set to false the request for ads is stopped. After requesting for content no other property setter will be taken into account.
#define MA_ADS_IS_READY   "isReady"
 Returns true if the ad is successfully loaded and is ready to be shown. Available only on Android.
#define MA_ADS_COLOR_BG   "colorBg"
 Sets the coloration of test ads, specifically the background color.
#define MA_ADS_COLOR_BG_TOP   "colorBgTop"
 Sets the coloration of test ads,specifically the gradient background color at top.
#define MA_ADS_COLOR_BORDER   "colorBorder"
 Sets the coloration of test ads, specfiically the border color.
#define MA_ADS_COLOR_LINK   "colorLink"
 Sets the coloration of test ads, specfiically the link text color.
#define MA_ADS_COLOR_TEXT   "colorText"
 Sets the coloration of test ads, specfiically the text color.
#define MA_ADS_COLOR_URL   "colorUrl"
 Sets the coloration of test ads, specfiically the url color.
#define MA_ADS_SIZE_BANNER   0
#define MA_ADS_SIZE_RECT   1
#define MA_ADS_SIZE_IAB_BANNER   2
#define MA_ADS_SIZE_LEADERBOARD   3
#define MA_ADS_SIZE_WP7_XLARGE   4
#define MA_ADS_SIZE_WP7_XXLARGE   5
#define MA_ADS_EVENT_FAILED   0
#define MA_ADS_EVENT_LOADED   1
#define MA_ADS_EVENT_ON_DISMISS   2
#define MA_ADS_EVENT_ON_LEAVE_APPLICATION   3
#define MA_NOTIFICATION_RES_OK   0
 Indicates that the call was successful.
#define MA_NOTIFICATION_RES_INVALID_HANDLE   -1
 Indicates that the syscall received an invalid local notification handle.
#define MA_NOTIFICATION_RES_INVALID_PROPERTY_NAME   -3
 Indicates that the call to maNotificationLocalSetProperty or maNotificationLocalGetProperty received an invalid property name.
#define MA_NOTIFICATION_RES_INVALID_PROPERTY_VALUE   -4
 Indicates that the call to maNotificationLocalSetProperty or maNotificationLocalGetProperty received an invalid property value.
#define MA_NOTIFICATION_RES_INVALID_STRING_BUFFER_SIZE   -5
 Indicates that the call to maNotificationLocalGetProperty or maNotificationPushGetData needs a larger buffer.
#define MA_NOTIFICATION_RES_UNSUPPORTED   -6
 Indicates that notifications are not supported on current platform.
#define MA_NOTIFICATION_RES_ALREADY_SCHEDULED   -7
 Indicates that maNotficationLocalSetProperty cannot be called after scheduling via maNotificationLocalSchedule, or that the call to maNotificationLocalSchedule failed because the notification was already scheduled.
#define MA_NOTIFICATION_RES_CANNOT_UNSCHEDULE   -8
 Indicates that the call to maNotificationLocalUnschedule failed because the notification was not scheduled.
#define MA_NOTIFICATION_RES_ALREADY_REGISTERED   -9
 Indicates that the call to maNotificationPushRegister was unsuccessful because the application is already registered for receiving push notification.
#define MA_NOTIFICATION_RES_NOT_REGISTERED   -10
 Indicates that the call to maNotificationPushUnregister was unsuccessful because the application is not registered for receiving push notification.
#define MA_NOTIFICATION_RES_REGISTRATION_IN_PROGRESS   -11
 Indicates that the call to maNotificationPushRegister was unsuccessful because the application did not finish processing a previous registration request.
#define MA_NOTIFICATION_RES_REGISTRATION_SERVICE_NOT_AVAILABLE   -12
 Indicates that the call to maNotificationPushRegister was unsuccesfull because the device can't read the response, or there was a 500/503 from the server that can be retried later. The application should use exponential back off and retry. Platform: Android only.
#define MA_NOTIFICATION_RES_REGISTRATION_ACCOUNT_MISSING   -13
 Indicates that the call to maNotificationPushRegister was unsuccesfull because there is no Google account on the phone. The application should ask the user to open the account manager and add a Google account. Platform: Android only.
#define MA_NOTIFICATION_RES_REGISTRATION_AUTHENTICATION_FAILED   -14
 Indicates that the call to maNotificationPushRegister was unsuccesfull because the password was bad. The application should ask the user to enter his/her password, and let user retry manually later. Platform: Android only.
#define MA_NOTIFICATION_RES_REGISTRATION_TOO_MANY_REGISTRATIONS   -15
 Indicates that the call to maNotificationPushRegister was unsuccesfull because the user has too many applications registered. The application should tell the user to uninstall some other applications, let user retry manually. Platform: Android only.
#define MA_NOTIFICATION_RES_REGISTRATION_INVALID_SENDER   -16
 Indicates that the call to maNotificationPushRegister was unsuccesfull because the sender account is not recognized. Platform: Android only.
#define MA_NOTIFICATION_RES_REGISTRATION_PHONE_REGISTRATION_ERROR   -17
 Indicates that the call to maNotificationPushRegister was unsuccesfull because of incorrect phone registration with Google. This phone doesn't currently support GCM/C2DM. Platform: Android only.
#define MA_NOTIFICATION_RES_REGISTRATION_MESSAGE_BUF_TOO_SMALL   -18
 Indicates that the call to maNotificationPushGetRegistration needs a larger buffer.
#define MA_NOTIFICATION_RES_REGISTRATION_NOT_CALLED   -19
 Indicates that the call to maNotificationPushGetRegistration occured before trying to register.
#define MA_NOTIFICATION_RES_ERROR   -20
 Indicates that the call to an notification syscall was unsuccessful.
#define MA_NOTIFICATION_FLAG_INSISTENT   4
#define MA_NOTIFICATION_FLAG_NO_CLEAR   32
#define MA_NOTIFICATION_FLAG_HIGH_PRIORITY   128
#define MA_NOTIFICATION_FLAG_AUTO_CANCEL   16
#define MA_NOTIFICATION_DISPLAY_FLAG_DEFAULT   0
#define MA_NOTIFICATION_DISPLAY_FLAG_ANYTIME   1
#define MA_NOTIFICATION_PUSH_TYPE_BADGE   1
 The application accepts notifications that badge the application icon. Platform: iOS only.
#define MA_NOTIFICATION_PUSH_TYPE_SOUND   2
 The application accepts alert sounds as notifications. Platform: iOS only.
#define MA_NOTIFICATION_PUSH_TYPE_ALERT   4
 The application accepts alert messages as notifications. This is the only push notification type that is supported by both Android and iOS.
#define MA_NOTIFICATION_LOCAL_BADGE_NUMBER   "badge_number"
 Set the number displayed on the application's icon badge. Platform: iOS.
#define MA_NOTIFICATION_LOCAL_FIRE_DATE   "fire_date"
 Set the date and time when the system should deliver the notification. The notification will be fired when the system time is equal to the given param time value.
#define MA_NOTIFICATION_LOCAL_CONTENT_BODY   "content_body"
 Set the message displayed in the notification alert. Platform: Android and iOS.
#define MA_NOTIFICATION_LOCAL_ALERT_ACTION   "alert_action"
 Set the title of the action button or slider. Platform: iOS.
#define MA_NOTIFICATION_LOCAL_PLAY_SOUND   "play_sound"
 Enable/disable the sound played when an alert is displayed. Platform: iOS and Android. If set to true, it will play the default sound.
#define MA_NOTIFICATION_LOCAL_SOUND_PATH   "soundPath"
 Set the sound to play when an alert is displayed. The sound file should be saved in a notifications folder under sdcard storage. Note that some devices can only play notification sounds stored in the internal storage, in the folder. Platform: Android.
#define MA_NOTIFICATION_LOCAL_CONTENT_TITLE   "contentTitle"
 Set the title that goes in the expanded entry of the notification. Platform: Android.
#define MA_NOTIFICATION_LOCAL_TICKER_TEXT   "tickerText"
 The text that flows by in the status bar when the notification first activates. Platform: Android.
#define MA_NOTIFICATION_LOCAL_FLAG   "flag"
 Set the flags applied to the local notification. Platform: Android.
#define MA_NOTIFICATION_LOCAL_DISPLAY_FLAG   "displayFlag"
 Set the display flag applied to the local notification.
#define MA_NOTIFICATION_LOCAL_VIBRATE   "vibrate"
 Enable/disable the the default vibration when an alert is displayed. Platform: Android only. If set to true, it will use the default notification vibrate. This will ignore any given vibrate. Using phone vibration requires the VIBRATE permission.
#define MA_NOTIFICATION_LOCAL_VIBRATE_DURATION   "vibrateDuration"
 Set the vibration duration when an alert is displayed. Platform: Android only. Using phone vibration requires the VIBRATE permission.
#define MA_NOTIFICATION_LOCAL_FLASH_LIGHTS   "flashLights"
 Enable/Disable the default notification lights. This will ignore the MA_NOTIFICATION_LOCAL_FLASH_LIGHTS_PATTERN. Not every color in the spectrum is supported by the device LEDs, and not every device supports the same colors, so the hardware estimates to the best of its ability. Green is the most common notification color. Platform: Android only.
#define MA_NOTIFICATION_LOCAL_FLASH_LIGHTS_PATTERN   "flashLightsPattern"
 Define your own color and pattern for the lights. Not every color in the spectrum is supported by the device LEDs, and not every device supports the same colors, so the hardware estimates to the best of its ability. Green is the most common notification color. Also, not all Android devices support this feature. Platform: Android only.
#define MA_CAPTURE_RES_OK   0
 Indicates that the call was successful. Platform: Android and iOS.
#define MA_CAPTURE_RES_FILE_INVALID_NAME   -1
 The given file name is invalid. Platform: iOS.
#define MA_CAPTURE_RES_FILE_ALREADY_EXISTS   -2
 The file already exists. Platform: iOS.
#define MA_CAPTURE_RES_INVALID_PROPERTY   -3
 Indicates that the call to maCaptureSetProperty or maCaptureGetProperty received an invalid property name. Platform: iOS and Android.
#define MA_CAPTURE_RES_INVALID_PROPERTY_VALUE   -4
 Indicates that the call to maCaptureSetProperty or maCaptureGetProperty received an invalid property value. Platform: iOS and Android.
#define MA_CAPTURE_RES_INVALID_STRING_BUFFER_SIZE   -5
 Indicates that the call to maCaptureGetProperty needs a larger buffer. Platform: iOS and Android.
#define MA_CAPTURE_RES_INVALID_ACTION   -6
 Indicates that the call to maCaptureAction received an invalid action type. Platform: iOS and Android.
#define MA_CAPTURE_RES_INVALID_HANDLE   -7
 Indicates that the call to maCaptureDestroyData received an invalid handle. Platform: iOS and Android.
#define MA_CAPTURE_RES_UNSUPPORTED   -8
 Indicates that capture is not supported on current platform. Platform: iOS.
#define MA_CAPTURE_RES_CAMERA_NOT_AVAILABLE   -9
 Indicates that camera is not available at the moment. Platform: iOS.
#define MA_CAPTURE_RES_VIDEO_NOT_SUPPORTED   -10
 Indicates that video recording is not supported. Platform: iOS.
#define MA_CAPTURE_RES_PICTURE_NOT_SUPPORTED   -11
 Indicates that camera picture mode is not supported. Platform: iOS.
#define MA_CAPTURE_RES_FLASH_NOT_SUPPORTED   -12
 Indicates that flash mode is not supported. Platform: iOS.
#define MA_CAPTURE_RES_MAX_DURATION_NOT_SUPPORTED   -13
 Indicates that the recording max duration is not supported. Platform: Android.
#define MA_CAPTURE_RES_PROPERTY_VALUE_UNDEFINED   -14
 Indicates that a call to maCaptureGetProperty was unsuccessfull because the property was not previously set. Platform: Android.
#define MA_CAPTURE_MAX_DURATION   "maxDuration"
 Maximum duration video that should be recorded, in seconds. Platform: Android and iOS.
#define MA_CAPTURE_VIDEO_QUALITY   "videoQuality"
 Set the video recording quality. Platform: Android and iOS. Android: Note that some devices the default camera either does not support low-res video capture, or it doesn't understand/process the MediaStore.EXTRA_SIZE_LIMIT correctly.
#define MA_CAPTURE_CAMERA_ROLL   "cameraRoll"
 Store the recorded movie/taken photo to the user’s Camera Roll album. Platform: iOS.
#define MA_CAPTURE_FLASH   "flash"
 Set the flash mode used by the active camera. Platform: iOS.
#define MA_CAPTURE_CAMERA_CONTROLS   "cameraControls"
 Show/hide default camera controls.
#define MA_CAPTURE_VIDEO_QUALITY_LOW   0
#define MA_CAPTURE_VIDEO_QUALITY_HIGH   1
#define MA_CAPTURE_VIDEO_QUALITY_MEDIUM   2
#define MA_CAPTURE_ACTION_RECORD_VIDEO   0
#define MA_CAPTURE_ACTION_STOP_RECORDING   1
#define MA_CAPTURE_ACTION_TAKE_PICTURE   2
#define MA_CAPTURE_EVENT_TYPE_IMAGE   0
#define MA_CAPTURE_EVENT_TYPE_VIDEO   1
#define MA_CAPTURE_EVENT_TYPE_CANCEL   2
#define MA_CAPTURE_FLASH_AUTO   0
#define MA_CAPTURE_FLASH_ON   1
#define MA_CAPTURE_FLASH_OFF   2
#define MA_PURCHASE_RES_OK   0
 No error occurred.
#define MA_PURCHASE_RES_UNAVAILABLE   -1
 Indicates that in app-purchase is not available because the API version is not compatible or the user is not eligible to make in-app purchases (for example, the user resides in a country that prohibits in-app purchases). Platform: Android only.
#define MA_PURCHASE_RES_CONNECTION_ERROR   -2
 Indicates that there was an error connecting with the Google Play application. Platform: Android.
#define MA_PURCHASE_RES_OUT_OF_DATE   -3
 Indicates that the maPurchaseSupported() call failed because the Google Play application is out of date and needs to be updated. In this case, you can provide users with an error message that contains a link to the Updating Google Play Help topic. Platform: Android.
#define MA_PURCHASE_RES_DISABLED   -4
 Returned by the maPurchaseSupported() and maPurchaseGetField() syscalls if purchase is not allowed on the device. Platform: Android and iOS.
#define MA_PURCHASE_RES_INVALID_HANDLE   -5
 Returned by the maPurchaseGetName(), maPurchaseVerifyReceipt(), maPurchaseGetField() or maPurchaseDestroy() syscalls if the productHandle is invalid. Platform: Android and iOS.
#define MA_PURCHASE_RES_BUFFER_TOO_SMALL   -6
 Returned by the maPurchaseGetName() syscall if the the given buffer is too small. Platform: Android and iOS.
#define MA_PURCHASE_RES_RECEIPT_NOT_AVAILABLE   -7
 Returned by the maPurchaseGetField() syscall if the receipt has not been received or if the transaction is invalid.
#define MA_PURCHASE_RES_INVALID_FIELD_NAME   -8
 Returned by the maPurchaseGetField() syscall if the receipt does not contain the given field.
#define MA_PURCHASE_RES_MALFORMED_PUBLIC_KEY   -9
#define MA_PURCHASE_ERROR_INVALID_HANDLE   -1
 Possible error code for MA_PURCHASE_EVENT_REQUEST , MA_PURCHASE_EVENT_VERIFY_RECEIPT event types. Sent by the maPurchaseRequest() and maPurchaseVerifyReceipt() syscalls if the given product handle is invalid.
#define MA_PURCHASE_ERROR_CONNECTION_FAILED   -2
 Possible error code for any of the requests. Indicates that the connection with the App Store / Google Play has failed.
#define MA_PURCHASE_ERROR_CANNOT_PARSE_RECEIPT   -3
 Possible error code for MA_PURCHASE_STATE_RECEIPT_ERROR. Indicates that response from App Store/ Google Play for verifying a receipt cannot be parsed. Platform: iOS.
#define MA_PURCHASE_ERROR_INVALID_PRODUCT   -4
 Possible error code for MA_PURCHASE_EVENT_REQUEST. Sent by the maPurchaseRequest() syscall if the requested product is not valid on the App Store/ Google Play. Platform: iOS and Android.
#define MA_PURCHASE_ERROR_INVALID_CLIENT   -5
 Possible error code for MA_PURCHASE_EVENT_REQUEST. Sent by the maPurchaseRequest() syscall if the client is not allowed to perform the attempted action. Platform: iOS.
#define MA_PURCHASE_ERROR_CANCELLED   -6
 Possible error code for MA_PURCHASE_EVENT_REQUEST. Sent by the maPurchaseRequest() syscall if the user cancelled the payment request. On Android, when the user pressed the back button on the checkout page instead of buying the item. Platform: iOS and Android.
#define MA_PURCHASE_ERROR_NOT_ALLOWED   -7
 Possible error code for MA_PURCHASE_EVENT_REQUEST. Sent by the maPurchaseRequest() syscall if the user is not allowed to authorize payments. Platform: iOS.
#define MA_PURCHASE_ERROR_PUBLIC_KEY_NOT_SET   -8
 Possible error code for MA_PURCHASE_EVENT_REQUEST. Sent by the maPurchaseRequest() syscall if the user did not previously call maPurchaseSetPublicKey(). Platform: Android.
#define MA_PURCHASE_ERROR_UNKNOWN   -9
 Possible error code for MA_PURCHASE_EVENT_REQUEST. Sent by the maPurchaseRequest() syscall if an unknown or unexpected server error occurred. Platform: iOS and Android.
#define MA_PURCHASE_ERROR_INVALID_QUANTITY   -10
 Possible error code for MA_PURCHASE_EVENT_REQUEST. Sent by the maPurchaseRequest() syscall if the quantity is not greater than zero. Platform: Android and iOS.
#define MA_PURCHASE_ERROR_NO_RECEIPT   -11
 Possible error code for MA_PURCHASE_EVENT_VERIFY_RECEIPT. Sent by the maPurchaseVerifyReceipt() syscall if the product has not been purchased. Platform: iOS and Android.
#define MA_PURCHASE_ERROR_PRODUCT_ALREADY_OWNED   -12
 Possible error code for MA_PURCHASE_EVENT_REQUEST event type. Sent by the maPurchaseRequest() syscall if the given product is already owned.
#define MA_PURCHASE_EVENT_PRODUCT_CREATE   0
 Sent by the maPurchaseCreate() syscall. Check the event state member object to see if the product is valid or if an error occured. Platform: Android and iOS.
#define MA_PURCHASE_EVENT_REQUEST   1
 Sent by the maPurchaseRequest syscall after an operation step has been completed or if the operation has failed. Check event's purchaseData struct variable for more information. Platform: Android and iOS.
#define MA_PURCHASE_EVENT_VERIFY_RECEIPT   2
 Sent by the maPurchaseVerifyReceipt() syscall. Check the event state member object to see if the receipt is valid or not. Platform: Android and iOS.
#define MA_PURCHASE_EVENT_REFUNDED   3
 Received when the Billing service triggers a refund for your purchase. A new product has been created, and the event's productHandle member contains a handle to the purchased product.
#define MA_PURCHASE_EVENT_RESTORE   4
 Sent by the maPurchaseRestoreTransactions() syscall. A new product has been restored, or the request has failed. The event's productHandle member contains a handle to the purchased product. Platform: iOS and Android.
#define MA_PURCHASE_STATE_PRODUCT_VALID   0
 Sent by the maPurchaseCreate() syscall. Assocciated with MA_PURCHASE_EVENT_PRODUCT_CREATE. Indicates that product was validated by the App Store. On Android no product validation is done at this moment. Platform: iOS and Android.
#define MA_PURCHASE_STATE_PRODUCT_INVALID   1
 Sent by the maPurchaseCreate() syscall. Assocciated with MA_PURCHASE_EVENT_PRODUCT_CREATE. Indicates that the product is not valid in the App Store. Platform: iOS.
#define MA_PURCHASE_STATE_DISABLED   2
 Sent by the maPurchaseCreate(), maPurchaseRequest() and maPurchaseVerifyReceipt() syscalls. Assocciated with MA_PURCHASE_EVENT_PRODUCT_CREATE, MA_PURCHASE_EVENT_REQUEST and MA_PURCHASE_EVENT_VERIFY_RECEIPT. Indicates that purchase is not supported/disabled on the device. Platform: Android and iOS.
#define MA_PURCHASE_STATE_DUPLICATE_HANDLE   3
 Sent by the maPurchaseCreate() syscall. Assocciated with MA_PURCHASE_EVENT_PRODUCT_CREATE. Indicates that the given productHandle already exists. Use maCreatePlaceholder() to generate a new one. Platform: Android and iOS.
#define MA_PURCHASE_STATE_FAILED   0
 Sent by the maPurchaseRequest syscall if the operation failed. Check the errorCode variable from event's purchaseData struct for more info.
#define MA_PURCHASE_STATE_IN_PROGRESS   1
 Sent by the maPurchaseRequest syscall when the transaction has been received by the Apple App Store/Google Play.
#define MA_PURCHASE_STATE_COMPLETED   2
 Sent by the maPurchaseRequest syscall when the transaction has been successfully processed. Your application should provide the content the user purchased.
#define MA_PURCHASE_STATE_RECEIPT_VALID   4
 Sent by the maPurchaseVerifyReceipt() syscall. Assocciated with MA_PURCHASE_EVENT_VERIFY_RECEIPT. Indicates that the receipt has been validated by the App Store / Google Play. Platform: Android and iOS.
#define MA_PURCHASE_STATE_RECEIPT_INVALID   5
 Sent by the maPurchaseVerifyReceipt() syscall. Assocciated with MA_PURCHASE_EVENT_VERIFY_RECEIPT. Indicates that the receipt has been invalidated by the App Store / Google Play. Platform: Android and iOS.
#define MA_PURCHASE_STATE_RECEIPT_ERROR   6
 Sent by the maPurchaseVerifyReceipt() syscall. Assocciated with MA_PURCHASE_EVENT_VERIFY_RECEIPT. Indicates that an error has occurred while verifying the receipt. Check the event's errorCode member object for more information. Platform: Android and iOS.
#define MA_PURCHASE_STATE_RESTORE_ERROR   -7
 Sent by the maPurchaseRestoreTransactions() syscall. Associated with MA_PURCHASE_EVENT_RESTORE. Indicates that an error has occured while restoring transactions. The error can be one of the following: MA_PURCHASE_ERROR_CONNECTION_FAILED, MA_PURCHASE_ERROR_PUBLIC_KEY_NOT_SET. Check the event's errorCode member object for more information. Platform: Android and iOS.
#define MA_PURCHASE_STATE_PRODUCT_RESTORED   -8
 Sent by the maPurchaseRestoreTransactions() syscall. Associated with MA_PURCHASE_EVENT_RESTORE. Indicates that a product has been restored. Platform: Android and iOS.
#define MA_PURCHASE_STATE_PRODUCT_REFUNDED   -9
 Received after a refund was initiated on the server. Associated with MA_PURCHASE_EVENT_REFUNDED. Indicates that a product has been refunded. Platform: Android.
#define MA_PURCHASE_RECEIPT_QUANTITY   "quantity"
 The number of items purchased. Platform: iOS. On Android just one item can be bought at one time.
#define MA_PURCHASE_RECEIPT_PRODUCT_ID   "product_id"
 The product identifier of the item that was purchased. Example: "com.yourapplication.productname". Platform: iOS and Android.
#define MA_PURCHASE_RECEIPT_TRANSACTION_ID   "transaction_id"
 The transaction identifier of the item that was purchased. Platform: iOS and Android.
#define MA_PURCHASE_RECEIPT_PURCHASE_DATE   "purchase_date"
 The date and time this transaction occurred. The date represents the number of seconds that elapsed since 1970-01-01T00:00:00. Platform: iOS and Android.
#define MA_PURCHASE_RECEIPT_ORIGINAL_TRANSACTION_ID   "original_transaction_id"
 For a transaction that restores a previous transaction, this holds the original purchase date(in seconds). Platform: iOS.
#define MA_PURCHASE_RECEIPT_APP_ITEM_ID   "app_item_id"
 A string that the App Store uses to uniquely identify the application that created the payment transaction. If your server supports multiple applications, you can use this value to differentiate between them. Applications that are executing in the sandbox do not yet have an app-item-id assigned to them,so this key is missing from receipts created by the sandbox. Platform: iOS and Android.
#define MA_PURCHASE_RECEIPT_VERSION_EXTERNAL_IDENTIFIER   "version_external_identifier"
 An arbitrary number that uniquely identifies a revision of your application. This key is missing in receipts created by the sandbox. Platform: iOS.
#define MA_PURCHASE_RECEIPT_BID   "bid"
 The bundle identifier for the application. Example: "com.yourcompany.yourapplication". Platform: iOS.
#define MA_PURCHASE_RECEIPT_BVRS   "bvrs"
 A version number for the application. Platform: iOS.
#define MA_PURCHASE_RECEIPT_PRICE   "price"
 The cost of the product in the local currency. Platform: iOS.
#define MA_PURCHASE_RECEIPT_TITLE   "title"
 The localized product title. Platform: iOS.
#define MA_PURCHASE_RECEIPT_DESCRIPTION   "description"
 The localized product description. Platform: iOS.
#define MA_SCREEN_ORIENTATION_PORTRAIT   0x3
#define MA_SCREEN_ORIENTATION_PORTRAIT_UP   0x1
#define MA_SCREEN_ORIENTATION_PORTRAIT_UPSIDE_DOWN   0x2
#define MA_SCREEN_ORIENTATION_LANDSCAPE_LEFT   0x4
#define MA_SCREEN_ORIENTATION_LANDSCAPE_RIGHT   0x8
#define MA_SCREEN_ORIENTATION_LANDSCAPE   0xC
#define MA_SCREEN_ORIENTATION_DYNAMIC   0xF
#define SCREEN_ORIENTATION_LANDSCAPE   1
#define SCREEN_ORIENTATION_PORTRAIT   2
#define SCREEN_ORIENTATION_DYNAMIC   3
#define MA_SCREEN_ORIENTATION_RES_OK   0
#define MA_SCREEN_ORIENTATION_RES_NOT_SUPPORTED   -1
#define MA_SCREEN_ORIENTATION_RES_INVALID_VALUE   -2
#define IOCTL_UNAVAILABLE   -1

Typedefs

typedef char * MAString
typedef wchar * MAWString
typedef void * MAAddress
typedef int MAHandle
typedef int MAExtent
typedef unsigned char byte
typedef unsigned long ulong
typedef long long longlong
typedef int MAExtensionModule
typedef int MAExtensionFunction
typedef int MAAudioData
typedef int MAAudioInstance

Functions

struct __attribute ((packed, aligned(4))) MAPoint2d
 A structure representing a two-dimensional point, with coordinates 'x' and 'y'.
int maCheckInterfaceVersion (int hash)
void maExit (int result) __attribute__((noreturn))
void maPanic (int result, const char *message) __attribute__((noreturn))
void * memset (void *dst, int val, ulong size)
void * memcpy (void *dst, const void *src, ulong size)
int strcmp (const char *str1, const char *str2)
char * strcpy (char *dst, const char *src)
double __adddf3 (double a, double b)
double __subdf3 (double a, double b)
double __muldf3 (double a, double b)
double __divdf3 (double a, double b)
double __negdf2 (double a)
int __fixdfsi (double a)
uint __fixunsdfsi (double a)
double __floatsidf (int a)
double __extendsfdf2 (float a)
int dcmp (double a, double b)
float __addsf3 (float a, float b)
float __subsf3 (float a, float b)
float __mulsf3 (float a, float b)
float __divsf3 (float a, float b)
float __negsf2 (float a)
int __fixsfsi (float a)
uint __fixunssfsi (float a)
float __floatsisf (int a)
float __truncdfsf2 (double a)
int fcmp (float a, float b)
double sin (double x)
double cos (double x)
double tan (double x)
double sqrt (double x)
int maSetColor (int rgb)
void maSetClipRect (int left, int top, int width, int height)
void maGetClipRect (MARect *out)
void maPlot (int posX, int posY)
void maLine (int startX, int startY, int endX, int endY)
void maFillRect (int left, int top, int width, int height)
void maFillTriangleStrip (const MAPoint2d *points, int count)
void maFillTriangleFan (const MAPoint2d *points, int count)
MAExtent maGetTextSize (const char *str)
MAExtent maGetTextSizeW (const wchar *str)
void maDrawText (int left, int top, const char *str)
void maDrawTextW (int left, int top, const wchar *str)
void maUpdateScreen (void)
void maResetBacklight (void)
MAExtent maGetScrSize (void)
void maDrawImage (MAHandle image, int left, int top)
void maDrawRGB (const MAPoint2d *dstPoint, const void *src, const MARect *srcRect, int scanlength)
void maDrawImageRegion (MAHandle image, const MARect *srcRect, const MAPoint2d *dstPoint, int transformMode)
MAExtent maGetImageSize (MAHandle image)
void maGetImageData (MAHandle image, void *dst, const MARect *srcRect, int scanlength)
MAHandle maSetDrawTarget (MAHandle image)
int maFindLabel (const char *name)
int maCreateImageFromData (MAHandle placeholder, MAHandle data, int offset, int size)
int maCreateImageRaw (MAHandle placeholder, const void *src, MAExtent size, int alpha)
int maCreateDrawableImage (MAHandle placeholder, int width, int height)
int maCreateData (MAHandle placeholder, int size)
MAHandle maCreatePlaceholder (void)
void maDestroyPlaceholder (MAHandle handle)
void maDestroyObject (MAHandle handle)
int maGetDataSize (MAHandle data)
void maReadData (MAHandle data, void *dst, int offset, int size)
void maWriteData (MAHandle data, const void *src, int offset, int size)
void maCopyData (const MACopyData *params)
MAHandle maOpenStore (const char *name, int flags)
int maWriteStore (MAHandle store, MAHandle data)
int maReadStore (MAHandle store, MAHandle placeholder)
void maCloseStore (MAHandle store, int _delete)
MAHandle maConnect (const char *url)
void maConnClose (MAHandle conn)
void maConnRead (MAHandle conn, void *dst, int size)
void maConnWrite (MAHandle conn, const void *src, int size)
void maConnReadToData (MAHandle conn, MAHandle data, int offset, int size)
void maConnWriteFromData (MAHandle conn, MAHandle data, int offset, int size)
void maConnReadFrom (MAHandle conn, void *dst, int size, MAConnAddr *src)
void maConnWriteTo (MAHandle conn, const void *src, int size, const MAConnAddr *dst)
int maConnGetAddr (MAHandle conn, MAConnAddr *addr)
MAHandle maHttpCreate (const char *url, int method)
void maHttpSetRequestHeader (MAHandle conn, const char *key, const char *value)
int maHttpGetResponseHeader (MAHandle conn, const char *key, char *buffer, int bufSize)
void maHttpFinish (MAHandle conn)
int maLoadResources (MAHandle data)
int maLoadResource (MAHandle handle, MAHandle placeholder, int flag)
int maCountResources (void)
void maLoadProgram (MAHandle data, int reload)
int maGetKeys (void)
int maGetEvent (MAEvent *event)
void maWait (int timeout)
int maTime (void)
int maLocalTime (void)
int maGetMilliSecondCount (void)
int maFreeObjectMemory (void)
int maTotalObjectMemory (void)
int maVibrate (int ms)
int maSoundPlay (MAHandle sound_res, int offset, int size)
void maSoundStop (void)
int maSoundIsPlaying (void)
int maSoundGetVolume (void)
void maSoundSetVolume (int vol)
longlong maExtensionFunctionInvoke (int function, int a, int b, int c)
longlong maIOCtl (int function, int a, int b, int c)
MAExtensionModule maExtensionModuleLoad (const char *id, int hash)
MAExtensionFunction maExtensionFunctionLoad (MAExtensionModule module, int index)
MAHandle maFontLoadDefault (int type, int style, int size)
MAHandle maFontSetCurrent (MAHandle font)
int maFontGetCount (void)
int maFontGetName (int index, char *buffer, int bufferLen)
MAHandle maFontLoadWithName (const char *postScriptName, int size)
int maFontDelete (MAHandle font)
int maReportCallStack (void)
int maDumpCallStackEx (const char *str, int data)
void maProtectMemory (const void *start, int length)
void maUnprotectMemory (const void *start, int length)
void maSetMemoryProtection (int enable)
int maGetMemoryProtection (void)
int maGetBatteryCharge (void)
int maLockKeypad (void)
int maUnlockKeypad (void)
int maKeypadIsLocked (void)
int maWriteLog (const void *src, int size)
int maBtStartDeviceDiscovery (int names)
int maBtGetNewDevice (MABtDevice *d)
int maBtStartServiceDiscovery (const MABtAddr *address, const MAUUID *uuid)
int maBtGetNextServiceSize (MABtServiceSize *dst)
int maBtGetNewService (MABtService *dst)
int maBtCancelDiscovery (void)
int maLocationStart (void)
int maLocationStop (void)
int maPlatformRequest (const char *url)
MAHandle maFileOpen (const char *path, int mode)
int maFileExists (MAHandle file)
int maFileClose (MAHandle file)
int maFileCreate (MAHandle file)
int maFileDelete (MAHandle file)
int maFileSize (MAHandle file)
int maFileAvailableSpace (MAHandle file)
int maFileTotalSpace (MAHandle file)
int maFileDate (MAHandle file)
int maFileRename (MAHandle file, const char *newName)
int maFileTruncate (MAHandle file, int offset)
int maFileWrite (MAHandle file, const void *src, int len)
int maFileWriteFromData (MAHandle file, MAHandle data, int offset, int len)
int maFileRead (MAHandle file, void *dst, int len)
int maFileReadToData (MAHandle file, MAHandle data, int offset, int len)
int maFileTell (MAHandle file)
int maFileSeek (MAHandle file, int offset, int whence)
MAHandle maFileListStart (const char *path, const char *filter, int sorting)
int maFileListNext (MAHandle list, char *nameBuf, int bufSize)
int maFileListClose (MAHandle list)
int maFileSetProperty (const char *path, int property, int value)
int maSaveImageToDeviceGallery (MAHandle imageHandle, const char *imageName)
int maSendTextSMS (const char *dst, const char *msg)
int maFrameBufferGetInfo (MAFrameBufferInfo *info)
int maFrameBufferInit (const void *data)
int maFrameBufferClose (void)
int maAccept (MAHandle serv)
int maSendToBackground (void)
int maBringToForeground (void)
int maGetSystemProperty (const char *key, char *buf, int size)
int maIapSave (void)
int maIapReset (void)
int maIapShutdown (void)
int maNetworkStatus (void)
int maIapSetMethod (int type)
int maIapSetFilter (int filter)
int maCameraFormatNumber (void)
int maCameraFormat (int index, MA_CAMERA_FORMAT *fmt)
int maCameraStart (void)
int maCameraStop (void)
int maCameraSetPreview (MAHandle widgetHandle)
int maCameraSelect (int cameraNumber)
int maCameraNumber (void)
int maCameraSnapshot (int formatIndex, MAHandle placeholder)
int maCameraSnapshotAsync (MAHandle dataPlaceholder, int sizeIndex)
int maCameraRecord (int stopStartFlag)
int maCameraSetProperty (const char *property, const char *value)
int maCameraGetProperty (const char *property, char *value, int bufSize)
int maCameraPreviewSize (void)
int maCameraPreviewEventEnable (int previewEventType, void *previewBuffer, const MARect *previewArea)
int maCameraPreviewEventDisable (void)
int maCameraPreviewEventConsumed (void)
int maShowVirtualKeyboard (void)
int maTextBox (const wchar *title, const wchar *inText, wchar *outText, int maxSize, int constraints)
int maKeyCaptureStart (int keyCode)
int maKeyCaptureStop (void)
int maHomeScreenEventsOn (void)
int maHomeScreenEventsOff (void)
int maHomeScreenShortcutAdd (const char *name)
int maHomeScreenShortcutRemove (const char *name)
int maNotificationAdd (int type, int id, const char *title, const char *text)
int maNotificationRemove (int id)
int maScreenSetFullscreen (int fullscreen)
int maAutostartOn (void)
int maAutostartOff (void)
int maScreenStateEventsOn (void)
int maScreenStateEventsOff (void)
int maWakeLock (int flag)
void maReportResourceInformation (void)
void maMessageBox (const char *title, const char *message)
void maAlert (const char *title, const char *message, const char *button1, const char *button2, const char *button3)
int maToast (const char *message, int duration)
 A toast is a view containing a quick little message for the user. A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive. For example, navigating away from an email before you send it triggers a "Draft saved" toast to let you know that you can continue editing later. Toasts automatically disappear after a timeout, and do not handle any user interaction. Toast are available only on Android.
void maImagePickerOpen (void)
void maImagePickerOpenWithEventReturnType (int eventReturnType)
void maOptionsBox (const wchar *title, const wchar *destructiveButtonTitle, const wchar *cancelButtonTitle, const void *otherButtonTitles, int otherButtonTitlesSize)
int maSensorStart (int sensor, int interval)
 Enables a sensor and starts sending events if the sensor is available. If the sensor is already enabled this call will have no effect.
int maSensorStop (int sensor)
 Disables a sensor so that it doesn't send any further events.
int maNFCStart (void)
void maNFCStop (void)
MAHandle maNFCReadTag (MAHandle nfcContext)
void maNFCDestroyTag (MAHandle tagHandle)
void maNFCConnectTag (MAHandle tagHandle)
void maNFCCloseTag (MAHandle tagHandle)
int maNFCIsType (MAHandle tagHandle, int type)
MAHandle maNFCGetTypedTag (MAHandle tagHandle, int type)
int maNFCBatchStart (MAHandle tagHandle)
void maNFCBatchCommit (MAHandle tagHandle)
void maNFCBatchRollback (MAHandle tagHandle)
int maNFCTransceive (MAHandle tag, const void *src, int srcLen, void *dst, int *dstLen)
int maNFCSetReadOnly (MAHandle tag)
int maNFCIsReadOnly (MAHandle tag)
int maNFCGetSize (MAHandle tag)
int maNFCGetId (MAHandle tag, void *dst, int len)
int maNFCReadNDEFMessage (MAHandle tag)
int maNFCWriteNDEFMessage (MAHandle tag, MAHandle ndefMessage)
MAHandle maNFCCreateNDEFMessage (int recordCount)
int maNFCGetNDEFMessage (MAHandle tag)
MAHandle maNFCGetNDEFRecord (MAHandle ndefMessage, int ix)
int maNFCGetNDEFRecordCount (MAHandle ndefMessage)
int maNFCGetNDEFId (MAHandle ndefRecord, void *dst, int len)
int maNFCGetNDEFPayload (MAHandle ndefRecord, void *dst, int len)
int maNFCGetNDEFTnf (MAHandle ndefRecord)
int maNFCGetNDEFType (MAHandle ndefRecord, void *dst, int len)
int maNFCSetNDEFId (MAHandle ndefRecord, const void *dst, int len)
int maNFCSetNDEFPayload (MAHandle ndefRecord, const void *dst, int len)
int maNFCSetNDEFTnf (MAHandle ndefRecord, int tnf)
int maNFCSetNDEFType (MAHandle ndefRecord, const void *dst, int len)
int maNFCAuthenticateMifareSector (MAHandle tagHandle, int keyType, int sectorIndex, const void *keySrc, int keyLen)
int maNFCGetMifareSectorCount (MAHandle tagHandle)
int maNFCGetMifareBlockCountInSector (MAHandle tagHandle, int sector)
int maNFCMifareSectorToBlock (MAHandle tagHandle, int sector)
int maNFCReadMifareBlocks (MAHandle tagHandle, int firstBlock, void *dst, int len)
int maNFCWriteMifareBlocks (MAHandle tagHandle, int firstBlock, const void *dst, int len)
int maNFCReadMifarePages (MAHandle tagHandle, int firstPage, void *dst, int len)
int maNFCWriteMifarePages (MAHandle tagHandle, int firstPage, const void *dst, int len)
MAHandle maDBOpen (const char *path)
int maDBClose (MAHandle databaseHandle)
MAHandle maDBExecSQL (MAHandle databaseHandle, const char *sql)
MAHandle maDBExecSQLParams (MAHandle databaseHandle, const char *sql, const MADBValue *params, int paramCount)
int maDBCursorDestroy (MAHandle cursorHandle)
int maDBCursorNext (MAHandle cursorHandle)
int maDBCursorGetColumnData (MAHandle cursorHandle, int columnIndex, MAHandle placeholder)
int maDBCursorGetColumnText (MAHandle cursorHandle, int columnIndex, void *buffer, int bufferSize)
int maDBCursorGetColumnInt (MAHandle cursorHandle, int columnIndex, int *value)
int maDBCursorGetColumnDouble (MAHandle cursorHandle, int columnIndex, double *value)
MAAudioData maAudioDataCreateFromResource (const char *mime, MAHandle data, int offset, int length, int flags)
 Creates a MAAudioData handle from a MoSync resource.
MAAudioData maAudioDataCreateFromURL (const char *mime, const char *url, int flags)
 Creates a MAAudioData handle from an URL or file path.
int maAudioDataDestroy (MAAudioData audioData)
 Destroys a MAAudioData handle and releases used memory.
MAAudioInstance maAudioInstanceCreate (MAAudioData audioData)
 Creates a MAAudioInstance handle from a MAAudioData handle.
MAAudioInstance maAudioInstanceCreateDynamic (int sampleRate, int numChannels, int bufferSize)
 Creates an MAAudioInstance that can be fed samples dynamically.
int maAudioSubmitBuffer (MAAudioInstance instance, const void *buffer, int numBytes)
 Submits a buffer of samples to a dynamic MAAudioInstance.
int maAudioGetPendingBufferCount (MAAudioInstance instance)
 Gets the pending buffer count for the dynamic MAAudioInstance.
int maAudioInstanceDestroy (MAAudioInstance audioInstance)
 Destroys a MAAudioInstance handle releases used memory.
int maAudioGetLength (MAAudioInstance audio)
 Returns the lenght in milliseconds for this instance.
int maAudioSetNumberOfLoops (MAAudioInstance audio, int loops)
 Sets the number of loops this instance will play.
int maAudioPrepare (MAAudioInstance audio, int async)
 Prepares an MAAudioInstance before playback. If prepared asynchronous the call will return directly, but the MAAudioInstance will not be ready for playback until an EVENT_TYPE_AUDIO_PREPARED event has been sent. If synchronous the call will block execution until finished and the MAAudioInstance will be ready directly.
int maAudioPlay (MAAudioInstance audio)
 Plays the current MAAudioInstance.
int maAudioSetPosition (MAAudioInstance audio, int milliseconds)
 Sets the current position in milliseconds.
int maAudioGetPosition (MAAudioInstance audio)
 Gets the current position in milliseconds.
int maAudioSetVolume (MAAudioInstance audio, float volume)
 Sets the volume for this MAAudioInstance.
int maAudioPause (MAAudioInstance audio)
 Pauses the MAAudioInstance if it's playing. It will stay prepared, so the sound can be resumed at any time using maAudioPlay.
int maAudioStop (MAAudioInstance audio)
 Stops the the audio instance and sets the position to the beginning. The audio instance might be unprepared, meaning all it's prepared buffers might be released.
int maSyscallPanicsEnable (void)
int maSyscallPanicsDisable (void)
int maAdsBannerCreate (int bannerSize, const char *publisherID)
 Creates a new banner.
int maAdsBannerDestroy (MAHandle bannerHandle)
 Destroy a banner.
int maAdsAddBannerToLayout (MAHandle bannerHandle, MAHandle layoutHandle)
 Add a banner to a layout widget.
int maAdsRemoveBannerFromLayout (MAHandle bannerHandle, MAHandle layoutHandle)
 Remove a banner from a layout widget.
int maAdsBannerSetProperty (MAHandle bannerHandle, const char *property, const char *value)
 Set a banner property.
int maAdsBannerGetProperty (MAHandle bannerHandle, const char *property, char *value, int bufSize)
 Retrieves a specified property from the given banner.
MAHandle maNotificationLocalCreate (void)
 Creates a new local notification object.
int maNotificationLocalDestroy (MAHandle notificationHandle)
 Destroy a local notification object.
int maNotificationLocalSetProperty (MAHandle notificationHandle, const char *property, const char *value)
 Set a local notification property.
int maNotificationLocalGetProperty (MAHandle notificationHandle, const char *property, char *value, int bufSize)
 Retrieves a specified property from the given notification object.
int maNotificationLocalSchedule (MAHandle notificationHandle)
 Schedules a local notification for delivery at its encapsulated date and time. The local notification is displayed regardless of the applications's state. By default, the notifications are displayed to the user only if the application is in background. But on Android you can configure this by setting the MA_NOTIFICATION_LOCAL_DISPLAY_FLAG property.
int maNotificationLocalUnschedule (MAHandle notificationHandle)
 Cancels the delivery of the specified scheduled local notification. Calling this method also programmatically dismisses the notification if it is currently displaying an alert.
int maNotificationPushRegister (MAHandle pushNotificationTypes, const char *senderId)
 Registers the current application for receiving push notifications. Note that on Android you might want to store the registrationID that you receive, and call this again only if it expires at some point. On Android: if the registration is succesfful, the application receives a registration ID. The application should store this ID for later use. Note that Google may periodically refresh the registration ID, so you should design your application with the understanding that this syscall may be called multiple times.
int maNotificationPushUnregister (void)
 Unregister application for push notifications.
int maNotificationPushGetRegistration (char *registrationMesssage, int registrationMessageSize)
 Gets the latest push notification registration response.
int maNotificationPushGetData (MAHandle pushNotificationHandle, MAPushNotificationData *pushNotificationData)
 Fills pushNotificationData struct with the values for a given push notification. Note: Call maNotificationPushDestroy() in order to destroy the push notification object.
int maNotificationPushDestroy (MAHandle notificationHandle)
 Destroy a push notification object.
void maNotificationSetIconBadge (int applicationIconBadgeNumber)
 Set the number currently set as the badge of the application icon in Springboard. Platform: iOS only.
int maNotificationGetIconBadge (void)
 Get the number currently set as the badge of the application icon in Springboard. Platform: iOS only.
int maNotificationPushSetTickerText (const char *tickerText)
 Set the ticker text in the notification status bar for incoming push notifications. This call does not alter already received notifications. Platform: Android only.
int maNotificationPushSetMessageTitle (const char *messageTitle)
 Set the message title in the notification area for incoming push notifications. This call does not alter already received notifications. Platform: Android only.
int maNotificationPushSetDisplayFlag (int displayFlag)
 Set the display flags applied to the incoming push notifications. Note that regardless of this setting, the EVENT_TYPE_PUSH_NOTIFICATION event will be received for each incoming notification. MA_NOTIFICATION_DISPLAY_FLAG_DEFAULT is enabled by default. Platform: Android only.
int maCaptureSetProperty (const char *property, const char *value)
 Sets the properties to the Native Image Picker.
int maCaptureGetProperty (const char *property, char *value, int bufSize)
 Retrieves the properties from the Native Image Picker.
int maCaptureAction (int action)
 Performs a capture action.
int maCaptureWriteImage (MAHandle handle, const char *fullPath, int fullPathBufSize)
 Save a image data object to a file.
int maCaptureGetImagePath (MAHandle handle, char *buffer, int bufferSize)
 Get full path to a taken picture. Available on Android only.
int maCaptureGetVideoPath (MAHandle handle, char *buffer, int bufferSize)
 Get full path to a recorded video.
int maCaptureDestroyData (MAHandle handle)
 Destroys a image/video data object.
int maPurchaseSupported (void)
 Check if in app purchase is supported/enabled on a device. It does not trigger any asynchronous responses. Platform: Android and iOS.
void maPurchaseCreate (MAHandle productHandle, const char *productID)
 Create a product object asynchronously. The product is validated only on iOS. On the other hand, on Android the validation will be done during a maPurchaseRequest.
int maPurchaseSetPublicKey (const char *developerPublicKey)
void maPurchaseRequest (MAHandle productHandle, int quantity)
void maPurchaseVerifyReceipt (MAHandle productHandle)
int maPurchaseGetField (MAHandle productHandle, const char *property, char *buffer, int bufferSize)
void maPurchaseSetStoreURL (const char *url)
int maPurchaseGetName (MAHandle productHandle, char *buffer, int bufferSize)
void maPurchaseRestoreTransactions (void)
int maPurchaseDestroy (MAHandle productHandle)
int maScreenSetOrientation (int orientation)
int maScreenSetSupportedOrientations (int orientations)
int maScreenGetSupportedOrientations (void)
int maScreenGetCurrentOrientation (void)

Variables

 MAPoint2d
 MARect
 MACopyData
 MAConnAddrInet4
 MAConnAddrInet6
 MABtAddr
 MAConnAddrBt
 MAConnAddr
 MAConnEventData
 MASensor
 MANFCEventData
 MAAdsEventData
 MACaptureEventData
 MAPurchaseEventData
 MAEvent
 MAPanicReport
 MABtDevice
 MAUUID
 MABtServiceSize
 MABtService
 MALocation
 MAFrameBufferInfo
 MA_CAMERA_FORMAT
 MADBBlob
 MADBText
 MADBValue
 MAPushNotificationData

Detailed Description

Syscall declarations. These system calls and low-level functions provide access to the basic features of a device. They are implemented by the MoSync runtimes in code native to the device.

With these syscalls it should be possible to do most things, although, there may still be some functionality missing. If you would like a specific function added, please send us a mail.

In future versions of MoSync an extension API will be provided that will allow you to create your own custom syscalls.

Some Caveats:

The Runtime expects alignment rules to be followed. Writing or reading to unaligned memory will cause a MoSync Panic.

Some functions may also cause a panic if they are passed incorrect parameters. A complete reference of these panics can be found here.

The codepage for functions that use strings is platform-dependent beyond 7-bit ASCII. Most use Latin-1, but you should still be wary.

Additional notes:

There are different types of handles: Connection, Store and Resource. They are all represented as positive signed integers. When a handle is passed to a function, it must have the proper type.

Each MoSync program has a Resource array. It is acccessed and manipulated by certain syscalls, but it cannot be accessed directly. Each resource (aka Object) is represented by a handle. There are different types of resources, for example Image, Binary data, Sound or Placeholder. A placeholder object is not a real object, but just a handle which you can use to construct new objects dynamically. Resources can also be defined at compile time, by using MoSync's resource compiler. Placeholders can either be defined at compile time using a resource compiler directive or created dynamically at runtime using maCreatePlaceholder(). See the tutorials, examples and the resource compiler reference documentation for more information.

There is an event queue which contains keypad events and results from asynchronous operations. Use maWait() and maGetEvent() to handle it.

MoSync socket/Bluetooth/HTTP connections are asynchronous. Read all about it here.


Define Documentation

#define MAIDL_HASH   ((int)0x71cb80f9)

A hash of the abstract representation of the API described in this file. Identifiers, declarations and definitions are included in the calculation of the hash, but documentation is not.

#define EXTENT_Y (   e)    ((short)(e))

Returns the height of an MAExtent.

#define EXTENT_X (   e)    ((short)((e) >> 16))

Returns the width of an MAExtent.

#define EXTENT (   x,
 
)    ((MAExtent)((((int)(x)) << 16) | ((y) & 0xFFFF)))

Creates an MAExtent.

#define TRANS_NONE   0

The image is copied unchanged.

#define TRANS_ROT90   5

The image is rotated clockwise by 90 degrees.

#define TRANS_ROT180   3

The image is rotated clockwise by 180 degrees.

#define TRANS_ROT270   6

The image is rotated clockwise by 270 degrees.

#define TRANS_MIRROR   2

The image is reflected about its vertical center.

#define TRANS_MIRROR_ROT90   7

The image is reflected about its vertical center, then rotated clockwise by 90 degrees.

#define TRANS_MIRROR_ROT180   1

The image is reflected about its vertical center, then rotated clockwise by 180 degrees.

#define TRANS_MIRROR_ROT270   4

The image is reflected about its vertical center, then rotated clockwise by 270 degrees.

#define HANDLE_SCREEN   0

This handle refers to the back buffer, which is initially black.

#define HANDLE_LOCAL   0
#define RES_OUT_OF_MEMORY   -1
#define RES_BAD_INPUT   -2
#define RES_OK   1
#define MAS_CREATE_IF_NECESSARY   1
#define STERR_GENERIC   -2

Generic error.

#define STERR_FULL   -3

The storage medium is full.

#define STERR_NONEXISTENT   -5

The store does not exist.

#define CONNERR_GENERIC   -2

Generic error.

#define CONNERR_MAX   -3

The maximum number of open connections allowed has been reached.

#define CONNERR_DNS   -4

DNS resolution error.

#define CONNERR_INTERNAL   -5

Internal error. Please report any occurrences.

#define CONNERR_CLOSED   -6

The connection was closed by the remote peer.

Happens when HTTP servers finish sending data.

#define CONNERR_READONLY   -7

You attempted to write to a read-only connection.

#define CONNERR_FORBIDDEN   -8

The OS does not trust you enough to let you open this connection.

#define CONNERR_UNINITIALIZED   -9

No operation has been started yet.

#define CONNERR_CONLEN   -10

The Content-Length header could not be found.

#define CONNERR_URL   -11

You supplied a malformed URL.

#define CONNERR_UNAVAILABLE   -12

The protocol is not available. If a Bluetooth function returns this, the Bluetooth chip is turned off.

#define CONNERR_CANCELED   -13

You canceled the operation.

#define CONNERR_PROTOCOL   -14

The server gave an invalid response.

#define CONNERR_NETWORK   -15

The network connection could not be established.

#define CONNERR_NOHEADER   -16

The requested header could not be found.

#define CONNERR_NOTFOUND   -17

The requested object could not be found.

#define CONNERR_SSL   -18

An error occurred during SSL negotiation.

#define CONNERR_DOWNLOAD_IN_PROGRESS   -19

A download is already in progress.

#define CONNERR_NO_ACTIVE_DOWNLOAD   -20

There is no active download.

#define CONNERR_READER_UNAVAILABLE   -21
#define CONNERR_REDIRECT   -22

Redirection failed. This occurs when the server does not provide alternative url or if the maximum number of attempts to redirect was exceeded.

#define CONNERR_USER   -1000000

If you wish to share the CONNERR codespace, use values below this for your own error codes.

#define CONNOP_READ   1
#define CONNOP_WRITE   2
#define CONNOP_CONNECT   7
#define CONNOP_FINISH   11
#define CONNOP_ACCEPT   16
#define CONN_MAX   32

The maximum number of open connections allowed.

#define BTADDR_LEN   6
#define CONN_FAMILY_INET4   1
#define CONN_FAMILY_BT   2
#define CONN_FAMILY_INET6   3
#define HTTP_GET   1
#define HTTP_POST   2
#define HTTP_HEAD   3
#define HTTP_PUT   4
#define HTTP_DELETE   5
#define MA_RESOURCE_OPEN   0x1
#define MA_RESOURCE_CLOSE   0x2
#define MAK_UNKNOWN   0
#define MAK_FIRST   0
#define MAK_BACKSPACE   8
#define MAK_TAB   9
#define MAK_CLEAR   12
#define MAK_RETURN   13
#define MAK_PAUSE   19
#define MAK_ESCAPE   27
#define MAK_SPACE   32
#define MAK_EXCLAIM   33
#define MAK_QUOTEDBL   34
#define MAK_POUND   35
#define MAK_HASH   35
#define MAK_GRID   35
#define MAK_DOLLAR   36
#define MAK_AMPERSAND   38
#define MAK_QUOTE   39
#define MAK_LEFTPAREN   40
#define MAK_RIGHTPAREN   41
#define MAK_ASTERISK   42
#define MAK_STAR   42
#define MAK_PLUS   43
#define MAK_COMMA   44
#define MAK_MINUS   45
#define MAK_PERIOD   46
#define MAK_SLASH   47
#define MAK_0   48
#define MAK_1   49
#define MAK_2   50
#define MAK_3   51
#define MAK_4   52
#define MAK_5   53
#define MAK_6   54
#define MAK_7   55
#define MAK_8   56
#define MAK_9   57
#define MAK_COLON   58
#define MAK_SEMICOLON   59
#define MAK_LESS   60
#define MAK_EQUALS   61
#define MAK_GREATER   62
#define MAK_QUESTION   63
#define MAK_AT   64
#define MAK_LEFTBRACKET   91
#define MAK_BACKSLASH   92
#define MAK_RIGHTBRACKET   93
#define MAK_CARET   94
#define MAK_UNDERSCORE   95
#define MAK_BACKQUOTE   96
#define MAK_A   97
#define MAK_B   98
#define MAK_C   99
#define MAK_D   100
#define MAK_E   101
#define MAK_F   102
#define MAK_G   103
#define MAK_H   104
#define MAK_I   105
#define MAK_J   106
#define MAK_K   107
#define MAK_L   108
#define MAK_M   109
#define MAK_N   110
#define MAK_O   111
#define MAK_P   112
#define MAK_Q   113
#define MAK_R   114
#define MAK_S   115
#define MAK_T   116
#define MAK_U   117
#define MAK_V   118
#define MAK_W   119
#define MAK_X   120
#define MAK_Y   121
#define MAK_Z   122
#define MAK_DELETE   127
#define MAK_KP0   256
#define MAK_KP1   257
#define MAK_KP2   258
#define MAK_KP3   259
#define MAK_KP4   260
#define MAK_KP5   261
#define MAK_KP6   262
#define MAK_KP7   263
#define MAK_KP8   264
#define MAK_KP9   265
#define MAK_KP_PERIOD   266
#define MAK_KP_DIVIDE   267
#define MAK_KP_MULTIPLY   268
#define MAK_KP_MINUS   269
#define MAK_KP_PLUS   270
#define MAK_KP_ENTER   271
#define MAK_KP_EQUALS   272
#define MAK_UP   273
#define MAK_DOWN   274
#define MAK_RIGHT   275
#define MAK_LEFT   276
#define MAK_INSERT   277
#define MAK_HOME   278
#define MAK_END   279
#define MAK_PAGEUP   280
#define MAK_PAGEDOWN   281
#define MAK_FIRE   284
#define MAK_SOFTLEFT   285
#define MAK_SOFTRIGHT   286
#define MAK_PEN   291
#define MAK_BACK   292
#define MAK_MENU   293
#define MAK_RSHIFT   303
#define MAK_LSHIFT   304
#define MAK_RCTRL   305
#define MAK_LCTRL   306
#define MAK_RALT   307
#define MAK_LALT   308
#define MAK_SEARCH   309
#define MAKB_LEFT   0x00001
#define MAKB_UP   0x00002
#define MAKB_RIGHT   0x00004
#define MAKB_DOWN   0x00008
#define MAKB_FIRE   0x00010
#define MAKB_SOFTLEFT   0x00020
#define MAKB_SOFTRIGHT   0x00040
#define MAKB_0   0x00080
#define MAKB_1   0x00100
#define MAKB_2   0x00200
#define MAKB_3   0x00400
#define MAKB_4   0x00800
#define MAKB_5   0x01000
#define MAKB_6   0x02000
#define MAKB_7   0x04000
#define MAKB_8   0x08000
#define MAKB_9   0x10000
#define MAKB_ASTERISK   0x20000
#define MAKB_STAR   0x20000
#define MAKB_HASH   0x40000
#define MAKB_POUND   0x40000
#define MAKB_GRID   0x40000
#define MAKB_CLEAR   0x80000
#define EVENT_BUFFER_SIZE   256
#define EVENT_CLOSE_TIMEOUT   2000

In milliseconds.

#define EVENT_TYPE_CLOSE   1

This event is posted when the operating system sends MoSync a command to exit. Causes include the OS shutting down and OS-controlled user commands.

See also:
maGetEvent()
#define EVENT_TYPE_KEY_PRESSED   2
#define EVENT_TYPE_KEY_RELEASED   3
#define EVENT_TYPE_CONN   4

Connection.

#define EVENT_TYPE_BT   5

Bluetooth discovery.

#define EVENT_TYPE_POINTER_DRAGGED   10
#define EVENT_TYPE_FOCUS_LOST   13

While MoSync doesn't have focus, no key events will arrive and the screen will not be updated. If the keypad is locked, no application will have focus.

See also:
maLockKeypad
#define EVENT_TYPE_FOCUS_GAINED   14
#define EVENT_TYPE_LOCATION   16

Has MAEvent::data point to an MALocation.

MAEvent::state is one of the MA_LPS constants.

#define EVENT_TYPE_AUDIO_PREPARED   19

Event which is triggered when an audio has been asychronous prepared The MAEvent::audioInstance contains the prepared MAAudioInstance, or <0 if a problem happened while preparing.

#define EVENT_TYPE_AUDIO_COMPLETED   20

Event which is triggered when a streaming audio has finished playing The MAEvent::audioInstance contains the MAAudioInstance which finished.

#define EVENT_TYPE_SCREEN_CHANGED   21

The size of the screen has changed. Use maGetScrSize() to get the new size.

If the screen is the current draw target, the clipping rectangle is removed. Use maSetClipRect() to reset it.

#define EVENT_TYPE_CHAR   22

Character input. Uses MAEvent::character.

#define EVENT_TYPE_TEXTBOX   23

The text box created by maTextBox() was just closed. Uses MAEvent::textboxResult and MAEvent::textboxLength.

#define EVENT_TYPE_HOMESCREEN_SHOWN   24

The home screen became visible. Currently implemented only on Android and Symbian.

See also:
maHomeScreenEventsOn()

The home screen was hidden because an application came to front. Currently implemented only on Android and Symbian.

See also:
maHomeScreenEventsOn()
#define EVENT_TYPE_SCREEN_STATE_ON   26

The screen was turned on (the device went out of sleep state). Currently implemented only on Android.

See also:
maScreenActivateEventsOn()
#define EVENT_TYPE_SCREEN_STATE_OFF   27

The screen was turned off (the device went into sleep state). Currently implemented only on Android.

See also:
maScreenActivateEventsOn()
#define EVENT_TYPE_WIDGET   28

An event sent from a native widget.

The application can use the MAEvent.data field to access
widget event data, which is of type MAWidgetEventData. For example:
 MAWidgetEventData* widgetEventData = (MAWidgetEventData*) event.data; 
See also:
MAWidgetEventData

The bluetooth chip was turned off. Bluetooth functions will return CONNERR_UNAVAILABLE. Currently implemented only on Android.

The bluetooth chip was turned on. Bluetooth functions will now work normally again. Currently implemented only on Android.

#define EVENT_TYPE_IMAGE_PICKER   31

The ImagePicker dialog was dismissed either by Cancel, either by OK.

#define EVENT_TYPE_SMS   32

SMS result message. The field status contains one of the This event is sent on Android and iOS.

#define EVENT_TYPE_SENSOR   33

Provides data from active sensors.

See also:
MAEvent::sensor
maSensorStart()
#define EVENT_TYPE_ALERT   34

The maAlert message box was dismissed by one of the available buttons. See EVENT_TYPE_ALERT for the event.

#define EVENT_TYPE_NFC_TAG_RECEIVED   35

A new NFC tag was received A new tag has been received, use maGetNextTag to retreive it.

New tag data was read An asynchronous NFC tag read operation was completed.

New tag data was written An asynchronous NFC tag write operation was completed.

#define EVENT_TYPE_NFC_BATCH_OP   38

A batch operation was performed.

Tag authentication was performed An asynchronous NFC tag authentication read was completed.

Tag was made read only An asynchronous NFC tag read only operation was completed.

Send by maOptionsBox dialog when one of the option buttons is clicked.

#define EVENT_TYPE_ADS_BANNER   42

Send by a banner ad.

Send when the application receives a local notification.

Send when the application receives a registration result. The application tries to register to Apple Push Service, or Google GCM/C2DM Service, and the received result ( either success, either fail) is sending this event. After this event is received, get the result of the registration request by calling maNotificationPushGetRegistration.

Send when the application receives an unregistration result. The application unregistered from Google GCM/C2DM Service, and will not receive anymore push messages. Platform: Android only.

Send when the application receives a push notification.

#define EVENT_TYPE_CAPTURE   47

Send before the Native Image Picker is dismissed. This event will contain a MACaptureEventData struct.

#define EVENT_TYPE_PURCHASE   48

Send by the Purchase API. This event will contain a MAPurchaseEventData struct.

#define EVENT_TYPE_CAMERA_PREVIEW   49

A camera event fired when you get any of the camera preview events.

#define EVENT_TYPE_NETWORK   50

The telephone network status changed. MAEvent::state is the new state, one of the MA_NETWORK constants.

Sent when the current screen orientation has changed. MAEvent::orientation is the new screen orientation. One of the constants MA_SCREEN_ORIENTATION .

Sent just before the current screen orientation starts changing. Platform: iOS only.

#define EVENT_TYPE_CAMERA_SNAPSHOT   53

Used to notify when the snapshot taken via maCameraSnapshotAsync, is completed. The events of this type contain the handler for the image data, the image size, the data representation and a return code.

#define EVENT_TYPE_ALERT_DISMISSED   54

Send by maAlert dialog being canceled by user dimissing it.

Used to notify when an operation of exporting files, from the application to the device storages, reached the finish point.

#define RUNTIME_MORE   1

The MoSync Reference Environment, also known as the Emulator.

#define RUNTIME_JAVA   2

Java ME.

#define RUNTIME_SYMBIAN   3

Symbian.

#define RUNTIME_WINCE   4

Windows CE, also known as Windows Mobile.

#define REPORT_PANIC   1

Caused by a MoSync Panic. MAPanicReport::code is the panic code.

#define REPORT_EXCEPTION   2

Caused by a native exception. MAPanicReport::string describes the exception.

#define REPORT_PLATFORM_CODE   3

Caused by a platform-specific error. MAPanicReport::code is valid.

#define REPORT_USER_PANIC   4

Caused by a call to maPanic(). MAPanicReport::code and MAPanicReport::string are the parameters from the call.

#define REPORT_TIMEOUT   5

Caused by the Close event timeout. Neither code or string are valid.

#define FONT_TYPE_SERIF   0
#define FONT_TYPE_SANS_SERIF   1
#define FONT_TYPE_MONOSPACE   2
#define FONT_STYLE_NORMAL   0
#define FONT_STYLE_BOLD   1
#define FONT_STYLE_ITALIC   2
#define RES_FONT_OK   1

Indicates that the call to a font syscall was successful.

The available result codes for fonts.

#define RES_FONT_INVALID_HANDLE   -1

Indicates that an invalid font handle was passed.

Indicates that the index was off the list size.

Indicates that a default font with that combination does not exist.

#define RES_FONT_NAME_NONEXISTENT   -4

Indicates that there is no font with that name on the device.

Indicates that maFontGetCount() was not called first.

Indicates that the buffer is not big enough to store the font name.

#define RES_FONT_INVALID_SIZE   -7

Indicates that an invalid size was passed.

#define RES_FONT_DELETE_DENIED   -8

Indicates that the font cannot be deleted because it is in use. maFontDelete(handle) fails with this return code.

#define MA_LOC_NONE   1
#define MA_LOC_INVALID   2
#define MA_LOC_UNQUALIFIED   3
#define MA_LOC_QUALIFIED   4
#define MA_LPS_AVAILABLE   1

Availability status code: the location provider is available.

Availability status code: the location provider is temporarily unavailable. Temporary unavailability means that the method is unavailable due to reasons that can be expected to possibly change in the future and the provider to become available. An example is not being able to receive the signal because the signal used by the location method is currently being obstructed, e.g. when deep inside a building for satellite based methods. However, a very short transient obstruction of the signal should not cause the provider to toggle quickly between TEMPORARILY_UNAVAILABLE and AVAILABLE.

#define MA_LPS_OUT_OF_SERVICE   3

Availability status code: the location provider is out of service. Being out of service means that the method is unavailable and the implementation is not able to expect that this situation would change in the near future. An example is when using a location method implemented in an external device and the external device is detached.

#define MA_ACCESS_READ   1
#define MA_ACCESS_READ_WRITE   3
#define MA_SEEK_SET   0

Beginning of file.

#define MA_SEEK_CUR   1

Current position.

#define MA_SEEK_END   2

End of file.

#define MA_FL_SORT_NONE   0

Don't sort the files.

#define MA_FL_SORT_DATE   1

Sort the files by date. See maFileDate().

#define MA_FL_SORT_NAME   2

Sort the files by name. Case-sensitive?

#define MA_FL_SORT_SIZE   3

Sort the files by size. See maFileSize().

#define MA_FL_ORDER_ASCENDING   0x10000

Oldest / smallest / A first.

#define MA_FL_ORDER_DESCENDING   0x20000

Newest / biggest / Z first.

#define MA_MEDIA_TYPE_UNKNOWN   -1

Indicatest an unknown multimedia type.

#define MA_MEDIA_TYPE_IMAGE   0

Indicates an image type. This is used in multimedia operations.

#define MA_MEDIA_RES_OK   0

Indicates that the multimedia operation was successful.

Indicatest that the operation of exporting an image failed.

#define MA_FPROP_IS_BACKED_UP   1
#define MA_FERR_GENERIC   -2
#define MA_FERR_NOTFOUND   -3
#define MA_FERR_FORBIDDEN   -4
#define MA_FERR_RENAME_FILESYSTEM   -5
#define MA_FERR_RENAME_DIRECTORY   -6
#define MA_FERR_WRONG_TYPE   -7
#define MA_FERR_SORTING_UNSUPPORTED   -8

The sorting method requested is unsupported on the current platform.

#define MA_FERR_NO_SUCH_PROPERTY   -9
#define MA_SMS_RESULT_SENT   1

The SMS was sent.

Values for the status field in the EVENT_TYPE_SMS event. This event is sent on Android and iOS. Note: On iOS platforms the MA_SMS_RESULT_DELIVERED message corresponds To the SMS being successfully queued by the system. There is no way to know if it was actually delivered.

#define MA_SMS_RESULT_NOT_SENT   2

The SMS was NOT sent.

#define MA_SMS_RESULT_DELIVERED   3

The SMS was delivered.

The SMS was NOT delivered.

#define MA_NETWORK_UNKNOWN   0
#define MA_NETWORK_NO_SERVICE   1
#define MA_NETWORK_EMERGENCY_ONLY   2
#define MA_NETWORK_SEARCHING   3
#define MA_NETWORK_BUSY   4
#define MA_NETWORK_HOME   5

Your operator's home network. Data connections are possible here.

#define MA_NETWORK_DENIED   6
#define MA_NETWORK_ROAMING   7

You're abroad. Data connections are possible here, but usually, extremely expensive. Avoid making any connections unless you have WLAN access, or the user is very sure of the cost.

#define MA_IAP_METHOD_STANDARD   1

The default. Connects to the IAP saved by maIapSave(), or, if there is no saved IAP, opens the IAP selection dialog.

#define MA_IAP_METHOD_WLAN   2

Connects to the WLAN IAP with the highest signal strength.

#define MA_IAP_FILTER_NOT_WLAN   1

All IAPs except WLAN.

#define MA_IAP_FILTER_WLAN   2

Only WLAN IAPs.

#define MA_IAP_FILTER_ALL   3

All IAPs. This is the default.

#define MA_TB_TYPE_ANY   0

The user is allowed to enter any text, including line breaks.

#define MA_TB_TYPE_EMAILADDR   1

The user is allowed to enter an e-mail address.

#define MA_TB_TYPE_NUMERIC   2

The user is allowed to enter an integer value.

#define MA_TB_TYPE_PHONENUMBER   3

The user is allowed to enter a phone number.

#define MA_TB_TYPE_URL   4

The user is allowed to enter a URL.

#define MA_TB_TYPE_DECIMAL   5

The user is allowed to enter a real number value. This extends MA_TB_TYPE_NUMERIC by allowing a decimal point.

#define MA_TB_TYPE_SINGLE_LINE   100

The user is allowed to enter any text, except for line breaks. Unavailable on some platforms. In that case, maTextBox() will return MA_TB_RES_TYPE_UNAVAILABLE. You can use MA_TB_TYPE_ANY instead.

#define MA_TB_TYPE_MASK   0xFFFF

Use this to separate types from flags in the constraints parameter. This is not a valid type value.

#define MA_TB_RES_OK   1

The user chose OK.

#define MA_TB_RES_CANCEL   2

The user chose Cancel.

#define MA_TB_RES_TYPE_UNAVAILABLE   -3

The specified type is unavailable on this platform.

#define MA_TB_FLAG_PASSWORD   0x10000

Indicates that the text entered is confidential data that should be obscured whenever possible. This implies MA_TB_FLAG_SENSITIVE.

#define MA_TB_FLAG_UNEDITABLE   0x20000

Indicates that editing is disallowed.

#define MA_TB_FLAG_SENSITIVE   0x40000

Indicates that the text entered is sensitive data that the implementation must never store into a dictionary or table for use in predictive, auto-completing, or other accelerated input schemes. A credit card number is an example of sensitive data.

#define MA_TB_FLAG_NON_PREDICTIVE   0x80000

Indicates that the text entered does not consist of words that are likely to be found in dictionaries typically used by predictive input schemes.

#define MA_TB_FLAG_INITIAL_CAPS_WORD   0x100000

This flag is a hint to the implementation that during text editing, the initial letter of each word should be capitalized.

#define MA_TB_FLAG_INITIAL_CAPS_SENTENCE   0x200000

This flag is a hint to the implementation that during text editing, the initial letter of each sentence should be capitalized.

A persistent notification that will launch the application when selected.

#define MA_WAKE_LOCK_ON   1

Application will run with screen on (consumes power).

#define MA_WAKE_LOCK_OFF   2

Turn off the wake lock.

#define MA_TOAST_DURATION_SHORT   0

The toast timeout. Toasts can be displayed using maToast.

#define MA_TOAST_DURATION_LONG   1

Together with the image picker event (IMAGE_PICKER ), this specifies the type of encoding used for the image data returned.

Determines what kind of event do we need from the image picker.

#define IOCTL_UNAVAILABLE   -1

Typedef Documentation

typedef char* MAString
typedef wchar* MAWString
typedef void* MAAddress
typedef int MAHandle
typedef int MAExtent
typedef unsigned char byte
typedef unsigned long ulong
typedef long long longlong
typedef int MAExtensionModule
typedef int MAExtensionFunction

Function Documentation

int maCheckInterfaceVersion ( int  hash)

Compares the runtime's interface version with yours, using a hash of the interface's contents.

If the versions do not match, a MoSync Panic is generated.

This function returns the runtime's hash. However, if there is a version mismatch, syscall and IOCTL numbers may differ between the runtime and your version of the header files, causing a different function than this to be called.

The hash appears as a 32-bit random number, so it is very unlikely that the return value from any other function is the same as the runtime's hash.

Therefore, you should always compare the return value from this function to your hash and exit your program, preferably using maPanic(), if they don't match.

Parameters:
hashYour hash. Pass MAIDL_HASH.
Returns:
The runtime's hash.
void maExit ( int  result)

Shuts down the system. This function does not return.

Parameters:
resultPassed to the operating system, where applicable. Ignored otherwise.
void maPanic ( int  result,
const char *  message 
)

Displays a message to the user, then shuts down the system. This function does not return.

Parameters:
resultPassed to the operating system, where applicable. Ignored otherwise.
messageThe message should be short, not more than 40 characters, to ensure its visibility on all screen sizes.
See also:
MAPanicReport
void* memset ( void *  dst,
int  val,
ulong  size 
)

Sets size bytes, starting at dst, to the specified value, interpreted as an unsigned char.

Returns:
dst.

Referenced by MAUtil::Dictionary< Key, Storage >::DictNode::DictNode(), and MAUtil::HashDict< Key, Storage >::HashNode::HashNode().

void* memcpy ( void *  dst,
const void *  src,
ulong  size 
)

Copies the values of size bytes from the location pointed by src directly to the memory block pointed by dst.

The underlying type of the objects pointed by both the source and destination pointers are irrelevant for this function; The result is a binary copy of the data.

The function does not check for any terminating null character in source - it always copies exactly size bytes.

To avoid overflows, the size of the arrays pointed by both the destination and source parameters, shall be at least size bytes, and should not overlap (for overlapping memory blocks, memmove() is a safe approach).

Returns:
dst.
int strcmp ( const char *  str1,
const char *  str2 
)

Compares the C string str1 to the C string str2.

This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ or until a terminanting null-character is reached.

Returns:
An integral value indicating the relationship between the strings: A zero value indicates that both strings are equal. A value greater than zero indicates that the first character that does not match has a greater value in str1 than in str2. A value less than zero indicates the opposite.
char* strcpy ( char *  dst,
const char *  src 
)

Copies the C string pointed by src into the array pointed by dst, including the terminating null character.

To avoid overflows, the size of the array pointed by dst shall be long enough to contain the same C string as src (including the terminating null character), and should not overlap in memory with src.

Returns:
dst.
double __adddf3 ( double  a,
double  b 
)

Returns a + b.

double __subdf3 ( double  a,
double  b 
)

Returns a - b.

double __muldf3 ( double  a,
double  b 
)

Returns a * b.

double __divdf3 ( double  a,
double  b 
)

Returns a / b. If b == 0, a MoSync Panic is thrown.

double __negdf2 ( double  a)

Returns -a.

int __fixdfsi ( double  a)

Returns the integer part of a.

uint __fixunsdfsi ( double  a)

Returns the unsigned integer part of a. Negative values become zero.

double __floatsidf ( int  a)

Returns the double representation of a.

double __extendsfdf2 ( float  a)

Returns the double representation of a.

int dcmp ( double  a,
double  b 
)

Returns >0 if a > b, 0 if a == b and <0 if a < b. If either argument is Not a Number, the result is undefined.

float __addsf3 ( float  a,
float  b 
)

Returns a + b.

float __subsf3 ( float  a,
float  b 
)

Returns a - b.

float __mulsf3 ( float  a,
float  b 
)

Returns a * b.

float __divsf3 ( float  a,
float  b 
)

Returns a / b. If b == 0, a MoSync Panic is thrown.

float __negsf2 ( float  a)

Returns -a.

int __fixsfsi ( float  a)

Returns the integer part of a.

uint __fixunssfsi ( float  a)

Returns the unsigned integer part of a. Negative values become zero.

float __floatsisf ( int  a)

Returns the float representation of a.

float __truncdfsf2 ( double  a)

Returns the float representation of a.

int fcmp ( float  a,
float  b 
)

Returns >0 if a > b, 0 if a == b and <0 if a < b. If either argument is Not a Number, the result is undefined.

double sin ( double  x)

Returns the sine of x.

Parameters:
xAn angle in radians.
double cos ( double  x)

Returns the cosine of x.

Parameters:
xAn angle in radians.
double tan ( double  x)

Returns the tangent of x.

Parameters:
xAn angle in radians.
double sqrt ( double  x)

Returns the square root of x.

int maSetColor ( int  rgb)

Sets the color used by drawing functions. Returns previous color. Initial color is 0 (black).

Parameters:
rgbA color in RGB8 format (0xRRGGBB). The top byte is ignored.
void maSetClipRect ( int  left,
int  top,
int  width,
int  height 
)

Sets the clipping rectangle for the current draw target. The screen and every drawable image each maintains a clipping rectangle. Drawing operations have no effect outside the clipping rectangle. The default clipping rectangle covers the entire draw target, so that clipping occurs at the draw target's edges.

void maGetClipRect ( MARect out)

Returns the clipping rectangle for the current draw target.

void maPlot ( int  posX,
int  posY 
)

Draws a single pixel using the current color.

See also:
maSetColor()
void maLine ( int  startX,
int  startY,
int  endX,
int  endY 
)

Draws a line using the current color.

See also:
maSetColor()
void maFillRect ( int  left,
int  top,
int  width,
int  height 
)

Draws a filled rectangle using the current color. Width and height must be greater than zero.

See also:
maSetColor()
void maFillTriangleStrip ( const MAPoint2d points,
int  count 
)

Draws a filled triangle strip using the current color.

Parameters:
pointsA pointer to an array of count MAPoint2d:s representing the vertices of the strip.
countThe count of vertices in the strip. Must be at least 3.
See also:
maSetColor()
void maFillTriangleFan ( const MAPoint2d points,
int  count 
)

Draws a filled triangle fan using the current color.

Parameters:
pointsA pointer to an array of count MAPoint2d:s representing the vertices of the fan.
countThe count of vertices in the fan. Must be at least 3.
See also:
maSetColor()
MAExtent maGetTextSize ( const char *  str)

Returns the size in pixels of Latin-1 text as it would appear on-screen.

MAExtent maGetTextSizeW ( const wchar *  str)

Returns the size in pixels of Unicode text as it would appear on-screen.

void maDrawText ( int  left,
int  top,
const char *  str 
)

Draws Latin-1 text using the current color. The coordinates are the top-left corner of the text's bounding box.

See also:
maSetColor()
void maDrawTextW ( int  left,
int  top,
const wchar *  str 
)

Draws Unicode text using the current color. The coordinates are the top-left corner of the text's bounding box.

See also:
maSetColor()
void maUpdateScreen ( void  )

Copies the back buffer to the physical screen.

void maResetBacklight ( void  )

Normally, a phone's backlight turns itself off after a few seconds of the user not pressing any keys. To avoid this behaviour, call this function periodically. As the timeout period is different for every device, and sometimes even user-configurable, it's recommended that you call this function at least once every 500 milliseconds to ensure that the light stays on at all times.

MAExtent maGetScrSize ( void  )

Returns the screen size. Returns the screen size.

void maDrawImage ( MAHandle  image,
int  left,
int  top 
)

Draws an image. It it placed on the draw target with the top left corner according to the parameters.

void maDrawRGB ( const MAPoint2d dstPoint,
const void *  src,
const MARect srcRect,
int  scanlength 
)

Draws an image. The source is an array of ints that represent pixels in ARGB format.

Parameters:
dstPointThe top-left point on the draw target.
srcThe address to the source image.
srcRectThe portion of the source image to be drawn.
scanlengthThe width, in pixels, of the image represented by the source array.
void maDrawImageRegion ( MAHandle  image,
const MARect srcRect,
const MAPoint2d dstPoint,
int  transformMode 
)

Draws a portion of an image using a transformation.

Parameters:
imageThe source image.
srcRectThe portion of the source image to be drawn. Must not exceed the bounds of the source image.
dstPointThe top-left point on the draw target.
transformModeOne of the TRANS constants.
See also:
maDrawImage

Returns the size of an image.

void maGetImageData ( MAHandle  image,
void *  dst,
const MARect srcRect,
int  scanlength 
)

Copies an image into an array of ints that represent pixels in little-endian ARGB format. The destination rectangle is defined as { 0,0, srcRect.width, srcRect.height }. Parts of the destination array that are outside the destination rectangle are not modified. If srcRect is outside the bounds of the source image, or if srcRect.width is greater than scanlength, a MoSync Panic is thrown.

Parameters:
imageThe handle to the source image.
dstThe address of the destination array.
scanlengthThe width of the image, in pixels, represented by the destination array.
srcRectThe portion of the source image to be copied.

Sets the current draw target. The handle must be a drawable image or HANDLE_SCREEN, which represents the back buffer. The initial draw target is the back buffer. If an image is set as draw target, its object handle goes into flux, which prevents its destruction or use as a source in maDrawImage. When a different draw target is set, the image's handle is restored. Returns the the previously set draw target.

See also:
maCreateDrawableImage()
int maFindLabel ( const char *  name)

Finds the label resource with the specified name and returns its index. If it is not found, -1 is returned.

int maCreateImageFromData ( MAHandle  placeholder,
MAHandle  data,
int  offset,
int  size 
)

Creates an image object using encoded data from a data object. All platforms support the PNG format. Some platforms may also support JPEG and/or GIF.

Parameters:
placeholderThe placeholder for the image object that is to be created.
dataThe data object that holds the encoded data.
offsetThe offset in the data object where the encoded data begins.
sizeThe size in bytes of the encoded data.
Returns:
RES_OK if succeded and RES_OUT_OF_MEMORY or RES_BAD_INPUT if failed.
int maCreateImageRaw ( MAHandle  placeholder,
const void *  src,
MAExtent  size,
int  alpha 
)

Creates an image object using raw ARGB data.

Parameters:
placeholderThe placeholder for the image object that is to be created.
srcAddress of the raw data. 4 bytes per pixel, format 0xAARRGGBB.
sizeThe size in pixels of the image, constructed using the EXTENT() macro.
alphaNon-zero if the resulting image should have an alpha channel, zero otherwise.
Returns:
RES_OK if succeded and RES_OUT_OF_MEMORY if failed.
int maCreateDrawableImage ( MAHandle  placeholder,
int  width,
int  height 
)

Creates a drawable image of the specified size. A drawable image has no alpha channel, which is to say, no transparency. Its initial contents are undefined, so you should draw onto the entire surface to be sure what will happen when you draw this image onto something else.

Parameters:
placeholderThe resource handle of the new image.
widthWidth, in pixels, of the new image. Must be > 0.
heightHeight, in pixels, of the new image. Must be > 0.
See also:
maSetDrawTarget()
Returns:
RES_OK if succeded and RES_OUT_OF_MEMORY if failed.
int maCreateData ( MAHandle  placeholder,
int  size 
)

Creates a data object of the specified size, in bytes. Its initial contents are undefined.

Returns:
RES_OK if succeded and RES_OUT_OF_MEMORY if failed.

Creates a new placeholder and returns the handle to it.

void maDestroyPlaceholder ( MAHandle  handle)

Releases a handle returned by maCreatePlaceholder(). If the handle refers to an object, such as an image or a data object, that object is destroyed, as if maDestroyObject() had been called.

The released handle may be reused by the system and returned by future calls to maCreatePlaceholder(), or by other system functions that allocate resources dynamically.

This function is preferred to maDestroyObject(), unless you need to reuse the handle.

Attempting to destroy a handle that has already been released, or was not returned by maCreatePlaceholder(), will cause a MoSync Panic.

Parameters:
handleThe handle to be released.

Referenced by MAP::MapTile::~MapTile().

void maDestroyObject ( MAHandle  handle)

Destroys an object of any type. The handle becomes a placeholder.

int maGetDataSize ( MAHandle  data)

Returns the size, in bytes, of a data object.

void maReadData ( MAHandle  data,
void *  dst,
int  offset,
int  size 
)

Reads size bytes from a data object, starting at offset, into memory pointed to by dst.

Warning:
Do not attempt to read zero bytes or out of bounds; it is not supported and will result in a MoSync Panic.

Referenced by MAUtil::DataHandler::read().

void maWriteData ( MAHandle  data,
const void *  src,
int  offset,
int  size 
)

Writes size bytes to a data object, starting at offset, from memory pointed to by src.

Referenced by MAUtil::DataHandler::write().

void maCopyData ( const MACopyData params)

Copies size bytes from data object src to dst, at the specified offsets.

MAHandle maOpenStore ( const char *  name,
int  flags 
)

Opens a permanent data store, optionally creates one if it doesn't exist already.

Returns a Store MAHandle on success. Returns STERR_NONEXISTENT if !(flags & MAS_CREATE_IF_NECESSARY) and the store does not exist. Returns another STERR code if the store could not be opened for another reason.

Parameters:
nameThe name of the store. A store name must have from 1 to 32 characters, and must not contain any of the following characters: "/\:;?*'
flagsA combination of MAS flags, or zero.
int maWriteStore ( MAHandle  store,
MAHandle  data 
)

Writes the contents of a data object to a store. Destroys any data previously in the store. Returns > 0 on success, STERR_FULL if the storage system is full, or another STERR code if the write failed for another reason.

Parameters:
storeThe store to write to.
dataThe data object to read from.
int maReadStore ( MAHandle  store,
MAHandle  placeholder 
)

Creates a data object and copies the contents of a store to it. Use maGetDataSize to get the size of the data.

Parameters:
storeThe store to read from.
placeholderThe placeholder handle where a data object will be created.
Returns:
RES_OK if succeded and RES_OUT_OF_MEMORY if failed.
void maCloseStore ( MAHandle  store,
int  _delete 
)

Closes a store. Also deletes that store if _delete is non-zero.

MAHandle maConnect ( const char *  url)

Asynchronously opens a connection using the specified URL. A URL takes the following form: <protocol>://<address>[:<port>]<parameters>
The following protocols are supported:

socket, which is TCP. It has no parameters.

datagram, which is UDP. It has no parameters. Datagrams may arrive corrupted, out-of-order, duplicated, or not at all.

ssl, which is an encrypted TCP connection. It has no parameters.

http, which is HTTP/1.0 GET. When using HTTP, you need not specify the port; it defaults to port 80.

Its parameters is the document path (for example, "/index.html"). You must specify a path, or this function will fail with CONNERR_URL. The minimal path ("/") is acceptable.

Writing to a http connection is not allowed.

https, which is an encrypted HTTP GET. It has the same parameters as http.

btspp, which is Bluetooth Serial Port. It has no parameters.

For the socket and http protocols, <address> can be either a decimal, dot-delimited (.) IPv4 address or a standard Domain Name, while <port> is a decimal number from 1 to 65535.

In the socket protocol, certain ports are protected on certain platforms and cannot be used, most notably port 80 on Java ME. In this case, use http instead.

On a few devices, using ports numbered below 1024 may cause system crashes. Therefore, it is advisable to use ports above 1024 if you can choose.

On some J2ME devices, connections to port 443 (except from https) is not allowed and might cause a system exception.

For the btspp protocol, <address> is 12 hexadecimal digits and <port> is a decimal number from 1 to 30.

Example TCP url: socket://www.example.com:23

Example UDP url: datagram://www.example.com:53

Example SSL url: ssl://www.example.com:22

Example HTTP url: http://www.example.com/directory/document.html

Example HTTPS url: https://www.google.com

Example Bluetooth url: btspp://001dbe15e455:9

You can also use MAUtil::BluetoothConnection to connect via Bluetooth service uuid.

To find useful Bluetooth addresses, use the Bluetooth discovery API. See maBtStartDeviceDiscovery().

The result of the operation will be delivered in a CONN event, with MAConnEventData::opType set to CONNOP_CONNECT.

The success value is > 0. For the http protocol, the success value is the HTTP response code.

When you're done with the connection, maConnClose() must be called to free the resources associated with the handle. This must be done even if the connect operation failed.

There is a limit of CONN_MAX open connection handles at any time, so if you keep opening connections without closing them, you'll eventually receive the CONNERR_MAX error code instead of new connection handles.

Alternatively, this function can be called with one of these url types to create a Server Connection:
socket://[:<port>], for TCP.
btspp://localhost:<uuid>[;name=<YourServiceName>], for Bluetooth.
<uuid> is a 32-digit hexadecimal number. It will be used to create the service record. Its MAUUID representation can be used by clients to search for this service.

Example Bluetooth server url: btspp://localhost:0000110100001000800000805F9B34FB;name=Serial Port

Server connections are created synchronously; no CONN event is generated, and as soon as this function returns, it's done.

A server connection can not be read from or written to, but it can be closed. You can also use it in calls to maAccept() and maConnGetAddr().

Alternatively, you can use this url type to create an unbound UDP connection: datagram://[:<port>]

Such connections must use maConnReadFrom() and maConnWriteTo(). None of the other Read or Write functions will work, because they require a binding to a remote socket.

Like server connections, unbound UDP connections are created synchronously; no CONN event is generated.

Returns:
The connecting handle >0, or one of the CONNERR values.
See also:
maGetEvent()
MoSync Connection API Overview
void maConnClose ( MAHandle  conn)

Closes a connection, freeing any resources associated with the handle.

Cancels any active operations on the connection. Such operations will finish with CONNERR_CANCELED.

void maConnRead ( MAHandle  conn,
void *  dst,
int  size 
)

Asynchronously reads at least one and at most size bytes from a connection to memory.

The result of the operation will be delivered in a CONN event, with MAConnEventData::opType set to CONNOP_READ. The success value is the number of bytes read.

Datagrams may be bigger than the receiving buffer. In that case,

See also:
maGetEvent
MoSync Connection API Overview
void maConnWrite ( MAHandle  conn,
const void *  src,
int  size 
)

Asynchronously writes size bytes to a connection from memory.

The result of the operation will be delivered in a CONN event, with MAConnEventData::opType set to CONNOP_WRITE. The success value is > 0.

Warning:
The source data must remain available until the operation is complete, so if it was dynamically allocated, don't free it too early.
See also:
maGetEvent
MoSync Connection API Overview
void maConnReadToData ( MAHandle  conn,
MAHandle  data,
int  offset,
int  size 
)

Asynchronously reads at least one and at most size bytes from a connection to a data object, starting at the specified offset. During the read, the data object being written to will be in flux. Any attempt to access it will result in a Panic.

The result of the operation will be delivered in a CONN event, with MAConnEventData::opType set to CONNOP_READ. The success value is is the number of bytes read.

See also:
maGetEvent
MoSync Connection API Overview
void maConnWriteFromData ( MAHandle  conn,
MAHandle  data,
int  offset,
int  size 
)

Asynchronously writes size bytes to a connection from a data object, starting at the specified offset. During the write, the data object being read from will be in flux. Any attempt to access it will result in a Panic.

The result of the operation will be delivered in a CONN event, with MAConnEventData::opType set to CONNOP_WRITE. The success value is > 0.

See also:
maGetEvent
MoSync Connection API Overview
void maConnReadFrom ( MAHandle  conn,
void *  dst,
int  size,
MAConnAddr src 
)

Like maConnRead(), except it only works for unbound datagram connections, it can read messages from any sender, and it will save the source address.

Parameters:
srcWhen the read operation completes, the address of the sender will be written here. Therefore, the object being pointed to must remain valid for the duration of the operation. Don't use a local variable.
See also:
maConnRead
void maConnWriteTo ( MAHandle  conn,
const void *  src,
int  size,
const MAConnAddr dst 
)

Like maConnWrite(), except it only works for unbound datagram connections, and it can send messages to any address.

Parameters:
dstThe destination address of the datagram being sent. The object being pointed to is NOT required to remain valid after this function returns. You may use a local variable.
See also:
maConnWrite
int maConnGetAddr ( MAHandle  conn,
MAConnAddr addr 
)

Retrieves the address of a connection. On server connections, you'll get the local address. On normal connections, you'll get the remote address.

You can pass HANDLE_LOCAL to retrieve the local address. In that case, you must set MAConnAddr::family before calling this function, to tell it which address to retrieve. Also, the port member is not set.

Returns:
< 0 on error.
MAHandle maHttpCreate ( const char *  url,
int  method 
)

Creates an unfinished HTTP/1.0 connection. You cannot read from this connection until it's been Finished. Before then, you can set request headers. After, you can get response headers.

POST connections are special; they let you write to the connection before it's Finished. The first write causes the underlying TCP connection to be established and request headers transmitted. After the first write has begun, you may no longer set request headers.

Parameters:
urlAn HTTP or HTTPS URL. See maConnect() for the exact form.
methodHTTP_GET, HTTP_POST, HTTP_HEAD, HTTP_PUT or HTTP_DELETE.
Returns:
An unfinished HTTP connection handle >0, or a CONNERR value.
See also:
maHttpFinish
void maHttpSetRequestHeader ( MAHandle  conn,
const char *  key,
const char *  value 
)

Sets a request header of an HTTP connection.

Overwrites any existing header with the same key. The keys is case-insensitive.

If the connection's method is HTTP_POST, it must not have been written to.

Parameters:
connAn unfinished HTTP connection handle.
keyThe name of the header.
valueThe new value of the header.
int maHttpGetResponseHeader ( MAHandle  conn,
const char *  key,
char *  buffer,
int  bufSize 
)

Stores an HTTP response header in the specified buffer.

The buffer may be too small to contain the header and the terminating zero; in that case, the buffer will not be filled and you should create a bigger buffer and call this function again. Use the return value to determine how long the buffer needs to be.

Parameters:
connA finished HTTP connection handle.
keyThe name of the header. Case-insensitive.
bufferA string buffer.
bufSizeThe size of the buffer, in bytes.
Returns:
The length of the header value, excluding the terminating zero, or CONNERR_NOHEADER if the header doesn't exist.
void maHttpFinish ( MAHandle  conn)

Asynchronously finishes an HTTP connection. This entails making the underlying TCP connection and sending request headers, unless that has already been done by a HTTP_POST write, and receiving the response headers.

The result of the operation will be delivered in a CONN event, with MAConnEventData::opType set to CONNOP_FINISH. The success value is the HTTP response code.

Parameters:
connAn unfinished HTTP connection handle.
See also:
maGetEvent
MoSync Connection API Overview
int maLoadResources ( MAHandle  data)

Loads a new object array from the a data object. The old object array is overwritten, except where the new array has SKIP objects. In those cases, the old objects are saved. Returns zero on error, >0 on success. On error, the old object array remains unchanged.

Parameters:
dataThe data object containing new resources, in the format of a MoSync compiled resource file.
Note:
There must not be any UBIN objects in the new array, except those of the old array that were SKIP'd.
int maLoadResource ( MAHandle  handle,
MAHandle  placeholder,
int  flag 
)

Loads a specific resource in the given placeholder.

Parameters:
handleThe handle of the resource that needs to be loaded
placeholderThe placeholder where to load the resource from handle.
flagOne of the MA_RESOURCE_OPEN, MA_RESOURCE_CLOSE, MA_RESOURCE_OPEN|MA_RESOURCE_CLOSE to control the resource binary.
int maCountResources ( void  )
void maLoadProgram ( MAHandle  data,
int  reload 
)

Loads a new program from the a data object, closes the running program, and starts the new one. The format of the data object is a MoSync program file concatenated with a resource file. If this function returns, there was an error.

Parameters:
dataThe data object containing the new program.
reloadIf non-zero, the original program will be reloaded after the new program has exited. If zero, MoSync will exit when the loaded program exists, unless that program, or one of its sub-programs, calls this function with reload set to non-zero.
Note:
A program that was loaded with this function cannot be reloaded; instead, it will always be the very first program in the chain that is reloaded.
The stored reload flag is or'd with the one provided to each call to this function. It is also reset when the reload occurs.
Thus, if one program loads another with reload on, and the loaded program loads another with reload off, the original program will still be reloaded when the last one exits. Should the original program decide to exit after being reloaded, it will not be reloaded again.
The close event will disable the reload mechanism.
int maGetKeys ( void  )

Returns a bitmask consisting of MAKB flags describing the current key state.

int maGetEvent ( MAEvent event)

There is a FIFO buffer that contains up to EVENT_BUFFER_SIZE events. Each event has a type. Some types have additional data.

This function retrieves the next event, unless the queue is empty. Use maWait() to wait until more events are available.

Parameters:
eventPointer to an MAEvent struct that will be filled with the next event.

When the Close event is posted, you must call maExit as soon as possible, or your program will be forcibly terminated. The timeout is device-dependent, but never longer than EVENT_CLOSE_TIMEOUT milliseconds.

After the Close event has been posted, most syscalls will stop working, returning default values and doing nothing. Only the following groups of functions are guaranteed to remain operational: Memory management, math, Resource management, Store, time, logging, maExit() and maPanic().

Note:
Not all platforms have the capability to generate a Close event. You must always provide another way for the user to exit your application.
Returns:
> 0 on success, or zero if the buffer is empty.
void maWait ( int  timeout)

Suspends execution until there is an event in the buffer, or timeout milliseconds have passed. A timeout <= 0 is considered infinite. Timer accuracy is platform-specific, but should be better than 20 ms.

Use this function rather than idle loops to save CPU/battery power.

See also:
maGetEvent()
int maTime ( void  )

Returns the number of seconds that have passed since 00:00:00, Jan 1st, 1970, UTC, according to the device clock.

int maLocalTime ( void  )

Returns the number of seconds that have passed since 00:00:00, Jan 1st, 1970, local time, according to the device clock.

int maGetMilliSecondCount ( void  )

Returns the number of milliseconds that has passed since some unknown point in time. Accuracy is platform-specific, but should be better than 20 ms.

Referenced by MAP::MapTile::getMilliSecondsSinceCreated(), Time::start(), MAP::TraceScope::TraceScope(), Time::update(), and MAP::TraceScope::~TraceScope().

int maFreeObjectMemory ( void  )

Returns an approximation to the amount of memory currently available for allocating new objects, measured in bytes.

There may be more memory available than reported by this function. Conversely, in the time between calling this function and allocating an object, another program may have allocated an object of its own, decreasing the available memory.

The amount of memory required to allocate any specific object is device-dependent.

When using this function to determine whether or not to allocate an object, always leave some memory alone for use by the system, preferably about 10% of the device's total memory, as reported by maTotalObjectMemory().

int maTotalObjectMemory ( void  )

Returns the total amount of memory available to MoSync, measured in bytes. May change over time, even as the program is running.

int maVibrate ( int  ms)

Switches on the vibrator for the requested number of milliseconds, or switches it off if the requested duration is zero. A call to this function will override the previous call. Returns non-zero if the operation was allowed, zero if it wasn't.

On devices which has no vibrator, this function will always return zero. The user may turn vibration off in phone settings. In that case, calling this function with a duration of zero may return non-zero, but a non-zero duration will return zero. In any case, the only way to conclusively determine if vibration is currently supported or not is to call this function with a duration of at least 1(one) ms. On iPhone the argument won't be taken into account.

int maSoundPlay ( MAHandle  sound_res,
int  offset,
int  size 
)

Starts playing a sound.

If a sound was already playing, it is stopped.

The sound data is formatted as follows: <mime type><null terminator byte><encoded data>.

The .media directive in the MoSync resource compiler creates this formatting.

If you download or generate sound clips dynamically, you'll have to take care of the formatting yourself, or use a library that does it for you, for example MAUtil::AudioDownloader.

To play .media resources, use offset 0 and maGetDataSize().

Do not touch the resource while it's playing, or there will be... trouble.

Returns:
>= 0 on success and < 0 on failure.
Parameters:
sound_resThe data object in which the sound is stored.
offsetThe offset in the data object where the mime type and sound data is stored.
sizeThe size of mime type string and sound data.
void maSoundStop ( void  )

Stops any sound started with maSoundPlay().

int maSoundIsPlaying ( void  )

Returns > 0 if sound is playing, zero if it's not.

int maSoundGetVolume ( void  )

Returns the volume, in the range 0-100, used by the sound engine. The initial volume is 100.

void maSoundSetVolume ( int  vol)

Sets the volume, which is a value in the range 0-100. All other values will be clamped to the allowed range.

longlong maExtensionFunctionInvoke ( int  function,
int  a,
int  b,
int  c 
)

Invokes an extension function. Normally you don't call this function directly.

longlong maIOCtl ( int  function,
int  a,
int  b,
int  c 
)

These functions are available only on certain platforms. Returns -1 if the function is not available.

Referenced by glActiveTexture(), glAlphaFunc(), glAlphaFuncx(), glAttachShader(), glBindAttribLocation(), glBindBuffer(), glBindFramebuffer(), glBindFramebufferOES(), glBindRenderbuffer(), glBindRenderbufferOES(), glBindTexture(), glBlendColor(), glBlendEquation(), glBlendEquationSeparate(), glBlendFunc(), glBlendFuncSeparate(), glBufferData(), glBufferSubData(), glCheckFramebufferStatus(), glCheckFramebufferStatusOES(), glClear(), glClearColor(), glClearColorx(), glClearDepthf(), glClearDepthx(), glClearStencil(), glClientActiveTexture(), glClipPlanef(), glClipPlanex(), glColor4f(), glColor4ub(), glColor4x(), glColorMask(), glColorPointer(), glCompileShader(), glCompressedTexImage2D(), glCompressedTexSubImage2D(), glCopyTexImage2D(), glCopyTexSubImage2D(), glCreateProgram(), glCreateShader(), glCullFace(), glDeleteBuffers(), glDeleteFramebuffers(), glDeleteFramebuffersOES(), glDeleteProgram(), glDeleteRenderbuffers(), glDeleteRenderbuffersOES(), glDeleteShader(), glDeleteTextures(), glDepthFunc(), glDepthMask(), glDepthRangef(), glDepthRangex(), glDetachShader(), glDisable(), glDisableClientState(), glDisableVertexAttribArray(), glDrawArrays(), glDrawElements(), glEnable(), glEnableClientState(), glEnableVertexAttribArray(), glFinish(), glFlush(), glFogf(), glFogfv(), glFogx(), glFogxv(), glFramebufferRenderbuffer(), glFramebufferRenderbufferOES(), glFramebufferTexture2D(), glFramebufferTexture2DOES(), glFrontFace(), glFrustumf(), glFrustumx(), glGenBuffers(), glGenerateMipmap(), glGenerateMipmapOES(), glGenFramebuffers(), glGenFramebuffersOES(), glGenRenderbuffers(), glGenRenderbuffersOES(), glGenTextures(), glGetActiveAttrib(), glGetActiveUniform(), glGetAttachedShaders(), glGetAttribLocation(), glGetBooleanv(), glGetBufferParameteriv(), glGetClipPlanef(), glGetClipPlanex(), glGetError(), glGetFixedv(), glGetFloatv(), glGetFramebufferAttachmentParameteriv(), glGetFramebufferAttachmentParameterivOES(), glGetIntegerv(), glGetLightfv(), glGetLightxv(), glGetMaterialfv(), glGetMaterialxv(), glGetPointerv(), glGetProgramInfoLog(), glGetProgramiv(), glGetRenderbufferParameteriv(), glGetRenderbufferParameterivOES(), glGetShaderInfoLog(), glGetShaderiv(), glGetShaderPrecisionFormat(), glGetShaderSource(), glGetStringHandle(), glGetTexEnvfv(), glGetTexEnviv(), glGetTexEnvxv(), glGetTexParameterfv(), glGetTexParameteriv(), glGetTexParameterxv(), glGetUniformfv(), glGetUniformiv(), glGetUniformLocation(), glGetVertexAttribfv(), glGetVertexAttribiv(), glGetVertexAttribPointerv(), glHint(), glIsBuffer(), glIsEnabled(), glIsFramebuffer(), glIsFramebufferOES(), glIsProgram(), glIsRenderbuffer(), glIsRenderbufferOES(), glIsShader(), glIsTexture(), glLightf(), glLightfv(), glLightModelf(), glLightModelfv(), glLightModelx(), glLightModelxv(), glLightx(), glLightxv(), glLineWidth(), glLineWidthx(), glLinkProgram(), glLoadIdentity(), glLoadMatrixf(), glLoadMatrixx(), glLogicOp(), glMaterialf(), glMaterialfv(), glMaterialx(), glMaterialxv(), glMatrixMode(), glMultiTexCoord4f(), glMultiTexCoord4x(), glMultMatrixf(), glMultMatrixx(), glNormal3f(), glNormal3x(), glNormalPointer(), glOrthof(), glOrthox(), glPixelStorei(), glPointParameterf(), glPointParameterfv(), glPointParameterx(), glPointParameterxv(), glPointSize(), glPointSizePointerOES(), glPointSizex(), glPolygonOffset(), glPolygonOffsetx(), glPopMatrix(), glPushMatrix(), glReadPixels(), glReleaseShaderCompiler(), glRenderbufferStorage(), glRenderbufferStorageOES(), glRotatef(), glRotatex(), glSampleCoverage(), glSampleCoveragex(), glScalef(), glScalex(), glScissor(), glShadeModel(), glShaderBinary(), glShaderSource(), glStencilFunc(), glStencilFuncSeparate(), glStencilMask(), glStencilMaskSeparate(), glStencilOp(), glStencilOpSeparate(), glTexCoordPointer(), glTexEnvf(), glTexEnvfv(), glTexEnvi(), glTexEnviv(), glTexEnvx(), glTexEnvxv(), glTexImage2D(), glTexParameterf(), glTexParameterfv(), glTexParameteri(), glTexParameteriv(), glTexParameterx(), glTexParameterxv(), glTexSubImage2D(), glTranslatef(), glTranslatex(), glUniform1f(), glUniform1fv(), glUniform1i(), glUniform1iv(), glUniform2f(), glUniform2fv(), glUniform2i(), glUniform2iv(), glUniform3f(), glUniform3fv(), glUniform3i(), glUniform3iv(), glUniform4f(), glUniform4fv(), glUniform4i(), glUniform4iv(), glUniformMatrix2fv(), glUniformMatrix3fv(), glUniformMatrix4fv(), glUseProgram(), glValidateProgram(), glVertexAttrib1f(), glVertexAttrib1fv(), glVertexAttrib2f(), glVertexAttrib2fv(), glVertexAttrib3f(), glVertexAttrib3fv(), glVertexAttrib4f(), glVertexAttrib4fv(), glVertexAttribPointer(), glVertexPointer(), glViewport(), maAccept(), maAddDataSize(), maAdsAddBannerToLayout(), maAdsBannerCreate(), maAdsBannerDestroy(), maAdsBannerGetProperty(), maAdsBannerSetProperty(), maAdsRemoveBannerFromLayout(), maAlert(), maAudioBufferClose(), maAudioBufferInit(), maAudioBufferReady(), maAudioDataCreateFromResource(), maAudioDataCreateFromURL(), maAudioDataDestroy(), maAudioGetLength(), maAudioGetPendingBufferCount(), maAudioGetPosition(), maAudioInstanceCreate(), maAudioInstanceCreateDynamic(), maAudioInstanceDestroy(), maAudioPause(), maAudioPlay(), maAudioPrepare(), maAudioSetNumberOfLoops(), maAudioSetPosition(), maAudioSetVolume(), maAudioStop(), maAudioSubmitBuffer(), maAutostartOff(), maAutostartOn(), maBringToForeground(), maBtCancelDiscovery(), maBtGetNewDevice(), maBtGetNewService(), maBtGetNextServiceSize(), maBtStartDeviceDiscovery(), maBtStartServiceDiscovery(), maCallAnswer(), maCallDial(), maCallHangup(), maCameraFormat(), maCameraFormatNumber(), maCameraGetProperty(), maCameraNumber(), maCameraPreviewEventConsumed(), maCameraPreviewEventDisable(), maCameraPreviewEventEnable(), maCameraPreviewSize(), maCameraRecord(), maCameraSelect(), maCameraSetPreview(), maCameraSetProperty(), maCameraSnapshot(), maCameraSnapshotAsync(), maCameraStart(), maCameraStop(), maCaptureAction(), maCaptureDestroyData(), maCaptureGetImagePath(), maCaptureGetProperty(), maCaptureGetVideoPath(), maCaptureSetProperty(), maCaptureWriteImage(), maDBClose(), maDBCursorDestroy(), maDBCursorGetColumnData(), maDBCursorGetColumnDouble(), maDBCursorGetColumnInt(), maDBCursorGetColumnText(), maDBCursorNext(), maDBExecSQL(), maDBExecSQLParams(), maDBOpen(), maDumpCallStackEx(), maExtensionFunctionLoad(), maExtensionModuleLoad(), maFileAvailableSpace(), maFileClose(), maFileCreate(), maFileDate(), maFileDelete(), maFileExists(), maFileListClose(), maFileListNext(), maFileListStart(), maFileOpen(), maFileRead(), maFileReadToData(), maFileRename(), maFileSeek(), maFileSetProperty(), maFileSize(), maFileTell(), maFileTotalSpace(), maFileTruncate(), maFileWrite(), maFileWriteFromData(), maFontDelete(), maFontGetCount(), maFontGetName(), maFontLoadDefault(), maFontLoadWithName(), maFontSetCurrent(), maFrameBufferClose(), maFrameBufferGetInfo(), maFrameBufferInit(), maGetBatteryCharge(), maGetCellInfo(), maGetMemoryProtection(), maGetSystemProperty(), maHomeScreenEventsOff(), maHomeScreenEventsOn(), maHomeScreenShortcutAdd(), maHomeScreenShortcutRemove(), maIapReset(), maIapSave(), maIapSetFilter(), maIapSetMethod(), maIapShutdown(), maImagePickerOpen(), maImagePickerOpenWithEventReturnType(), maKeyCaptureStart(), maKeyCaptureStop(), maKeypadIsLocked(), maLocationStart(), maLocationStop(), maLockKeypad(), maMessageBox(), maNetworkStatus(), maNFCAuthenticateMifareSector(), maNFCBatchCommit(), maNFCBatchRollback(), maNFCBatchStart(), maNFCCloseTag(), maNFCConnectTag(), maNFCCreateNDEFMessage(), maNFCDestroyTag(), maNFCGetId(), maNFCGetMifareBlockCountInSector(), maNFCGetMifareSectorCount(), maNFCGetNDEFId(), maNFCGetNDEFMessage(), maNFCGetNDEFPayload(), maNFCGetNDEFRecord(), maNFCGetNDEFRecordCount(), maNFCGetNDEFTnf(), maNFCGetNDEFType(), maNFCGetSize(), maNFCGetTypedTag(), maNFCIsReadOnly(), maNFCIsType(), maNFCMifareSectorToBlock(), maNFCReadMifareBlocks(), maNFCReadMifarePages(), maNFCReadNDEFMessage(), maNFCReadTag(), maNFCSetNDEFId(), maNFCSetNDEFPayload(), maNFCSetNDEFTnf(), maNFCSetNDEFType(), maNFCSetReadOnly(), maNFCStart(), maNFCStop(), maNFCTransceive(), maNFCWriteMifareBlocks(), maNFCWriteMifarePages(), maNFCWriteNDEFMessage(), maNotificationAdd(), maNotificationGetIconBadge(), maNotificationLocalCreate(), maNotificationLocalDestroy(), maNotificationLocalGetProperty(), maNotificationLocalSchedule(), maNotificationLocalSetProperty(), maNotificationLocalUnschedule(), maNotificationPushDestroy(), maNotificationPushGetData(), maNotificationPushGetRegistration(), maNotificationPushRegister(), maNotificationPushSetDisplayFlag(), maNotificationPushSetMessageTitle(), maNotificationPushSetTickerText(), maNotificationPushUnregister(), maNotificationRemove(), maNotificationSetIconBadge(), maOpenGLCloseFullscreen(), maOpenGLInitFullscreen(), maOpenGLTexImage2D(), maOpenGLTexSubImage2D(), maOptionsBox(), maPimFieldType(), maPimItemAddValue(), maPimItemClose(), maPimItemCount(), maPimItemCreate(), maPimItemFieldCount(), maPimItemGetAttributes(), maPimItemGetField(), maPimItemGetLabel(), maPimItemGetValue(), maPimItemRemove(), maPimItemRemoveValue(), maPimItemSetLabel(), maPimItemSetValue(), maPimListClose(), maPimListNext(), maPimListNextSummary(), maPimListOpen(), maPlatformRequest(), maProtectMemory(), maPurchaseCreate(), maPurchaseDestroy(), maPurchaseGetField(), maPurchaseGetName(), maPurchaseRequest(), maPurchaseRestoreTransactions(), maPurchaseSetPublicKey(), maPurchaseSetStoreURL(), maPurchaseSupported(), maPurchaseVerifyReceipt(), maRecordPause(), maRecordSetup(), maRecordStart(), maReportCallStack(), maReportResourceInformation(), maSaveImageToDeviceGallery(), maScreenGetCurrentOrientation(), maScreenGetSupportedOrientations(), maScreenSetFullscreen(), maScreenSetOrientation(), maScreenSetSupportedOrientations(), maScreenStateEventsOff(), maScreenStateEventsOn(), maSendTextSMS(), maSendToBackground(), maSensorStart(), maSensorStop(), maSetMemoryProtection(), maShowVirtualKeyboard(), maSoundPlayConn(), maStreamClose(), maStreamLength(), maStreamPause(), maStreamPos(), maStreamResume(), maStreamSetPos(), maStreamVideoSetFrame(), maStreamVideoSize(), maStreamVideoStart(), maSyscallPanicsDisable(), maSyscallPanicsEnable(), maTextBox(), maToast(), maUnlockKeypad(), maUnprotectMemory(), maWakeLock(), maWidgetAddChild(), maWidgetCreate(), maWidgetDestroy(), maWidgetGetProperty(), maWidgetInsertChild(), maWidgetModalDialogHide(), maWidgetModalDialogShow(), maWidgetRemoveChild(), maWidgetScreenAddOptionsMenuItem(), maWidgetScreenShow(), maWidgetScreenShowWithTransition(), maWidgetSetProperty(), maWidgetStackScreenPop(), maWidgetStackScreenPush(), maWlanGetNewAp(), maWlanStartDiscovery(), and maWriteLog().

MAExtensionModule maExtensionModuleLoad ( const char *  id,
int  hash 
)

Loads an extension module. Normally you don't call this function directly.

References maIOCtl().

Loads an extension function. Normally you don't call this function directly.

References maIOCtl().

MAHandle maFontLoadDefault ( int  type,
int  style,
int  size 
)

Returns a handle to one of the default fonts of the device, in the style and size you specify.

Parameters:
'type'The type of the font, can be FONT_TYPE_[SANS_SERIF,SERIF,MONOSPACE].
'style'The style of the font, can be FONT_STYLE_[NORMAL,BOLD,ITALIC].
'size'The size of the font.
Returns:
The handle to the font, RES_FONT_NO_TYPE_STYLE_COMBINATION, or RES_FONT_INVALID_SIZE.

References maIOCtl().

Sets the font to be used with maDrawText and maDrawTextW, and returns the handle to the previous font.

Parameters:
'font'an MAHandle for a font object.
Returns:
The handle to the previous font, or RES_FONT_INVALID_HANDLE.

References maIOCtl().

int maFontGetCount ( void  )

Returns the number of fonts that are available in the system.

Returns:
Number of fonts.
See also:
maFontGetName.

References maIOCtl().

int maFontGetName ( int  index,
char *  buffer,
int  bufferLen 
)

Copies the font postscript name of the given index to the buffer. You must have first called maFontGetCount() at least once before calling this function.

Parameters:
'index'A 0-based index to the font.
'buffer'An empty char buffer that will receive the font name.
'bufferLen'The size of the buffer.
Returns:
The number of bytes copied (with terminating NULL) or RES_FONT_INDEX_OUT_OF_BOUNDS or RES_FONT_INSUFFICIENT_BUFFER or RES_FONT_LIST_NOT_INITIALIZED.
See also:
maFontGetCount, maFontLoadWithName.

References maIOCtl().

MAHandle maFontLoadWithName ( const char *  postScriptName,
int  size 
)

Returns a handle to a font with the specific postscript name and size.

Parameters:
'postScriptName'The postscript name of the font.
'size'The size of the font.
Returns:
Handle to the font, RES_FONT_NAME_NONEXISTENT, or RES_FONT_INVALID_SIZE.

References maIOCtl().

int maFontDelete ( MAHandle  font)

Deletes a loaded font

Parameters:
'font'A font handle
Returns:
RES_FONT_OK, RES_FONT_INVALID_HANDLE, or RES_FONT_DELETE_DENIED.

References maIOCtl().

int maReportCallStack ( void  )

Sends the current call stack to the report pipe. Returns 0 if succeeded.

References maIOCtl().

int maDumpCallStackEx ( const char *  str,
int  data 
)

Dumps a string, an int, and the current call stack to the log file. Returns 0 if succeeded.

References maIOCtl().

void maProtectMemory ( const void *  start,
int  length 
)

Protects a piece of the data memory. Any attempt to write to that piece of memory will raise a panic.

Parameters:
'start'The start address of the memory piece to protect.
'length'The length of the memory piece to protect.

References maIOCtl().

void maUnprotectMemory ( const void *  start,
int  length 
)

Unprotects a piece of the data memory.

Parameters:
'start'The start address of the memory piece to unprotect.
'length'The length of the memory piece to unprotect.

References maIOCtl().

void maSetMemoryProtection ( int  enable)

Toggles memory protection.

Parameters:
'enable'If 1 turns on memory protection, if 0 turns of memory protection.

References maIOCtl().

int maGetMemoryProtection ( void  )

Returns if memory protection is enabled or not.

Returns:
'1' if memory protection is turned on, '0' if it is turned off.

References maIOCtl().

int maGetBatteryCharge ( void  )

Returns the percentage of battery power remaining. This is an integer between 0 and 100. Currently only available on some Symbian and Windows Mobile phones.

References maIOCtl().

int maLockKeypad ( void  )

Calls on the operating system to lock the phone's keypad. Returns > 0 if successful.

References maIOCtl().

int maUnlockKeypad ( void  )

Calls on the operating system to unlock the phone's keypad. Returns > 0 if successful.

References maIOCtl().

int maKeypadIsLocked ( void  )

Returns > 0 if the phone's keypad is locked by the operating system, zero otherwise.

References maIOCtl().

int maWriteLog ( const void *  src,
int  size 
)

Writes data to the MoSync system log file. Useful only for debugging purposes.

References maIOCtl().

int maBtStartDeviceDiscovery ( int  names)

Starts a device discovery operation.

Parameters:
namesSet this to non-zero to retrieve the names of remote devices. This takes extra time, so set it to zero for faster scanning.
Note:
On Windows, due to a bug in the Microsoft Bluetooth stack, newly discovered devices may appear without names. Re-scanning should make the devices' names appear properly. A workaround is planned for a future release of MoSync.
Returns:
0 on success, < 0 on failure.
See also:
maBtGetNewDevice
maBtCancelDiscovery
EVENT_TYPE_BT

References maIOCtl().

Fills an MABtDevice structure with information about a device. Removes the data from an internal queue filled by maBtStartDeviceDiscovery().

If the names parameter of maBtStartDeviceDiscovery() was zero, all members of d except address are ignored and unchanged.

The space needed to store the device name and its terminating zero may be greater than a nameBufSize. In that case, the copy is truncated. The maximum length of a device name according to the Bluetooth 2.0 specification is 248 bytes, excluding the terminating zero. However, it's recommended that you don't provide buffers larger than what your application has a use for.

Note that you need to fill the MABtDevice structure before passing it as a parameter, otherwise you will get memory access problems.

Returns:
1 if successful, zero if the queue is empty.

References maIOCtl().

int maBtStartServiceDiscovery ( const MABtAddr address,
const MAUUID uuid 
)

Starts a service discovery operation. Takes a device address and the UUID of the service class to search for. For example, pass RFCOMM_PROTOCOL_MAUUID and you'll get all connectable services. Pass SerialPort_Service_MAUUID and you'll get only that type of service.

See also:
maBtGetNextServiceSize
maBtGetNewService
maBtCancelDiscovery
EVENT_TYPE_BT
Returns:
0 on success, < 0 on failure.
Note:
Service discovery is not supported on Android. Use MAUtil::BluetoothConnection to connect via service UUID. That method is cross-platform.

References maIOCtl().

Fills an MABtServiceSize structure with meta-data about the next service. Does not remove the service from the queue.

Returns:
> 0 on success, or zero if the queue is empty.
See also:
maBtStartServiceDiscovery
maBtGetNewService

References maIOCtl().

Fills an MABtService structure with information about the next service. Removes the data from the internal queue filled by maBtStartServiceDiscovery().

Returns:
> 0 on success, or zero if the queue is empty.
See also:
maBtGetNextServiceSize

References maIOCtl().

int maBtCancelDiscovery ( void  )

Cancels any active discovery operation. If an operation was canceled, its last BT event will have the state CONNERR_CANCELED. This is an asynchronous operation. If this function returns 1, it is not safe to start another discovery before you've received the CONNERR_CANCELED event.

See also:
maBtStartDeviceDiscovery
maBtStartServiceDiscovery
EVENT_TYPE_BT
Returns:
0 if there was no active operation, 1 if there was.

References maIOCtl().

int maLocationStart ( void  )

Starts collecting location information. Does nothing if collection is already active. May cause a system popup asking for the user's permission.

LOCATION events will be generated as the estimated location is updated.

LOCATION_PROVIDER events will be generated when the location provider state changes.

Returns:
MA_LPS_AVAILABLE on success, 0 if collection was already active, or MA_LPS_OUT_OF_SERVICE if the location provider is out of service, or < 0 on error.
Note:
The location API is experimental, not fully tested. It may not work as advertised.

In particular, it is unsupported on the MoSync Emulator. Implementation details are likely to change in the future.

References maIOCtl().

int maLocationStop ( void  )

Stops collecting location information, and stops generating events. Does nothing if collection is not active.

Note:
Location events that are generated before this function returns may remain in the event queue afterwards.
Returns:
0.

References maIOCtl().

int maPlatformRequest ( const char *  url)

Requests that the operating system handle (for example, display or install) the indicated URL.

If the platform has the appropriate capabilities and resources available, it SHOULD bring the appropriate application to the foreground and let the user interact with the content, while keeping the MoSync application running in the background. If the platform does not have appropriate capabilities or resources available, it MAY wait to handle the request until after the MoSync application exits. In this case, when the requesting MoSync application exits, the platform MUST then bring the appropriate application (if one exists) to the foreground to let the user interact with the content.

The URL can be of the form http://<address>, in which case the usual response is to launch the built-in web browser.

The URL can also be of the form tel:<number>, in which case the request is interpreted as a request to initiate a voice call to the specified number.

If the URL refers to a packaged application (a .JAR file on Java platforms, .SIS on Symbian or .CAB on Windows Mobile), the request is interpreted as a request to install that application.

The application being requested can be an update of the calling application. In that case, the calling application must always exit before the request can be processed.

Parameters:
urlThe URL for the platform to load. An empty string or NULL cancels any pending requests.
Returns:
> 0 if maExit() must be called before the request can be processed. 0 if the request is being processed. < 0 if the request could not be processed. Specifically, the error code IOCTL_UNAVAILABLE means that the protocol of the request is not supported on the platform.

References maIOCtl().

MAHandle maFileOpen ( const char *  path,
int  mode 
)

Opens a file handle. If the file exists, the file will be accessible according to the mode specified. If the file does not exist, a handle will still be returned and maFileExists() will return false. The file may then be created by calling maFileCreate().

Directories may be opened with this function. They cannot be read or written, but they can be created and deleted, and their existence can be queried. Directory paths must end with a slash('/').

Attempting to open an existing directory without ending its path with a slash will fail. Likewise, attempting to open an existing file while ending its path with a slash will also fail. Either case will return MA_FERR_WRONG_TYPE.

Note:
To avoid memory leaks, all opened handles should be closed using maFileClose().
To find valid file paths, use maFileListStart().
Parameters:
pathThe absolute path to the file.
modeThe access mode. Either MA_ACCESS_READ or MA_ACCESS_READ_WRITE. Directories also use these access modes. MA_ACCESS_READ lets you see if the directory exists. MA_ACCESS_READ_WRITE also lets you create or delete it.
Returns:
The new file handle, or < 0 on error.
Note:
If any maFile function other than maFileOpen() fails, the state of the file handle becomes boundedly undefined. This means that any operation on it, other than maFileClose(), may fail.

References maIOCtl().

int maFileExists ( MAHandle  file)

Returns 1 if the file exists, 0 if it doesn't, or < 0 on error.

References maIOCtl().

int maFileClose ( MAHandle  file)

Closes a file handle. Returns 0. Panics on error.

References maIOCtl().

int maFileCreate ( MAHandle  file)

Creates a file or directory, given an file handle opened with MA_ACCESS_READ_WRITE. The file must not exist prior to calling this function. After creation, the file will be accessible for writing and reading. Returns 0 on success, or < 0 on error.

References maIOCtl().

int maFileDelete ( MAHandle  file)

Deletes a file or directory. The file must exist prior to calling this function. If it's a directory, it must be empty. Returns 0 on success, or < 0 on error.

References maIOCtl().

int maFileSize ( MAHandle  file)

Returns the size of the file, or < 0 on error.

Note:
MoSync cannot handle files larger than 2 GiB (2^31 - 1 bytes).
Parameters:
fileA file handle. The file must exist and must not be a directory.

References maIOCtl().

Returns the number of free bytes on the file system on which file resides. Note that due to file system overhead, it is not possible to use all of this space for file data. Returns < 0 on error.

References maIOCtl().

int maFileTotalSpace ( MAHandle  file)

Returns the total size, in bytes, of the file system on which file resides. Returns < 0 on error.

References maIOCtl().

int maFileDate ( MAHandle  file)

Returns the date/time when the file was last modified, or < 0 on error. The time format is Unix UTC.

See also:
maTime()

References maIOCtl().

int maFileRename ( MAHandle  file,
const char *  newName 
)

Renames a file.

If newName does not contain a slash, the file stays in its original directory.

If newName does contain a slash, it must be a complete pathname, and the file is moved to that path. The new path must be on the same file system as the original path. If it is not, this function fails with MA_FERR_RENAME_FILESYSTEM. Moving a file to another directory is not supported on Java ME. If it is attempted, this function fails with MA_FERR_RENAME_DIRECTORY.

Returns:
0 on success, or < 0 on error.

References maIOCtl().

int maFileTruncate ( MAHandle  file,
int  offset 
)

Truncates the file.

If offset is less than the file's current size, the file's new size is equal to the offset. All data after the offset is discarded.

If offset is equal to the file's current size, this function does nothing.

If offset is greater than the file's current size, this function MAY increase the size of the file. You can determine if it did so by calling maFileSeek() with MA_SEEK_END.

If the file's current position is greater than offset, it is reset to be equal to offset.

The file must exist prior to calling this function. Returns 0 on success, or < 0 on error.

References maIOCtl().

int maFileWrite ( MAHandle  file,
const void *  src,
int  len 
)

Writes from memory to file.

Parameters:
fileTarget file.
srcSource memory address.
lenLength, in bytes, of the data to be written.
Returns:
0 on success, or < 0 on error.

References maIOCtl().

int maFileWriteFromData ( MAHandle  file,
MAHandle  data,
int  offset,
int  len 
)

Writes from a data object to file.

Parameters:
fileTarget file.
dataSource data object.
offsetOffset from the start of the data object.
lenLength, in bytes, of the data to be written.
Returns:
0 on success, or < 0 on error.

References maIOCtl().

int maFileRead ( MAHandle  file,
void *  dst,
int  len 
)

Reads exactly len bytes from file to memory.

Parameters:
fileSource file.
srcTarget memory address.
lenLength, in bytes, of the data to be read.
Returns:
0 on success, or < 0 on error. If len bytes is not available, MA_FERR_GENERIC is returned.

References maIOCtl().

int maFileReadToData ( MAHandle  file,
MAHandle  data,
int  offset,
int  len 
)

Reads exactly len bytes from file to a data object.

Parameters:
fileSource file.
dataTarget data object.
offsetOffset from the start of the data object.
lenLength, in bytes, of the data to be read.
Returns:
0 on success, or < 0 on error. If len bytes is not available, MA_FERR_GENERIC is returned.

References maIOCtl().

int maFileTell ( MAHandle  file)

Returns the file's current position, or < 0 on error.

Parameters:
fileA file handle. The file must exist and must not be a directory.

References maIOCtl().

int maFileSeek ( MAHandle  file,
int  offset,
int  whence 
)

Sets the file's position.

Parameters:
fileA file handle. The file must exist and must not be a directory.
offsetThe offset of the new position, relative to the position specified by whence.
whenceOne of the MA_SEEK constants.
Returns:
The new position, or < 0 on error.

References maIOCtl().

MAHandle maFileListStart ( const char *  path,
const char *  filter,
int  sorting 
)

Creates a listing of names of files and directories, or file systems. Call maFileListNext() repeatedly to retrieve the names. Call maFileListClose() to free the resources used.

It is often useful to begin by listing the file systems.

Parameters:
pathThe full path to a directory, or the empty string, which specifies that the root file systems should be listed. Which root file systems are listed vary between platforms.
filterA string to match names with. May include an asterisk ('*') wildcard to represent 0 or more characters. Ignored if path is empty.
sortingOne of the MA_FL_SORT flags, OR'd with one of the MA_FL_ORDER flags. MA_FL_SORT_NONE must not be combined with an MA_FL_ORDER flag.
Note:
Sorting is not supported on JavaME. If it is attempted, this function will fail with MA_FERR_SORTING_UNSUPPORTED.
Returns:
A File Listing handle, or < 0 on error.

References maIOCtl().

int maFileListNext ( MAHandle  list,
char *  nameBuf,
int  bufSize 
)

Writes the name of the next file in the list to the specified buffer.

The buffer may be too small to contain the name and the terminating zero; in that case, the internal list pointer remains unchanged, the buffer will not be filled, and you should allocate a bigger buffer and call this function again. You may call this function with NULL and 0 to simply retrieve the length of the name.

If the name ends with a slash('/'), it is a directory.

Returns:
The length of the name, excluding the terminating zero, or 0 if there are no more files, or < 0 on error.

References maIOCtl().

int maFileListClose ( MAHandle  list)

Closes a file listing, freeing its resources.

Returns:
0.

References maIOCtl().

int maFileSetProperty ( const char *  path,
int  property,
int  value 
)

Sets the properties of a file

References maIOCtl().

int maSaveImageToDeviceGallery ( MAHandle  imageHandle,
const char *  imageName 
)

Saves an images in the photo gallery of the device.

Notifications of this operation are available via MAUtil::MediaExportListener.

Parameters:
imageHandlehandle of the image that needs to be exported to the device.
imageNamethe name that the image will have after is saved. Note: This argument is ignored on iOS.
Returns:
MA_MEDIA_RES_OK if the input was correct and the operation started or MA_MEDIA_RES_IMAGE_EXPORT_FAILED otherwise.

References maIOCtl().

int maSendTextSMS ( const char *  dst,
const char *  msg 
)

Sends a text SMS. Since this may cost money for the user, some platforms ask the user for permission, by displaying a modal Yes/No message box.

Parameters:
dstThe phone number to send the message to.
msgThe message to send. Only printable 7-bit ASCII characters are guaranteed to arrive unaltered. 8-bit Latin-1 characters should work in most cases.
Returns:
0 on success. A CONNERR code < 0 on error. CONNERR_FORBIDDEN if the user denied permission, and CONNERR_UNAVAILABLE if the device cannot send SMS messages.
Note:
Will create a text file on PC platforms, instead of sending anything.

References maIOCtl().

Get frame buffer info. Use info.sizeInBytes to allocate memory for framebuffer.

Parameters:
infoA pointer to an MAFrameBufferInfo structure, which the information will be written to.
Returns:
<=0 on error.

References maIOCtl().

int maFrameBufferInit ( const void *  data)

Pass a pointer to your framebuffer here. Each time an maUpdateScreen is performed, this piece of memory will be copied to the actual screen memory.

Parameters:
dataA pointer to the custom framebuffer.
Returns:
<=0 on error.

References maIOCtl().

int maFrameBufferClose ( void  )

Close the framebuffer. The graphics sub-system will be set to use the standard framebuffer.

Returns:
<=0 on error.

References maIOCtl().

int maAccept ( MAHandle  serv)

Asynchronously accepts and opens a remote connection to a service.

When a connection is accepted, a CONN event with CONNOP_ACCEPT will be generated. If the accept was successful, MAConnEventData::result will be a handle to the new, normal connection. MAConnEventData::handle will be the server connection specified in the call to this function.

To accept another connection after such an event, call this function again.

Parameters:
servA server connection, opened with maConnect.
Returns:
< 0 on error, > 0 on success.
See also:
maConnect
maGetEvent

References maIOCtl().

int maSendToBackground ( void  )

Sends the application to the background, unless it's already there. Generates a FOCUS_LOST event.

Note:
Only available on multi-tasking operating systems.

References maIOCtl().

int maBringToForeground ( void  )

Brings the application to the foreground, unless it's already there. Generates a FOCUS_GAINED event.

Note:
Only available on multi-tasking operating systems.

References maIOCtl().

int maGetSystemProperty ( const char *  key,
char *  buf,
int  size 
)

Retrieves the value of a Java System Property, or a MoSync System Property.

There are a few MoSync System Properties. They are unavailable on some devices. "mosync.imei" and "mosync.imsi" is the device's IMEI and IMSI number, respectively. The format of these numbers is not specified. It varies from device to device.

"mosync.iso-639-1" and "mosync.iso-639-2" is the current language used by the system's UI. Multi-language applications should use this to determine which language to use.

"mosync.winmobile.locale.SABBREVLANGNAME" is a windows mobile specific property. See http://msdn.microsoft.com/en-us/library/dd373831%28VS.85%29.aspx.

See http://www.loc.gov/standards/iso639-2/php/code_list.php - The official list of valid ISO-639 codes (online).

"mosync.device" is a description of the device. May include vendor, model name and firmware version. The format of this description is not specified. It varies from device to device.

"mosync.device.name" is the name of the device. Usually set by the user.

"mosync.device.UUID" is the Unique identifier of the device. Not available on iOS platform.

"mosync.device.OS" is the operating system or platform that the device is using. It might contain version detail as well.

"mosync.device.OS.version" is the the version of the operating system that is running on the device. It might contain minor revision information, e.g. 2.1Update-1.

"mosync.network.type" it the type of the current active network connection. It can one of the following four values: "none", "wifi", "mobile", or "unknown".

"mosync.path.local" is the absolute path to the local file system, on devices that have a local file system. The returned path has a trailing slash character ('/').

Parameters:
keyThe property's key.
bufA buffer where the value should be written.
sizeThe size of the buffer, in bytes.
Returns:
The length of the value, including the terminating zero. If this is greater than size, the value will not have been copied to be buffer. In that case, you can make a bigger buffer and try again. If the property did not exist (System.getProperty() returned null), -2 will be returned.

References maIOCtl().

int maIapSave ( void  )

Normally, when the first Internet connection is made in a Symbian application, the user must choose an Internet Access Point.

This function saves the ID of the active IAP for this application. It will be used automatically the next time the application is started.

Returns:
1 if the ID was successfully saved. 0 if there is no active IAP. < 0 on error.
Note:
Implemented only on Symbian.

References maIOCtl().

int maIapReset ( void  )

Removes any saved IAP ID for this application. The next time the application is started, or the next time an Internet connection is made after a call to maIapShutdown(), the user will have to select a new IAP.

Returns:
1 if the ID was successfully removed. 0 if there was no saved ID. < 0 on error.
Note:
Implemented only on Symbian.
See also:
maIapSave()

References maIOCtl().

int maIapShutdown ( void  )

Shuts down the active IAP. This has the effect of calling maConnClose() on all existing connections.

Returns:
1 if the IAP was successfully shut down. 0 if there was no active IAP. < 0 on error.
Note:
Implemented only on Symbian.
See also:
maIapSave()

References maIOCtl().

int maNetworkStatus ( void  )

Returns the current telephone network status. This is one of the MA_NETWORK constants. MA_NETWORK_HOME and MA_NETWORK_ROAMING are the most interesting ones; all the others are variants of "not connected". Returns < 0 on error.

See also:
EVENT_TYPE_NETWORK
Note:
Implemented only on Symbian, 3rd edition and later.

References maIOCtl().

int maIapSetMethod ( int  type)

Decides how IAP connection attempts should work.

IAP connection attempts are made asynchronously by maConnect(), if there is no active IAP.

This setting is reset to default when the application starts.

Parameters:
typeOne of the MA_IAP_METHOD constants.
Returns:
< 0 on error.
Note:
Implemented only on Symbian, 3rd edition and later.

References maIOCtl().

int maIapSetFilter ( int  filter)

Decides which IAPs are visible in the IAP selection dialog. This setting is reset to default when the application starts.

Parameters:
filterOne of the MA_IAP_FILTER constants.
Returns:
< 0 on error.
Note:
Implemented only on Symbian, 3rd edition and later.

References maIOCtl().

int maShowVirtualKeyboard ( void  )

Shows the virtual keyboard.

References maIOCtl().

int maTextBox ( const wchar *  title,
const wchar *  inText,
wchar *  outText,
int  maxSize,
int  constraints 
)

Displays a NativeUI text box, with "OK" and "Cancel" buttons (or equivalent command items if the OS uses other input methods). The user can enter text using the native input system.

This function returns immediately, leaving the text box on-screen. While the text box is active, it will consume all key events. Other events, like networking, will still be handled normally.

When the user activates one of the command items ("OK" or "Cancel"), a number of things will happen in order:

The box's text will be copied to the buffer specified by outText. The text box will disappear. An event (EVENT_TYPE_TEXTBOX) will be posted.

The text box will allow input of up to (maxSize - 1) characters, but no more. Additional keypresses at that point may be ignored, or may cause an error message, at the discretion of the underlying implementation.

Returns:
>= 0 on success, < 0 on error.
Parameters:
titleThe box's title.
inTextWhen the text box is created, it is populated with this string.
outTextPointer to a buffer. When the text box closes, the contents are copied to this buffer.
maxSizeThe size of the buffer, in characters. Includes the terminating zero.
constraintsRules for how text is entered into the box. Must be exactly one of the MA_TB_TYPE constants, or'd with zero or more of the MA_TB_FLAG constants.
Note:
Some combinations of constraint types and flags are useless or invalid.

References maIOCtl().

int maKeyCaptureStart ( int  keyCode)

Make MoSync send key-events for the specified key, even when the application does not have focus. Can only capture one key at a time.

Parameters:
keyCodeThe MAK code for the key to capture.
Returns:
< 0 on error.
See also:
maKeyCaptureStop()

References maIOCtl().

int maKeyCaptureStop ( void  )

Stops any key capture in progress.

Returns:
< 0 on error.
See also:
maKeyCaptureStart()

References maIOCtl().

int maHomeScreenEventsOn ( void  )

Turn on sending of HomeScreen events. Off by default.

Returns:
< 0 on error.
See also:
EVENT_TYPE_HOMESCREEN_SHOWN
EVENT_TYPE_HOMESCREEN_HIDDEN
maHomeScreenEventsOff()

References maIOCtl().

int maHomeScreenEventsOff ( void  )

Turn off sending of HomeScreen events. Off by default.

Returns:
< 0 on error.

References maIOCtl().

int maHomeScreenShortcutAdd ( const char *  name)

Add shortcut icon to the device home screen. Available on Android only.

Parameters:
nameThe name (label) of the shortcut to add.
Returns:
< 0 on error.

References maIOCtl().

int maHomeScreenShortcutRemove ( const char *  name)

Remove shortcut icon from the device home screen. Available on Android only.

Parameters:
nameThe name (label) of the shortcut to remove.
Returns:
< 0 on error.

References maIOCtl().

int maNotificationAdd ( int  type,
int  id,
const char *  title,
const char *  text 
)

Add a notification item.

Deprecated:
use maNotificationLocalCreate instead. Note that there can only be one notification of type NOTIFICATION_TYPE_APPLICATION_LAUNCHER. Additional notification types may be added in the future. This syscall is available on Android only.
Parameters:
typeThe NOTIFICATION_TYPE_APPLICATION_LAUNCHER constant.
idThe id of the notification. The id must be unique within the application.
titleTitle of the notification.
textString to be displayed as part of the notification.
Returns:
< 0 on error or if the syscall is not available on the current platform.

References maIOCtl().

int maNotificationRemove ( int  id)

Remove a notification item.

Deprecated:
use maNotificationDestroy instead. Currently implemented only on Android.
Parameters:
idThe id of the notification.
Returns:
< 0 on error.

References maIOCtl().

int maScreenSetFullscreen ( int  fullscreen)

Enable/disable fullscreen mode. Currently implemented only on Android.

Parameters:
fullscreen1 for fullscreen on, 0 for fullscreen off.
Returns:
< 0 on error.

References maIOCtl().

int maAutostartOn ( void  )

Registers this application for autostart on device reboot. Applications started this way start in the background; invisible to the user, unless they check the list of running applications.

Returns:
1 on success, 0 if already registered, < 0 on error.

References maIOCtl().

int maAutostartOff ( void  )

Removes autostart registration for this application.

Returns:
1 on success, 0 if already unregistered, < 0 on error.

References maIOCtl().

int maScreenStateEventsOn ( void  )

Turn on sending of screen state events. Off by default. Currently implemented only on Android.

Returns:
< 0 on error.
See also:
EVENT_TYPE_SCREEN_STATE_ON
EVENT_TYPE_SCREEN_STATE_OFF
maHomeScreenEventsOff()

References maIOCtl().

int maScreenStateEventsOff ( void  )

Turn off sending of screen state events. Off by default. Currently implemented only on Android.

Returns:
< 0 on error.

References maIOCtl().

int maWakeLock ( int  flag)

Lock device to be "awake". This means that the device won't go to sleep while the app is running.

Parameters:
flagMA_WAKE_LOCK_ON or MA_WAKE_LOCK_OFF
Returns:
>0 on success, < 0 on error (-1 if not available).

References maIOCtl().

void maReportResourceInformation ( void  )

Logs information about the state of all current resources.

References maIOCtl().

void maMessageBox ( const char *  title,
const char *  message 
)
Deprecated:
use maAlert instead. Displays a message to the user.
Parameters:
titleThe title of the message box shown
messageThe message should be short, not more than 40 characters, to ensure its visibility on all screen sizes.

References maIOCtl().

void maAlert ( const char *  title,
const char *  message,
const char *  button1,
const char *  button2,
const char *  button3 
)

Displays a message to the user. It contains optional title, message and 3 buttons for selection. On Android the buttons point to a positive, negative or neutral action. When one of the buttons are clicked the alert is automatically dismissed. When a selection is made a EVENT_TYPE_ALERT event is sent with the button index.

Parameters:
titleThe title of the message box shown.
messageThe message should be short, not more than 40 characters, to ensure its visibility on all screen sizes.
button1The text on the first button. On Android it indicates a positive selection.
button2The text on the second button. On Android it indicates a neutral selection.
button3The text on the third button. On Android it indicates that a negative selection.

References maIOCtl().

int maToast ( const char *  message,
int  duration 
)

A toast is a view containing a quick little message for the user. A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive. For example, navigating away from an email before you send it triggers a "Draft saved" toast to let you know that you can continue editing later. Toasts automatically disappear after a timeout, and do not handle any user interaction. Toast are available only on Android.

Parameters:
messageThe message in the toast.
durationOne of the next constants:

References maIOCtl().

void maImagePickerOpen ( void  )

Displays an image picker to the user. It's display depends on the platform. Note: when a selection is made a EVENT_TYPE_IMAGE_PICKER event is sent.

References maIOCtl().

void maImagePickerOpenWithEventReturnType ( int  eventReturnType)

Displays an image picker to the user and sets the event return type. It's display depends on the platform. Note: when a selection is made a EVENT_TYPE_IMAGE_PICKER event is sent.

Parameters:
eventTypeOne of the next constants:

References maIOCtl().

void maOptionsBox ( const wchar *  title,
const wchar *  destructiveButtonTitle,
const wchar *  cancelButtonTitle,
const void *  otherButtonTitles,
int  otherButtonTitlesSize 
)

Displays a special kind of dialog that has a list of possible choices. The list of options is displayed as buttons on iOS, and as text views on Android. By clicking any option the dialog gets dismissed and a EVENT_TYPE_OPTIONS_BOX_BUTTON_CLICKED event is sent back.

Parameters:
titleThe dialog title.
destructiveButtonTitleThe destructive button text. This is an iOS specific feature: it has different color than the other options, and it indicates that it's action has destructive behaviour. On Android it is treated and it looks like a normal option.
cancelButtonTitleThe dialog's Cancel button text. If left empty, the dialog is not cancelable.
otherButtonTitlesThe address to the buffer that stores the list of options.
otherButtonTitlesSizeThe size of the buffer, in bytes.

References maIOCtl().

int maSyscallPanicsEnable ( void  )

Enable panics for programmer errors. Such panics are enabled by default, but can be disabled by maSyscallPanicsDisable(). If a panic is raised a message will be displayed to the user and the program will be shut down.

Returns:
RES_OK.

References maIOCtl().

int maSyscallPanicsDisable ( void  )

Disable panics for programmer errors. Some errors, such as feeding invalid parameters to certain syscalls, can be prevented by the programmer. By default, these errors cause a MoSync Panic. After this function is called, if such an error occurs in a syscall, an error code will be returned by the syscall and the program will continue running. Panics can be re-enabled by maSyscallPanicsEnable().

Returns:
RES_OK.

References maIOCtl().


Variable Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines