code tutorials

Developing Apps in HTML5/JavaScript

With the MoSync Mobile SDK you can build pure applications in HTML5 and JavaScript without needing to write a single line of C/C++ code! This tutorial shows you how to create a project where you can author mobile applications using just HTML5 and JavaScript.

Extending HTML5 Apps with C++

Kindly note that this document applies to the upcoming MoSync 3.0 release.This document outlines how to use the Wormhole communication bridge between JavaScript and C++, which is useful when you want to extend your HTML5/JS application with custom code written in C++. If you are not familiar with how to create an HTML5 project, please read the tutorial Creating an HTML5 project in MoSync.

Using the Facebook Library

The MoSync Facebook Library implements most of the Facebook Graph API. Here we describe how to connect to Facebook through the MoSync Facebook library, retrieve information about them, post links, vidoes and other object types, create new albums, and a whole host of other cool operations.

Using the MAP Library

The Mosync MAP library is a standard library that provides a MapWidget for displaying geographical maps, sometimes called slippy or panning maps, consisting of tiles provided by a map source. This guide introduces the basics of the MAP library and shows you how to create map applications from scratch.

Using MAUtil Set, Map, HashMap

The MAUtil classes Set, Map and HashMap provide generic containers similar to std::set, map and unordered_map in the STL or Java's Set, Map and Hashtable. They provide many of the same familiar operations. Here we describe examples for Set, Map, and HashMap:

MoSync for Java and C# Developers

Mobile offers developers a new world, with cool devices and nice, easy, small projects compared to that monstrous and boring enterprise code you've been doing in Java or C#, right? Right! However, there are somethings I'm going to tell you to help you move your Java/C# skill to C++ in MoSync. The reality is that both Java and C# are based on syntax from C, so you are going to be able to read C++ source code without anyone having to explain how curly braces work or reminding you to put a semi-colon at the end of the line, which is cool.

Detecting Events

Throughout the execution of your program, the MoSync SDK can supply it with events.  These are typically things which is happening to the phone.  For instance, a button has been pressed or the screen has been touched.  They also cover more advanced functions such as 'nothing has happened for a few seconds' or 'the phone has a new location from the GPS'.

MAUtil FrameBuffer

MAUtil::FrameBuffer emulates a 4 or 8 bits per pixel, pallettized display using the FrameBuffer API of MoSync. To initialize the library you provide the FrameBuffer_init with information about the size, colour format and orientation of the screen.

MAFS Library

MAFS is a reimplementation of the Standard C File I/O routines. It operates on either a binary image attached as a resource or using local stores for permanent storage. The binary image is actually a virtual filesystem generated using our tool Bundle. This comes in handy when porting applications that use a lot of data stored as files in the file system: just use the Bundle tool on the data folder to generate an image, attach it as a resource in the MoSync application, and mount it using the API functions provided.

MAUtil Graphics

The graphics API provides a set of functions equivalent to those found in the standard MoSync API, with the addition of a transformation stack. This provides a useful mechanism for keeping transformation state without explicitly managing it on the application side. It is useful for any sort of hierarchical rendering, ranging from UI to advanced graphical effects.


Share on Facebook