Skip to content

Make the Kotlin and Android SDKs and their Java examples usable from Java #2096

Closed

Description

@ChiragAgg5k

Tracks PR #2095.

Plan

Goal: Make the generated Kotlin and Android SDKs callable from Java the way their docs show, and make every generated Java example compile.

What changes (all in #2095):

  • templates/android/library/src/main/java/io/package/services/Service.kt.twig and templates/kotlin/src/main/kotlin/io/appwrite/services/ServiceTemplate.kt.twig: every Android service method declares @Throws(AppwriteException::class) (matching Kotlin), and all-required upload methods get @JvmOverloads so Java can skip onProgress.
  • ID, Permission, Role, Query, Operator, models/InputFile templates (both SDKs) and Android Channel.kt.twig: @JvmStatic plus @JvmOverloads where a parameter has a default, so Java can write ID.unique().
  • templates/{kotlin,android}/docs/java/example.md.twig and src/SDK/Language/Kotlin.php: Java examples get try/catch, List/Map imports, a terminated Client, correctly typed numeric list literals, array-enum values and the Android OAuth activity argument.
  • Tests: tests/e2e/languages/kotlin/java-examples.php turns every generated docs/examples/java/**.md into a Java class and compiles it; tests/e2e/languages/kotlin/JavaInterop.java runs against the mock server; wired into KotlinJava17Test, Android16Java17Test, Android5Java17Test and tests/e2e/Base.php.

Remaining steps: The linked PR is the full change. Note for release notes: Java users of the Android SDK now need a try/catch (or throws) around calls that previously compiled without one.

Done when:

Activity

  1. self-assigned this
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions