Full demo project. Covers all Agora RTC APIs using Java/Kotlin + XML layouts. Default project when the PRD does not specify a platform variant.
./gradlew assembleDebug # build debug APK
./gradlew installDebug # build + install to connected device
./gradlew test # unit tests
./gradlew connectedAndroidTest # instrumented tests (device required)Edit app/src/main/res/values/string-configs.xml:
<string name="agora_app_id" translatable="false">YOUR_APP_ID</string>
<string name="agora_app_certificate" translatable="false">YOUR_CERT</string>Leave certificate blank if your project has not enabled App Certificate.
Controlled via gradle.properties:
simpleFilter = true— enables the C++ video extension module (agora-simple-filter). Requires OpenCV and Agora C++ SDK headers. See README for setup.streamEncrypt = true— enables the custom stream encryption module (agora-stream-encrypt). Requires Agora C++ SDK headers. See README for setup.
Both are false by default. Do not enable them unless the PRD explicitly requires it.
See ARCHITECTURE.md for the full registration mechanism. The required steps are:
-
Create a Fragment class under
app/src/main/java/io/agora/api/example/examples/{basic|advanced|audio}/- Extend
BaseFragment(orBaseVbFragmentfor ViewBinding) - Add
@Example(index, group, name, actionId, tipsId)annotation
- Extend
-
Add string resources to
app/src/main/res/values/strings.xml:namestring (display name in the list)tipsstring (description shown on the case screen)
-
Add navigation entries to
app/src/main/res/navigation/nav_graph.xml:<fragment>destination (under root<navigation>) for the new Fragment<action>inside<fragment id="Ready">— notmainFragment;mainFragmentonly routes toReady
-
Update
ARCHITECTURE.md— add one line to the case list under the correct directory section (basic/,advanced/, oraudio/). This keeps the fast-lookup index used byquery-casescurrent. -
Build and run — the case appears automatically via reflection. No other registration needed.
- Do NOT add audio-only cases that require
voice-sdkexclusivity — useAPIExample-Audio/instead. - Do NOT use Jetpack Compose — this project is XML + ViewBinding only.
- Each case Fragment must create and destroy its own
RtcEngineinstance. - Always call
engine.leaveChannel()beforeRtcEngine.destroy()inonDestroy(). - Call
RtcEngine.destroy()viahandler.post(RtcEngine::destroy)— direct call blocks the main thread (ANR). - All
IRtcEngineEventHandlercallbacks run on a background thread — userunOnUIThread()for UI updates. - Always call
checkOrRequestPermission()beforejoinChannel(). setParameters(...)is required in every case for backend reporting — do not omit it.- Always null-check
getPrivateCloudConfig()before callingsetLocalAccessPoint()— returns null on non-private-cloud builds.
Use the add-new-case Skill for straightforward cases. Use the Spec workflow (via complex-case-spec steering) when the case meets any complexity criteria — see below.
.kiro/skills/add-new-case/— step-by-step guide for adding a new case (template, nav placement, verify checklist).kiro/skills/query-cases/— query existing cases by API, group, or sort index; usesARCHITECTURE.mdas fast index
Use the Spec workflow if the case meets any of these criteria:
- Involves coordinated calls across two or more Agora API modules
- Requires a custom UI layout (not one of the standard Layout A/B/C/D templates)
- Involves multi-channel or multi-engine instance management
- Requires a foreground Service or background thread coordination
- Involves developing new shared components (widgets/utils, etc.)
- Requires optional module integration (
simpleFilter/streamEncrypt)
Activate the complex-case-spec steering file (manual inclusion) for the full Spec requirements and design checklist.
.kiro/hooks/build-on-task-complete.json— runs./gradlew assembleDebugautomatically after each spec task completes to catch compile errors early
| File | Inclusion | Purpose |
|---|---|---|
.kiro/steering/coding-standards.md |
Always | RtcEngine lifecycle rules, Java code standards, naming conventions |
.kiro/steering/project-routing.md |
Always | Which sub-project to use for a given scenario |
.kiro/steering/complex-case-spec.md |
Manual | Spec requirements/design checklist for complex cases |
ARCHITECTURE.md— full directory layout, case registration internals, navigation details