API areas

You can do many things with MoSync, and some things can be done in several different ways. This document will give you an overview of all these things.


MoSync-specific functions

System functions

Syscalls: maExit(), maPanic().

Event handling

Recieve information about user input, communications and other asynchronous events.
Syscalls: maWait(), maGetEvent().
Libs: MAUtil::Environment, MAUtil::Moblet, MAUtil/CharInput.h

Resource management

Create, read and write large binary objects, destroy any object, create new resource handles.
Syscalls: maCreateData(), maCreatePlaceholder(), maDestroyObject(), maGetDataSize(), maReadData(), maWriteData().
Libs: MAUtil::DataHandler

Dynamic loading

Load code and data from a binary object, which can be filled with anything from anywhere.
Syscalls: maLoadResources(), maLoadProgram().
Uses Resource management.


Common functions with a MoSync-specific interface

Permanent storage

Useful for storing settings, high-scores, downloaded data and programs.
Syscalls: maOpenStore(), maWriteStore(), maReadStore(), maCloseStore().
Uses Resource management.

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.
Syscalls: maSetColor(), maPlot(), maLine(), maFillRect(), maFillTriangleStrip(), maDrawImage(), maDrawText(), maGetTextSize(), maUpdateScreen(), maResetBacklight(), maGetScrSize(), maDrawRGB(), maDrawImageRegion(), maGetImageSize(), maGetImageData(), maSetDrawTarget(), maSetClipRect(), maGetClipRect(), maCreateImageFromData(), maCreateImageRaw(), maCreateDrawableImage().
Libs: MAUtil/Graphics.h
See also: Resource management.

Tilemaps

Set up and draw layers of tiled graphics.
Syscalls: maInitLayer(), maDisposeLayer(), maChangeTileSet(), maDrawLayer(), maSetTile().

Sound

Play a sound, with volume control.
Syscalls: maSoundPlay(), maSoundStop(), maSoundIsPlaying(), maSoundGetVolume(), maSoundSetVolume().
See also: Resource management.

Time and date

Check the current time and date, convert to C string.
Syscalls: maGetMilliSecondCount(), maTime(), maLocalTime().
Libs: matime.h

Communications

Speak to other machines using TCP, HTTP or a Bluetooth serial port.
Syscalls: maConnect(), maConnClose(), maConnRead(), maConnWrite(), maConnReadToData(), maConnWriteFromData(), maHttpCreate(), maHttpSetRequestHeader(), maHttpGetResponseHeader(), maHttpFinish().
Libs: MAUtil/Connection.h, MAUtil/Downloader.h
Uses Event handling.
See also: Resource management.

Bluetooth discovery

Search for Bluetooth devices in the vicinity and ask them what services they provide.
Syscalls: maBtStartDeviceDiscovery(), maBtGetNewDevice(), maBtStartServiceDiscovery(), maBtGetNextServiceSize(), maBtGetNewService().
Uses Event handling.
Libs: MAUtil/BluetoothDiscovery.h, MAUtil/mauuid.h

Miscellaneous functions

Syscalls: maGetKeys(), maVibrate(), maGetBatteryCharge(), maPlatformRequest(), maSendTextSMS().
Libs: maassert.h



Standard C functions

Math

Trigonometric functions, common constants, and others.
Syscalls: sin(), cos(), tan(), sqrt().
Libs: limits.h, madmath.h.

Memory management

Allocate and free memory. Copy and set data.
Syscalls: memset(), memcpy().
Libs: maheap.h

C string handling

Compare, copy, format and convert null-terminated 8-bit strings.
Syscalls: strcmp(), strcpy().
Libs: mactype.h, mastring.h, maxtoa.h, mavsprintf.h

Miscellaneous

Among them are variadric function helpers and random number generation.
Libs: maarg.h, mastdlib.h

Simple output console

A way to print text to the screen. Options include color and logging.
Libs: conprint.h

Virtual file system

A subset of the buffered file I/O library.
Libs: MAFS/File.h



Miscellaneous libraries

C++ utilities

Libs: MAUtil::Vector, MAUtil::String, MAUtil::Map, MAUtil::Set, MAUtil/Geometry.h, MAUtil/util.h

XML processing

Libs: MTXml/MTXml.h



Graphical user interface

See also:
MAUI.

Generated on Sat Feb 13 00:15:38 2010 for MoSync 2 beta 1 by  doxygen 1.4.6-NO