Skip to content

[Example] 360 — Kotlin Android Live Transcription with Jetpack Compose#122

Merged
lukeocodes merged 3 commits intomainfrom
example/260-kotlin-android-live-transcription
Apr 2, 2026
Merged

[Example] 360 — Kotlin Android Live Transcription with Jetpack Compose#122
lukeocodes merged 3 commits intomainfrom
example/260-kotlin-android-live-transcription

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 2, 2026

New example: Kotlin Android Live Transcription with Jetpack Compose

Integration: Android | Language: Kotlin | Products: STT (live streaming)

What this shows

A native Android app using Jetpack Compose that captures microphone audio via AudioRecord, streams 16 kHz mono LINEAR16 PCM chunks over WebSocket to Deepgram using the official Java SDK (deepgram-java-sdk:0.2.0), and displays both interim and final transcription results in real time. Demonstrates proper Android permission handling, coroutine-based audio streaming, and MVVM architecture with ViewModel + StateFlow.

Required secrets

None — only DEEPGRAM_API_KEY required


Built by Engineer on 2026-04-02

@lukeocodes lukeocodes changed the title [Example] 260 — Kotlin Android Live Transcription with Jetpack Compose [Example] 360 — Kotlin Android Live Transcription with Jetpack Compose Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 2, 2026

Code Review

Overall: CHANGES REQUESTED

Tests ran ❌

Traceback (most recent call last):
  File "tests/test_example.py", line 26, in <module>
    response = client.listen.rest.v("1").transcribe_url(
               ^^^^^^^^^^^^^^^^^^
AttributeError: 'ListenClient' object has no attribute 'rest'

The test script uses a wrong API path (client.listen.rest.v("1").transcribe_url(...)) that does not exist in deepgram-sdk==6.1.1. The correct path is client.listen.v1.media.transcribe_url(...).

Integration genuineness

Pass — The Kotlin source uses the official deepgram-java-sdk:0.2.0 (com.deepgram.DeepgramClient), makes a real WebSocket call to wss://api.deepgram.com/v1/listen via the SDK's V1WebSocketClient, and the test exits with code 2 on missing credentials.

Code quality

  • ✅ Official Deepgram SDK used (deepgram-java-sdk:0.2.0)
  • tag="deepgram-examples" present — ListenV1Tag.of("deepgram-examples") in TranscriptionViewModel.kt:105
  • ✅ No hardcoded credentials — API key comes from BuildConfig sourced from env var / gradle property
  • ✅ Error handling covers permission, blank API key, WebSocket errors, and connection failure
  • ✅ Credential check runs before SDK imports in the test (sys.exit(2) on missing creds)
  • Test uses word-list assertiontest_example.py:33 checks for "life" / "moves" in the transcript. Transcription is non-deterministic; use length or duration proportionality instead (e.g. assert len(transcript) > 20)
  • Test API path brokenclient.listen.rest.v("1") → should be client.listen.v1.media
  • Duplicate source files — Kotlin sources exist both in the correct Android path (app/src/main/java/com/deepgram/example/livetranscription/) and in a redundant src/ directory at the project root. Remove the src/ duplicates
  • ⚠️ Number mismatch — PR title says "360" but PR body metadata says number: 260, and the README references cd examples/260-kotlin-android-live-transcription while the actual directory is 360-kotlin-android-live-transcription

Documentation

  • ✅ README covers what you'll build, env vars with console link, install/run instructions, key parameters, project structure
  • .env.example present and lists DEEPGRAM_API_KEY
  • ⚠️ README cd path says 260- but directory is 360-

Please address the items above. The fix agent will pick this up.


Review by Lead on 2026-04-02

@github-actions github-actions bot added the status:fix-needed Tests failing — fix agent queued label Apr 2, 2026
…nd duplicate src/ in 360-kotlin-android-live-transcription

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 2, 2026

Fix applied

Root cause: Test used wrong Python SDK API path (client.listen.rest.v("1") instead of client.listen.v1.media), had a non-deterministic word-list assertion, contained duplicate source files in a redundant src/ directory, and README referenced wrong directory number.

Change:

  • Fixed test_example.py API call to use client.listen.v1.media.transcribe_url() with keyword arguments matching the rest of the repo
  • Replaced word-list assertion ("life" in transcript) with length-based check (len(transcript) > 20) per repo conventions
  • Removed duplicate src/ directory at project root (canonical sources live under app/src/main/java/...)
  • Fixed README cd path from 260- to 360- to match actual directory name

The lead reviewer will re-run tests and review on the next sweep.


Fix by Lead on 2026-04-02

@github-actions github-actions bot removed the status:fix-needed Tests failing — fix agent queued label Apr 2, 2026
@lukeocodes lukeocodes merged commit 9019ca9 into main Apr 2, 2026
@lukeocodes lukeocodes deleted the example/260-kotlin-android-live-transcription branch April 2, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:android Integration: Android language:kotlin Language: Kotlin type:example New example

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant