# Cloud Gaming RTC Example

> Use Agora RTC for interactive cloud gaming media.

Native mobile references for starting a cloud game, receiving its RTC video and sending control input. Requires cloud-gaming service access.

- Author: Agora
- Updated: 2026-10-21
- Difficulty: Advanced
- Categories: rtc
- Platforms: Android, iOS
- Use cases: Cloud Gaming, Interactive Streaming
- Capabilities: Agora RTC, Cloud Gaming, Realtime Media
- [Recipe page](https://recipes.agora.io/recipes/cloud-gaming-rtc-example)
- [Implementation repository](https://github.com/AgoraIO-Community/Agora-CloudGame-Example)
- [Source recipe](https://github.com/AgoraIO-Community/Agora-CloudGame-Example/blob/main/docs/ai/RECIPE.md)
- [Raw source Markdown](https://raw.githubusercontent.com/AgoraIO-Community/Agora-CloudGame-Example/main/docs/ai/RECIPE.md)
- [All recipes](https://recipes.agora.io/llms.txt)

## Implementation guide

# Cloud Gaming RTC Example

## Overview

Use Agora RTC for low-latency cloud game streaming, player viewing, and interactive media transport.

Repository: [AgoraIO-Community/Agora-CloudGame-Example](https://github.com/AgoraIO-Community/Agora-CloudGame-Example)

## Prerequisites and Setup

1. Provision a test project with access to the cloud-gaming service. The sample demonstrates service REST operations and RTC reception together.
2. Open `Android/Agora-CloudGame-Example/` in Android Studio (the guide lists Android Studio 4.2+ and Android API 21+).
3. Set `APP_ID` and `APP_CERTIFICATE` in that Android project's `local.properties`, sync Gradle and run on a physical device.
4. Use the sample's game start/stop flow and send its control commands while receiving the game video. Inspect the separate `iOS/` project for the iOS variant.

## What To Check

- Verify game session creation and teardown using service responses.
- Confirm the game video renders and control input affects the remote game.
- Test stop/restart and ensure the previous game session is terminated.

## Integration Notes

The upstream example intentionally omits an application server. Production game/service requests, especially billable actions, need an authenticated business backend.

Keep App Certificates, customer secrets and privileged token generation on a trusted backend for production. Use only your own test credentials while configuring historical demos; do not commit them. Preserve the sample's existing dependency versions and lifecycle until a separate migration is tested.

## Source References

- [Android/Agora-CloudGame-Example/README.md](https://github.com/AgoraIO-Community/Agora-CloudGame-Example/blob/main/Android/Agora-CloudGame-Example/README.md)

## Validation Status

This recipe was checked against the repository's source and setup documents. The platform build and live service/device flow have not been run as part of this documentation change. Complete the checks above in an environment with the required SDKs, hardware and service access before treating it as a validated deployment.

## Implementation Prompt

```text
You are working in AgoraIO-Community/Agora-CloudGame-Example. Use docs/ai/RECIPE.md and its linked source files to adapt the Cloud Gaming RTC Example reference to this project.

Start by inspecting the actual sample directory and configuration described above. Resolve its listed missing prerequisites before claiming it is runnable. Preserve the existing architecture and compatible dependency versions. Implement the recipe's feature-specific flow, permissions and resource cleanup. Use a trusted backend for privileged credentials and tokens in production.

Run the repository-specific build or launch flow, then perform each What To Check item. Report the commands run, the observed results and anything blocked by service access, hardware or incomplete sample code. Do not claim live validation from a documentation or catalog build alone.
```


## Recipe prompt

You are implementing the "Cloud Gaming RTC Example" recipe in this project.

Read the recipe markdown first:
https://raw.githubusercontent.com/AgoraIO-Community/Agora-CloudGame-Example/main/docs/ai/RECIPE.md

Use the source repository for cross-reference:
https://github.com/AgoraIO-Community/Agora-CloudGame-Example

Build this recipe into the user's app using the markdown as the implementation guide. Inspect related source files through the repository links when the recipe points to them. Ask before installing new dependencies.
