MoSync 3.3
MoSync C/C++ API Reference
The essential guide to MoSync C++ libraries and C functions.


(We also publish many useful user guides and tutorials at our website.)


HTML5 Support Library

Classes Libraries

See also

Wormhole Communication between JavaScript and C++ Wormhole::Encoder, Wormhole::FileUtil, Wormhole::HighLevelBinaryDownloader, Wormhole::HighLevelHttpConnection, Wormhole::HighLevelImageDownloader, Wormhole::HighLevelTextDownloader, Wormhole::MessageProtocol, Wormhole::MessageStream, Wormhole::MessageStreamJSON, Wormhole::WebAppMoblet Wormhole Library

User guides and online resources
JavaScript API Reference

MoSync Core Functions

Syscalls and IOCTLs (maapi.h) Libraries

See also

System functions Exit application, report non-recoverable error. maExit(), maPanic()  

 

Event handling User input, communications, asynchronous events. maWait(), maGetEvent() MAUtil::Environment, MAUtil::Moblet, MAUtil/CharInput.h

 

Resource management Create, read, write binary objects, destroy objects, create resource handles. maCreateData(), maCreatePlaceholder(), maDestroyObject(), maGetDataSize(), maReadData(),
maWriteData(), maDestroyPlaceholder()
MAUtil::DataHandler

 

Dynamic loading Load code and data from binary object.
maLoadResources(), maLoadProgram()

Resource management

MoSync Device Feature APIs

Syscalls and IOCTLs (maapi.h) Libraries

See also

Graphics Draw pixels, lines, rectangles, triangles and images to either the screen or to a drawable image. Create new images, either empty or from compressed or uncompressed data. Use a clipping rectange to control drawing.
maSetColor(), maPlot(), maLine(), maFillRect(), maFillTriangleStrip(), maFillTriangleFan(), maDrawImage(), maDrawText(), maDrawTextW(), maGetTextSize(), maGetTextSizeW(), maUpdateScreen(), maResetBacklight(), maGetScrSize(), maDrawRGB(), maDrawImageRegion(), maGetImageSize(), maGetImageData(), maSetDrawTarget(), maSetClipRect(), maGetClipRect(), maCreateImageFromData(), maCreateImageRaw(), maCreateDrawableImage()
MAUtil/Graphics.h

Resource management

Framebuffer Access the device's graphical framebuffer (more or less) directly, allowing more advanced graphics operations.
maFrameBufferGetInfo(), maFrameBufferInit(), maFrameBufferClose()
MAUtil/FrameBuffer.h


Sound Play a sound, control volume.
maSoundPlay(), maSoundStop(), maSoundIsPlaying(), maSoundGetVolume(), maSoundSetVolume()

Resource management

Time and date Check current time and date, convert to C string.
maGetMilliSecondCount(), maTime(), maLocalTime()
matime.h


Communications Communicate via TCP, HTTP, SSL, HTTPS and Bluetooth serial port.
maConnect(), maConnClose(), maConnRead(), maConnWrite(), maConnReadToData(), maConnWriteFromData(), maHttpCreate(), maHttpSetRequestHeader(), maHttpGetResponseHeader(), maHttpFinish()
MAUtil/Connection.h, MAUtil/BluetoothConnection.h, MAUtil/Downloader.h, MAUtil/BuffDownloader.h

Event handling, Resource management

Servers Advertise services, listen for incoming connections.
maConnect(), maConnClose(), maAccept()
MAUtil/Server.h

Communications

Bluetooth discovery Search for nearby Bluetooth devices and query their capabilities.
maBtStartDeviceDiscovery(), maBtGetNewDevice(), maBtStartServiceDiscovery(), maBtGetNextServiceSize(), maBtGetNewService(), maBtCancelDiscovery()
MAUtil/BluetoothDiscovery.h, MAUtil/mauuid.h

Event handling

Location
Read your current geographical location.
maLocationStart(), maLocationStop()

Event handling

Permanent storage Store settings, values, downloaded data and programs.
maOpenStore(), maWriteStore(), maReadStore(), maCloseStore()

Resource management

Filesystem
Access the device's filesystem; list, create and delete files and directories; open, close, read and write files.
maFileListStart(), maFileListNext(), maFileListClose(), maFileOpen(), maFileExists(), maFileClose(), maFileCreate(), maFileDelete(), maFileSize(), maFileAvailableSpace(), maFileTotalSpace(), maFileDate(), maFileRename(), maFileTruncate(), maFileWrite(), maFileWriteFromData(), maFileRead(), maFileReadToData(), maFileTell(), maFileSeek()

Resource management

Database API Functions for accessing SQLite databases.
maDBOpen(), maDBClose(), maDBExecSQL(), maDBExecSQLParams(), maDBCursorDestroy(), maDBCursorNext(), maDBCursorGetColumnData(), maDBCursorGetColumnText(), maDBCursorGetColumnInt(), maDBCursorGetColumnDouble()

Resource management

Camera
Access the available functionality on device's camera to capture still images.
maCameraSelect(), maCameraNumber(), maCameraSetProperty(), maCameraGetProperty(), maCameraSetPreview(), maCameraFormatNumber(), maCameraFormat(), maCameraStart(), maCameraStop(), maCameraSnapshot()


