Docs Menu
Docs Home
/ /
Atlas Device SDKs
/

Install the C++ SDK

On this page

  • Requirements
  • Install
  • Usage
  • Build an Android App

Atlas Device SDK for C++ enables client applications written in C++ to access data stored on devices and sync data with Atlas. This page details how to install the C++ SDK in your project and get started.

  • Minimum C++ standard: C++17.

  • For development on macOS: Xcode 11.x or later.

  • For development on Windows: Microsoft Visual C++ (MSVC).

  • Otherwise, we recommend git and CMake.

Tip

Atlas Device SDK and Realm

The SDK uses Realm Core database for device data persistence. When you install the C++ SDK, the package names reflect Realm naming.

Make the C++ SDK available in your code by including the cpprealm/sdk.hpp header in the translation unit where you want to use it:

#include <cpprealm/sdk.hpp>

The C++ SDK supports building Android apps. To build an Android app:

  • Add <uses-permission android:name="android.permission.INTERNET" /> to your AndroidManifest.xml

  • Add the subdirectory of the C++ SDK to your native library's CMakeLists.txt and link it as a target library:

    set(CMAKE_CXX_STANDARD 17)
    add_subdirectory("realm-cpp")
    ...
    target_link_libraries(
    # Specifies the target library.
    myapplication
    # make sure to link the C++ SDK.
    cpprealm
    )
  • Ensure that the git submodules are initialized inside of the realm-cpp folder before building.

  • When instantiating the database or the SDK App, you must pass the filesDir.path as the path parameter in the respective constructor or database open template.

For an example of how to use the C++ SDK in an Android app, refer to the Android RealmExample App in the realm-cpp GitHub repository.

Specifically, refer to the MainActivity.kt & native-lib.cpp files in the Android example app for code examples.

← 
 →