C/C++ Examples



This example application demonstrates how to use the MoSync Database API. The example works on all platforms supported by the API: Android, iOS, and the MoSync MoRE emulator.

DatabaseTest Screenshot (MoSync Emulator)


  • The program has one screen that displays textual output.
  • Tests start to run automatically when the app has been launched.
  • A database file will be created on the device, on the local file system of the application.
  • The status of the tests is displayed on the screen.
  • Quit the program by pressing back (on Android) or key zero (in the MoSync Emulator).

In the code

The project consists of one source file, main.cpp, which contains commented code to help understand the Database API. The example database used has a table called "pet" which contains data about pets. The database is created by the program. The tests made include making queries and checking that the results match the expected values.

MoSync SDK 3.3
Copyright © 2013 MoSync AB