Create and authorize
Authenticate the user, choose the media region, call CreateMeeting and CreateAttendee, store room state, then return only the join response to the authorized client.
Unity owns the smart-glass experience. The native Android SDK owns real-time audio and video. A small bridge lets both do the job they are good at—without putting AWS credentials in the app.
Keep the AWS control plane on your server and the media plane on the Android device. The app receives only short-lived meeting and attendee credentials.
Lobby, buttons, captions, status and XREAL interaction.
AndroidJavaClass calls native methods; JSON events return to Unity.
Meeting session, microphone, camera, remote tiles and WebRTC transport.
CreateMeeting + CreateAttendee → return { Meeting, Attendee } JSON. Never ship IAM keys in the APK.Authenticate the user, choose the media region, call CreateMeeting and CreateAttendee, store room state, then return only the join response to the authorized client.
Build a MeetingSessionConfiguration, start audio, start remote video, publish the local camera, observe attendees and bind video tiles to an Android render view.
Your API should return the AWS Meeting and Attendee objects together. The Android bridge needs the media URLs, meeting ID, attendee ID and join token. The server keeps its AWS credentials; the Unity app never receives them.
This project injects the Maven dependency during Android post-processing, which avoids maintaining a generated Gradle project by hand. Pin and test a version before upgrading.
dependencies {
implementation 'software.aws.chimesdk:amazon-chime-sdk:0.25.3'
}Add INTERNET, CAMERA, RECORD_AUDIO, MODIFY_AUDIO_SETTINGS, FOREGROUND_SERVICE and FOREGROUND_SERVICE_MICROPHONE. Ask the user for camera and microphone permission at runtime. Android 14 also requires a foreground microphone service while the call is active.
Compile this path only for an Android player. The Unity Editor can exercise the API and UI, but it cannot load the Android Chime runtime.
#if UNITY_ANDROID && !UNITY_EDITOR
using var bridge = new AndroidJavaClass(
"com.technobrave.meet.ChimeUnityBridge");
bridge.CallStatic("initialize", "MeetLobbyApp");
bridge.CallStatic("joinMeeting", joinResponseJson);
#endifParse the join response, construct MeetingSessionConfiguration, then create DefaultMeetingSession. Register observers before starting media so Unity receives the complete state transition.
MeetingSessionConfiguration config =
new MeetingSessionConfiguration(
new CreateMeetingResponse(meeting),
new CreateAttendeeResponse(attendee));
meetingSession = new DefaultMeetingSession(
config, logger, activity.getApplicationContext());
audioVideo = meetingSession.getAudioVideo();
audioVideo.addAudioVideoObserver(this);
audioVideo.addVideoTileObserver(this);
audioVideo.addRealtimeObserver(this);
audioVideo.start();
audioVideo.startRemoteVideo();Implement VideoTileObserver. When a remote tile is added, create a DefaultVideoRenderView on the Android UI thread and call bindVideoView. Use the SDK's local video and realtime audio methods behind Unity's Camera and Mic buttons.
Return small JSON events instead of letting C# poll Android. The target GameObject must exist and the callback method must be public.
event.put("type", type);
event.put("message", message);
UnityPlayer.UnitySendMessage(
"MeetLobbyApp",
"OnNativeChimeEvent",
event.toString());These paths are relative to the Unity repository. The native bridge is intentionally isolated from the lobby UI so it can be replaced or tested independently.
Assets/Meet/Scripts/ChimeAndroidBridge.csC# facade for initialize, join, leave, microphone and camera.
Assets/Plugins/Android/ChimeUnityBridge.javaNative Chime meeting session, observers, render view and events.
Assets/Meet/Editor/ChimeAndroidBuildPostprocessor.csInjects the SDK dependency, permissions and foreground service.
Assets/Meet/Editor/MeetAndroidBuild.csSeparate emulator and XREAL builds with temporary loader settings.
Assets/Meet/Scripts/MeetLobbyController.csCalls the backend, passes join JSON to Android and updates the UI.
Assets/Meet/Scenes/MeetLobby.unityThe test scene with the stable MeetLobbyApp callback target.
| Target | What works | What does not | Use it for |
|---|---|---|---|
| Unity Editor | Partial Lobby, HTTPS API and UI state | Android SDK, real audio/video and Java bridge | Fast UI and backend iteration |
| Android emulator | Supported Native bridge, signaling, audio and video lifecycle | Reliable physical camera/mic behavior; XREAL display path | Integration and log testing |
| Android phone | Supported Full Chime audio/video with real hardware | XREAL-specific rendering unless glasses are attached and supported | Two-participant media proof |
| XREAL / Beam Pro | Target Chime media plus the Unity XR experience | Nothing by design; validate device firmware and Eye camera path | Real worker workflow and acceptance test |
On an ARM64 Android 14 emulator, the current bridge produced this state sequence. A remote video tile still requires a second participant who is publishing a camera.
| Symptom | Likely layer | Check first |
|---|---|---|
| Room exists, but no media | Android bridge | Confirm joinMeeting ran and look for audio_connecting. |
Only bridge_ready | API / Unity controller | Inspect the join HTTP response and confirm it contains both objects. |
| Audio connects, no remote video | Participant / tile binding | Verify another client is sending camera video and log onVideoTileAdded. |
| Camera or mic fails | Android permission | Runtime grants, manifest entries, emulator virtual devices and Android 14 service. |
| Works in Editor, not APK | Gradle / JNI | Inspect adb logcat for missing class, Maven or manifest errors. |
| APK starts but XREAL fails | XR loader | Use the XREAL build menu; the emulator build deliberately disables its loader. |
XREAL SDK, camera flow, testing constraints and deployment are covered in the main development guide.