Skip to content

Feature/implement sdk android - #21

Merged
buivietphi merged 3 commits into
mainfrom
feature/implement_sdk_android
Aug 8, 2026
Merged

buivietphi merged 3 commits into
mainfrom
feature/implement_sdk_android

Conversation

@buivietphi

@buivietphi buivietphi commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation update
  • Performance improvement
  • CI/CD or build configuration
  • Other (describe below)

Testing

  • Tested on macOS
  • Tested on Windows
  • Flutter analyze passes
  • SDK build passes (if applicable)

Screenshots (if applicable)

Summary by CodeRabbit

  • New Features

    • Added simplified Android SDK setup with automatic integrations, ViewModel state discovery, and ANR monitoring.
    • Added Java-friendly APIs for lifecycle, logging, networking, state, storage, performance, commands, and async tracking.
    • Added MMKV typed value support and configurable storage labels.
  • Bug Fixes

    • Improved WebSocket security, validation, reconnection, and large-frame handling.
    • Redacted sensitive headers, form values, logs, and storage data.
    • Limited captured response bodies to 1 MB with truncation reporting.
  • Documentation

    • Expanded installation, configuration, integration, and Java usage guides.

@buivietphi
buivietphi merged commit 2285e29 into main Aug 8, 2026
4 of 5 checks passed
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8369b0b2-e8e4-4790-8fd2-d50bbcbbb7ff

📥 Commits

Reviewing files that changed from the base of the PR and between a6183e3 and d2e6d91.

⛔ Files ignored due to path filters (1)
  • client_sdks/devconnect-android/gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar and included by client_sdks/**
📒 Files selected for processing (33)
  • client_sdks/devconnect-android/README.md
  • client_sdks/devconnect-android/build.gradle.kts
  • client_sdks/devconnect-android/docs/java-usage.md
  • client_sdks/devconnect-android/gradle.properties
  • client_sdks/devconnect-android/gradle/wrapper/gradle-wrapper.properties
  • client_sdks/devconnect-android/gradlew
  • client_sdks/devconnect-android/gradlew.bat
  • client_sdks/devconnect-android/sample-integration/Application.kt.template
  • client_sdks/devconnect-android/sample-integration/NetworkModule.kt.template
  • client_sdks/devconnect-android/settings.gradle.kts
  • client_sdks/devconnect-android/src/main/java/com/devconnect/DevConnect.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/DevConnectJava.java
  • client_sdks/devconnect-android/src/main/java/com/devconnect/client/WebSocketClient.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/interceptors/HttpURLConnectionInterceptor.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/interceptors/KtorInterceptor.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/interceptors/LogcatInterceptor.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/interceptors/OkHttpInterceptor.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/interceptors/URLStreamHandlerFactory.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/interceptors/ViewModelObserver.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/plugins/AnrWatchdog.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/plugins/AppBenchmark.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/plugins/ErrorMonitor.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/plugins/MemoryLeakDetector.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/plugins/PerformanceMonitor.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/plugins/ViewModelAutoDiscoverer.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/reporters/LogReporter.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/reporters/MmkvReporter.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/reporters/StateFlowObserver.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/wrappers/DevConnectMMKV.kt
  • client_sdks/devconnect-android/src/main/java/com/devconnect/wrappers/DevConnectRealm.kt
  • client_sdks/devconnect-android/src/test/java/com/devconnect/DevConnectInstallForAppTest.kt
  • client_sdks/devconnect-android/src/test/java/com/devconnect/plugins/AnrWatchdogTest.kt
  • client_sdks/devconnect-android/src/test/java/com/devconnect/plugins/ViewModelAutoDiscovererTest.kt

📝 Walkthrough

Walkthrough

The Android SDK now supports Maven Central publishing, Java integration, automatic ANR and ViewModel monitoring, safer WebSocket and HTTP capture, expanded storage reporting, and lifecycle cleanup. Documentation and sample integration templates cover Kotlin, Java, networking, and logging setup.

Changes

Android SDK delivery and runtime

Layer / File(s) Summary
Build, publishing, and integration setup
client_sdks/devconnect-android/build.gradle.kts, settings.gradle.kts, gradle.properties, gradle/wrapper/*, gradlew*, README.md, docs/java-usage.md, sample-integration/*
The project adds Gradle 8.9 wrapper support, centralized repositories, Maven Central publishing, Java usage documentation, and Hilt-based OkHttp, Retrofit, Timber, and installForApp() templates.
Core lifecycle and Java facade
src/main/java/com/devconnect/DevConnect.kt, DevConnectJava.java, src/test/java/com/devconnect/DevConnectInstallForAppTest.kt
DevConnect is disabled by default, initializes asynchronously, synchronizes pre-init messages, handles reloads and commands, and adds installForApp(). DevConnectJava exposes lifecycle, reporting, listener, interceptor, display, and async APIs. Reflection tests validate the installation contract.
Transport validation and bounded capture
src/main/java/com/devconnect/client/WebSocketClient.kt, src/main/java/com/devconnect/interceptors/*
WebSocket handshakes and frames receive validation, size limits, secure masking, and jittered reconnects. HTTP integrations redact sensitive values and cap captured bodies at 1 MB. Ktor now uses manual lifecycle reporting.
Monitoring and state discovery
src/main/java/com/devconnect/plugins/*, src/main/java/com/devconnect/interceptors/ViewModelObserver.kt, src/main/java/com/devconnect/reporters/StateFlowObserver.kt, src/test/java/com/devconnect/plugins/*
The SDK adds configurable ANR detection and reflection-based ViewModel discovery. Flow observation uses typed coroutine collection. Monitoring components retain lifecycle callbacks and provide cleanup methods. Tests cover watchdog behavior and ViewModel discovery.
Storage and metadata reporting
src/main/java/com/devconnect/reporters/*, src/main/java/com/devconnect/wrappers/*
Log and storage metadata values are redacted. MMKV supports labeled storage types, typed encoding, primitive-aware reflection, and additional decode methods. Realm inline wrappers can access their storage constant.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Poem

WebSockets knock with keys made bright,
Frames stay bounded through the night.
ViewModels flow, ANRs keep time,
Java calls cross Kotlin’s line.
Redacted logs and stores align—
DevConnect ships, concise and fine.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/implement_sdk_android

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant