You can integrate the Ditto SDK into C++ projects to develop for Linux and Android platforms.
Ditto.tar.gz
and unpack an archive containing the libditto.a
static library and Ditto
header:
-lditto
as a compilation step in the main.cpp
source file:
mavenCentral()
repository is included in the repositories
section:android
packagingOptions
block:
Ditto::set_android_context(JNIEnv* env, jobject context)
with an application context object after creating an instance of the C++ Ditto
class. This context is required by the SDK on Android to access system resources such as network interfaces and files.
android:maxSdkVersion
attribute which means they are not used on devices running newer versions of Android. This is a best practice to respect users’ privacy when those permissions are not necessary.
However, some apps may still need to use one or more of the above permissions across more versions of Android. This can be accomplished by overriding the permission configuration in your app’s AndroidManifest.xml
.
To override any of these permission limitations in your app, do the following:
manifest
tag, just before the application
tag, add the relevant permissions you want to configure (location example):tools:remove
attribute. This tells the manifest merger to selectively remove the android:maxSdkVersion
behavior from the associated permissions, changing them to apply to all Android versions.Ditto::missing_permissions()
function to get a list of permissions required by Ditto that are missing, and your app can request them.
AndroidManifest.xml
:
small_app_icon
drawable must be monochrome white.
The foreground service will be automatically started and stopped on startSync()
and stopSync()
, respectively.
#include <Ditto.h>
, use the ditto
namespace, and provide your access credentials: