Skip to content

Repository files navigation

divviup-android

An Android client library for the Distributed Aggregation Protocol.

Protocol Versions and Release Branches

The following versions of the DAP protocol are supported by different branches and releases.

Package versionGit branchProtocol versionConformant?Status
0.1.0release/0.1draft-ietf-ppm-dap-07YesUnmaintained as of June 24, 2024
0.2.0maindraft-ietf-ppm-dap-09YesSupported

Usage

Ensure that Maven Central is in the list of repositories from which dependencies are resolved. Add the library to your project as follows.

// build.gradle
dependencies {
implementation 'org.divviup.android:divviup-android:0.1.0'
}
// build.gradle.kts
dependencies {
implementation("org.divviup.android:divviup-android:0.1.0")
}

Construct a Client from your DAP task's parameters, and use it to send report as follows. (Note that this should be done off the main thread)

importandroid.util.Log;
importorg.divviup.android.Client;
importorg.divviup.android.TaskId;
importjava.net.URI;
publicclassMyRunnableimplementsRunnable {
publicvoidrun() {
try {
URIleaderEndpoint = newURI("https://<your leader here>/");
URIhelperEndpoint = newURI("https://<your helper here>/");
TaskIdtaskId = TaskId.parse("<your DAP TaskId here>");
longtimePrecisionSeconds = <yourtimeprecisionhere>;
Client<Boolean> client = Client.createPrio3Count(context, leaderEndpoint, helperEndpoint, taskId, timePrecisionSeconds);
client.sendMeasurement(<yourmeasurementhere>);
} catch (Exceptione) {
Log.e("MyRunnable", "upload failed", e);
}
}
}

About

Android client for the Distributed Aggregation Protocol

Resources

Contributing

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages