# dropbox/dropbox-sdk-java architecture

> Architecture diagram of the GitHub repository dropbox/dropbox-sdk-java, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dropbox/dropbox-sdk-java
- Repository: https://github.com/dropbox/dropbox-sdk-java

## Overview

##### Project type and purpose
- This is an open-source, multi-module Java/Android SDK (Dropbox Core SDK for Java). It provides a reusable library for calling Dropbox’s HTTP Core API (v1 & v2), an Android wrapper in Kotlin/Java, and a Stone-based code generator plugin. It also ships with sample applications demonstrating how to integrate the SDK.

##### File structure
- Top-level modules (subprojects) in settings.gradle:
- core: the Java library module containing the HTTP client, JSON serializers, OAuth flows, and generated API surface.
- android: Android-specific wrapper in Kotlin/Java that depends on core, exposes Auth flows to Android apps.
- stone-java-gradle-plugin: a Gradle plugin that reads Stone specification files and emits generated API source under core/build/generated_stone_source.
- examples: contains sample console, web, Android, and Java applications illustrating usage.
- proguard: a small demo showing ProGuard integration.
- Build scripts (build.gradle, gradlew, gradle.properties) configure multi-module Gradle builds, dependencies, publishing, and test tasks.
- Generated code lives under core/build/generated_stone_source, consumed by core/src/main/java.
- External‐facing artifacts: core JAR, android AAR, plugin JAR.

##### README for additional insights
- Describes supported Java/Android versions, dependency declarations, tutorial snippets, sample run commands, integration tests.
- Highlights extensibility points: pluggable HTTP requestors (StandardHttpRequestor, OkHttpRequestor, OkHttp3Requestor), JSON serializers, custom SSLSocketFactory/certificate pinning, ProGuard rules.
- Shows AndroidManifest configuration needed for in-app and app-to-app OAuth flows.

##### Elements
- Clear labels on each module/component (e.g., “core module,” “stone-plugin,” “Android wrapper,” “Dropbox API”)
- Library modules (rectangles)
- Related items (e.g., underline all Gradle subprojects under a “GitHub Repo” boundary).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "GitHub Repo"
        subgraph "Gradle Modules"
            stonePlugin["Stone Plugin"]:::plugin
            generatedModel["Generated Model"]:::generated
            coreModule["Core Module"]:::module
            androidModule["Android Module"]:::module
            examplesAndroid["Examples - Android"]:::example
            examplesCW["Examples - Console/Web"]:::example
            examplesJava["Examples - Java"]:::example
        end
        buildSystem["Gradle Build System"]:::build
    end

    stonePlugin -->|"generates code"| generatedModel
    generatedModel -->|"compiled into"| coreModule
    coreModule -->|"uses at runtime"| StandardReq
    coreModule -->|"uses at runtime"| OkHttpReq
    coreModule -->|"uses at runtime"| OkHttp3Req
    coreModule -->|"makes API calls"| dropboxAPI
    androidModule -->|"depends on"| coreModule
    examplesAndroid -->|"depends on"| androidModule
    examplesAndroid -->|"depends on"| coreModule
    examplesCW -->|"depends on"| coreModule
    examplesJava -->|"depends on"| coreModule
    buildSystem -->|"build/test/publish"| stonePlugin
    buildSystem -->|"build/test/publish"| coreModule
    buildSystem -->|"build/test/publish"| androidModule
    buildSystem -->|"build/test/publish"| examplesAndroid
    buildSystem -->|"build/test/publish"| examplesCW
    buildSystem -->|"build/test/publish"| examplesJava

    subgraph "Pluggable HTTP Engines"
        StandardReq["StandardHttpRequestor"]:::extension
        OkHttpReq["OkHttpRequestor"]:::extension
        OkHttp3Req["OkHttp3Requestor"]:::extension
    end

    dropboxAPI["Dropbox API Servers"]:::external

    %% Click Events
    click coreModule "https://github.com/dropbox/dropbox-sdk-java/blob/main/core/build.gradle"
    click generatedModel "https://github.com/dropbox/dropbox-sdk-java/tree/main/core/build/generated_stone_source"
    click androidModule "https://github.com/dropbox/dropbox-sdk-java/blob/main/android/build.gradle"
    click stonePlugin "https://github.com/dropbox/dropbox-sdk-java/blob/main/stone-java-gradle-plugin/build.gradle.kts"
    click examplesAndroid "https://github.com/dropbox/dropbox-sdk-java/blob/main/examples/android/build.gradle"
    click examplesCW "https://github.com/dropbox/dropbox-sdk-java/blob/main/examples/examples/build.gradle"
    click examplesJava "https://github.com/dropbox/dropbox-sdk-java/blob/main/examples/java/build.gradle"
    click StandardReq "https://github.com/dropbox/dropbox-sdk-java/blob/main/core/src/main/java/com/dropbox/core/http/StandardHttpRequestor.java"
    click OkHttpReq "https://github.com/dropbox/dropbox-sdk-java/blob/main/core/src/main/java/com/dropbox/core/http/OkHttpRequestor.java"
    click OkHttp3Req "https://github.com/dropbox/dropbox-sdk-java/blob/main/core/src/main/java/com/dropbox/core/http/OkHttp3Requestor.java"
    click buildSystem "https://github.com/dropbox/dropbox-sdk-java/blob/main/settings.gradle"

    classDef plugin fill:#f9f,stroke:#333,stroke-width:1px
    classDef generated fill:#ccf,stroke:#333,stroke-width:1px
    classDef module fill:#cfc,stroke:#333,stroke-width:1px
    classDef extension fill:#ffc,stroke:#333,stroke-width:1px
    classDef external fill:#eef,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef build fill:#fcf,stroke:#333,stroke-width:1px
    classDef example fill:#fee,stroke:#333,stroke-width:1px
```
