Update Quickstart for Android Java to v5#268
Merged
Aaron LaBeau (biozal) merged 4 commits intomainfrom May 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the Android Java quickstart from Ditto SDK v4 to Ditto SDK v5 by switching the dependency coordinates/version and updating the app’s initialization, auth, DQL execution, and query-result parsing to the new com.ditto.kotlin.* APIs (with a Kotlin bridge for Java callers).
Changes:
- Update Ditto dependency to
com.ditto:ditto-kotlin-android:5.0.0-rc.3and adjust imports accordingly. - Introduce
DittoHelper.ktto bridge v5 Kotlin suspend APIs for Java usage and refactorMainActivityto use it. - Remove Jetpack Compose plugin/dependencies and add
.envvalue unquoting for BuildConfig generation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| android-java/gradle/libs.versions.toml | Updates Ditto SDK version and artifact coordinates for v5. |
| android-java/app/build.gradle.kts | Removes Compose setup and tweaks BuildConfig env parsing/fields. |
| android-java/app/src/main/java/com/example/dittotasks/DittoHelper.kt | Adds a Kotlin-to-Java bridge for Ditto v5 suspend-based APIs. |
| android-java/app/src/main/java/com/example/dittotasks/MainActivity.java | Refactors initialization/auth/sync and CRUD to call Ditto v5 through DittoHelper. |
| android-java/app/src/main/java/com/example/dittotasks/Task.java | Switches query item parsing to JSON string parsing for v5 results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the Android Java quickstart app from Ditto SDK v4 (
live.ditto:ditto:4.13.1) to v5 (com.ditto:ditto-kotlin-android:5.0.0).Key changes
live.ditto:ditto:4.13.1tocom.ditto:ditto-kotlin-android:5.0.0ingradle/libs.versions.tomllive.ditto.*tocom.ditto.kotlin.*DittoHelper.kt): The v5 Kotlin SDK usessuspendfunctions (e.g.store.execute()), which aren't directly callable from Java.DittoHelperwraps these withrunBlockingto provide synchronous Java-friendly static methods for initialization, auth, CRUD operations, subscriptions, observers, and sync control.DittoIdentity.OnlinePlayground+DefaultAndroidDittoDependencieswithDittoConfig+DittoFactory.create(). RemovedupdateTransportConfig()(websocket URL now handled by server config),disableSyncWithV3(), andALTER SYSTEM SET DQL_STRICT_MODE = false(no longer needed in v5).auth.expirationHandler+auth.login()pattern usingDittoAuthenticationProvider.development().DittoQueryResultItem.getValue()(Map) replaced withDittoQueryResultItem.jsonString()+JSONObjectparsing inTask.fromQueryItem().DittoSyncPermissions(removed in v5) with manual Android permission checks for Bluetooth, location, and nearby Wi-Fi.catch (DittoError e)tocatch (Exception e)sinceDittoExceptionextendsRuntimeException(unchecked) in v5.envValue()helper to strip shell-style quotes from.envvalues, preventing double-quoted BuildConfig strings.kotlin-composeplugin,compose = truebuild feature, and all Compose dependencies. This app uses XML layouts, and the Compose dependencies were injectingComponentActivityandPreviewActivityinto the merged manifest withexported="true"but no intent filters, which prevented Android Studio from running/debugging the app.Files changed
gradle/libs.versions.tomllive.ditto:ditto→com.ditto:ditto-kotlin-androidapp/build.gradle.ktsenvValue()for BuildConfig quote strippingapp/src/main/java/.../DittoHelper.ktapp/src/main/java/.../MainActivity.javaapp/src/main/java/.../Task.javaTest plan
./gradlew assembleDebug🤖 Generated with Claude Code