Capture Access the default camera on the device to capture images and record video.
maCaptureSetProperty(), maCaptureGetProperty(), maCaptureAction(), maCaptureWriteImage(), maCaptureGetImagePath(), maCaptureGetVideoPath(), maCaptureDestroyData()

Capture API

Advertising Create and add advertising banners to applications.
maAdsBannerCreate(), maAdsBannerDestroy(), maAdsAddBannerToLayout(), maAdsRemoveBannerFromLayout(), maAdsBannerSetProperty(), maAdsBannerGetProperty()
Ads

Advertising API

Local and Push Notifications Handle both push notifications and local notifications.
maNotificationLocalCreate(), maNotificationLocalDestroy(), maNotificationLocalSetProperty(), maNotificationLocalGetProperty(), maNotificationLocalSchedule(), maNotificationLocalUnschedule(), maNotificationPushRegister(), maNotificationPushUnregister(), maNotificationPushGetRegistration(), maNotificationPushGetData(), maNotificationPushDestroy(), maNotificationSetIconBadge(), maNotificationGetIconBadge(), maNotificationPushSetTickerText(), maNotificationPushSetMessageTitle(), maNotificationPushSetDisplayFlag()
Notification

Notification API

In-App Purchases Purchase products from within your application.
maPurchaseSupported(), maPurchaseCreate(), maPurchaseSetPublicKey(), maPurchaseRequest(), maPurchaseVerifyReceipt(), maPurchaseGetField(), maPurchaseSetStoreURL(), maPurchaseGetName(), maPurchaseRestoreTransactions(), maPurchaseDestroy()
IAP

Purchase API

Device fonts Set device fonts for maDrawText(), maDrawTextW(), and for NativeUI widgets.
maFontLoadDefault(), maFontSetCurrent(), maFontGetCount(), maFontGetName(), maFontLoadWithName(), maFontDelete()


Miscellaneous functions Detect key state, control vibration, measure battery, platform request, send SMS, switch focus, get system property, lock/unlock keypad.
maGetKeys(), maVibrate(), maGetBatteryCharge(), maPlatformRequest(), maSendTextSMS(), maSendToBackground(), maBringToForeground(), maGetSystemProperty(), maLockKeypad(), maUnlockKeypad(), maKeypadIsLocked()
maassert.h


Sensor Read device sensors data.
maSensorStart(), maSensorStop()

Sensor API

MoSync User Interface APIs

Syscalls and IOCTLs (maapi.h)
Libraries
See also
Native user interface Access to device specific UI system. Currently only available for Android, iOS and Windows Phone 7.
maWidgetCreate(), maWidgetDestroy(), maWidgetAddChild(), maWidgetInsertChild(), maWidgetRemoveChild(), maWidgetScreenShow(), maWidgetStackScreenPush(), maWidgetStackScreenPop(), maWidgetSetProperty(), maWidgetGetProperty(), maWidgetModalDialogShow(), maWidgetModalDialogHide(), maWidgetScreenAddOptionsMenuItem()
IX_WIDGET.h
NativeUI

Widget API
Native UI Library

Text input Native-UI text box. Available on all platforms. maTextBox() MAUI::NativeEditBox in MAUI-revamp

Platform independent user interface Image, animated image, edit box, list box, screens, widgets, widget skins, input managers, etc.
maTextBox(), maAlert()
MAUI::EditBox, MAUI::Engine, MAUI::Font, MAUI::Image, MAUI::Label, MAUI::Layout, MAUI::ListBox, MAUI::Screen, MAUI::Widget
MAUI

Standard C Functions

Syscalls and IOCTLs (maapi.h)
Libraries
See also
Math Trigonometric functions, common constants, etc.
sin(), cos(), tan(), sqrt()
limits.h, madmath.h

Memory
Allocate and free memory. Copy and set data.
memset(), memcpy()
maheap.h

C string handling
Compare, copy, format and convert null-terminated 8-bit strings.
strcmp(), strcpy()
mactype.h, mastring.h, maxtoa.h, mavsprintf.h

Wide-char string handling
Compare, copy, format and convert null-terminated 16-bit strings.

wchar.h, mawstring.h, mawvsprintf.h

Miscellaneous Variadric function helpers and random number generation.

maarg.h, mastdlib.h

Console output
Print text to the screen, with colour and logging options.

conprint.h

Virtual file system A subset of the buffered file I/O library.

MAFS/File.h

Miscellaneous libraries

Syscalls and IOCTLs (maapi.h)
Libraries
See also
C++ utilities Containers, geomeric helper structures, utilities.

MAUtil::Vector, MAUtil::String, MAUtil::HashMap, MAUtil::Map, MAUtil::Set, MAUtil::List,
MAUtil/Geometry.h, MAUtil/util.h
SGI Standard Template Library (STL) documentation
XML processing Tiny XML parser.

MTXml/MTXml.h

Slippy maps
Download, cache and display maps from multiple sources in different resolutions.

MAP

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines