Skip to content

Commit a7b4cb9

Browse files
author
xia ning
authored
Merge pull request #153 from yamasite/master
Refactor readme and add code navigation tables
2 parents f3688ab + 7723897 commit a7b4cb9

6 files changed

Lines changed: 391 additions & 148 deletions

File tree

Android/APIExample/README.md

Lines changed: 77 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,99 @@
11
# API Example Android
22

3-
*English | [中文](README.zh.md)*
3+
_English | [中文](README.zh.md)_
44

5-
This project presents you a set of API examples to help you understand how to use Agora APIs.
5+
## Overview
66

7-
## Prerequisites
7+
This repository contains sample projects using the Agora RTC Java SDK for Android.
88

9-
- Android Studio 3.0+
10-
- Physical Android device
11-
- Android simulator is supported
9+
![image](https://user-images.githubusercontent.com/10089260/116193554-1ff95680-a762-11eb-9f51-479aef5f458e.png)
1210

13-
## Quick Start
11+
## Project structure
1412

15-
This section shows you how to prepare, build, and run the sample application.
13+
The project uses a single app to combine a variety of functionalities. Each function is loaded as a fragment for you to play with.
1614

17-
### Obtain an App Id
15+
| Function | Location |
16+
| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
17+
| Audio live streaming | [JoinChannelAudio.java](./app/src/main/java/io/agora/api/example/examples/basic/JoinChannelAudio.java) |
18+
| Video live streaming | [JoinChannelVideo.java](./app/src/main/java/io/agora/api/example/examples/basic/JoinChannelVideo.java) |
19+
| Custom audio capture | [CustomAudioSource.java](./app/src/main/java/io/agora/api/example/examples/advanced/customaudio/CustomAudioSource.java) |
20+
| Custom video renderer | [CustomRemoteVideoRender.java](./app/src/main/java/io/agora/api/example/examples/advanced/CustomRemoteVideoRender.java) |
21+
| Raw audio and video frames (JNI interface) | [ProcessRawData.java](./app/src/main/java/io/agora/api/example/examples/advanced/ProcessRawData.java) |
22+
| Raw audio frames (Native Java interface) | [ProcessAudioRawData.java](./app/src/main/java/io/agora/api/example/examples/advanced/ProcessAudioRawData.java) |
23+
| Custom video capture (Push) | [PushExternalVideo.java](./app/src/main/java/io/agora/api/example/examples/advanced/PushExternalVideo.java) |
24+
| Switch a channel | [VideoQuickSwitch.java](./app/src/main/java/io/agora/api/example/examples/advanced/VideoQuickSwitch.java) |
25+
| Join multiple channels | [JoinMultipleChannel.java](./app/src/main/java/io/agora/api/example/examples/advanced/JoinMultipleChannel.java) |
26+
| Set Audio profile | [SetAudioProfile.java](./app/src/main/java/io/agora/api/example/examples/advanced/SetAudioProfile.java) |
27+
| Set Video profile | [SetVideoProfile.java](./app/src/main/java/io/agora/api/example/examples/advanced/SetVideoProfile.java) |
28+
| Play audio files and audio mixing | [PlayAudioFiles.java](./app/src/main/java/io/agora/api/example/examples/advanced/PlayAudioFiles.java) |
29+
| Voice effects | [VoiceEffects.java](./app/src/main/java/io/agora/api/example/examples/advanced/VoiceEffects.java) |
30+
| MediaPlayer Kit | [MediaPlayerKit.java](./app/src/main/java/io/agora/api/example/examples/advanced/MediaPlayerKit.java) |
31+
| Geofencing | [GeoFencing.java](./app/src/main/java/io/agora/api/example/examples/advanced/GeoFencing.java) |
32+
| RTMP streaming | [RTMPStreaming.java](./app/src/main/java/io/agora/api/example/examples/advanced/RTMPStreaming.java) |
33+
| Audio/video stream custom encryption | [StreamEncrypt.java](./app/src/main/java/io/agora/api/example/examples/advanced/StreamEncrypt.java) |
34+
| Switch between custom video capture (MediaIO) and screen sharing | [SwitchExternalVideo.java](./app/src/main/java/io/agora/api/example/examples/advanced/SwitchExternalVideo.java) |
35+
| Video metadata | [VideoMetadata.java](./app/src/main/java/io/agora/api/example/examples/advanced/VideoMetadata.java) |
36+
| Report call status | [InCallReport.java](./app/src/main/java/io/agora/api/example/examples/advanced/InCallReport.java) |
37+
| Adjust volume | [AdjustVolume.java](./app/src/main/java/io/agora/api/example/examples/advanced/AdjustVolume.java) |
38+
| Pre-call test | [PreCallTest.java](./app/src/main/java/io/agora/api/example/examples/advanced/PreCallTest.java) |
39+
| Channel media relay | [HostAcrossChannel.java](./app/src/main/java/io/agora/api/example/examples/advanced/HostAcrossChannel.java) |
40+
| Super resolution | [SuperResolution.java](./app/src/main/java/io/agora/api/example/examples/advanced/SuperResolution.java) |
41+
| Audio/video stream encryption with methods provided by the SDK | [ChannelEncryption.java](./app/src/main/java/io/agora/api/example/examples/advanced/ChannelEncryption.java) |
42+
| Use multi-processing to send video streams from screen sharing and local camera | [MultiProcess.java](./app/src/main/java/io/agora/api/example/examples/advanced/MultiProcess.java) |
43+
| Switch role in live streaming | [LiveStreaming.java](./app/src/main/java/io/agora/api/example/examples/advanced/LiveStreaming.java) |
44+
| Use custom video source (mediaIO) to implement AR function | [ARCore.java](./app/src/main/java/io/agora/api/example/examples/advanced/ARCore.java) |
45+
| Send data stream | [SendDataStream.java](./app/src/main/java/io/agora/api/example/examples/advanced/SendDataStream.java) |
1846

19-
To build and run the sample application, get an App Id:
47+
## How to run the sample project
2048

21-
1. Create a developer account at [agora.io](https://dashboard.agora.io/signin/). Once you finish the signup process, you will be redirected to the Dashboard.
22-
2. Navigate in the Dashboard tree on the left to **Projects** > **Project List**.
23-
3. Save the **App Id** from the Dashboard for later use.
24-
4. Generate a temp **Access Token** (valid for 24 hours) from dashboard page with given channel name, save for later use.
49+
### Prerequisites
2550

26-
5. Open `Android/APIExample` and edit the `app/src/main/res/values/string_config.xml` file. Update `<#Your App Id#>` with your App Id, and change `<#Temp Access Token#>` with the temp Access Token generated from dashboard. Note you can leave the token variable `null` if your project has not turned on security token.
51+
- Physical Android device or Android simulator with Android 4.1+
52+
- Android Studio (latest version recommended)
2753

28-
```
29-
<string name="agora_app_id" translatable="false">YOUR APP ID</string>
30-
// assign token to null if you have not enabled app certificate
31-
<string name="agora_access_token" translatable="false">YOUR ACCESS TOKEN</string>
32-
```
54+
### Steps to run
3355

34-
You are all set. Now connect your Android device and run the project.
56+
1. In Android Studio, open `/Android/APIExample`.
57+
2. Sync the project with Gradle files.
58+
3. Edit the `/Android/APIExample/app/src/main/res/values/string_config.xml` file.
3559

36-
> To ensure communication security, Agora uses tokens (dynamic keys) to authenticate users joining a channel.
37-
>
38-
> Temporary tokens are for demonstration and testing purposes only and remain valid for 24 hours. In a production environment, you need to deploy your own server for generating tokens. See [Generate a Token](https://docs.agora.io/en/Interactive Broadcast/token_server)for details.
60+
- Replace `YOUR APP ID` with your App ID.
61+
- Replace `YOUR ACCESS TOKEN` with the Access Token.
3962

40-
## Contact Us
63+
```xml
64+
<string name="agora_app_id" translatable="false">YOUR APP ID</string>
65+
<string name="agora_access_token" translatable="false">YOUR ACCESS TOKEN</string>
66+
```
4167

42-
- For potential issues, take a look at our [FAQ](https://docs.agora.io/en/faq) first
68+
> See [Set up Authentication](https://docs.agora.io/en/Agora%20Platform/token) to learn how to get an App ID and access token. You can get a temporary access token to quickly try out this sample project.
69+
>
70+
> The Channel name you used to generate the token must be the same as the channel name you use to join a channel.
71+
72+
> To ensure communication security, Agora uses access tokens (dynamic keys) to authenticate users joining a channel.
73+
>
74+
> Temporary access tokens are for demonstration and testing purposes only and remain valid for 24 hours. In a production environment, you need to deploy your own server for generating access tokens. See [Generate a Token](https://docs.agora.io/en/Interactive%20Broadcast/token_server) for details.
75+
76+
4. Make the project and run the app in the simulator or connected physical Android device.
77+
78+
You are all set! Feel free to play with this sample project and explore features of the Agora RTC SDK.
79+
80+
## Feedback
81+
82+
If you have any problems or suggestions regarding the sample projects, feel free to file an issue.
83+
84+
## Reference
85+
86+
- [RTC Java SDK Product Overview](https://docs.agora.io/en/Interactive%20Broadcast/product_live?platform=Android)
87+
- [RTC Java SDK API Reference](https://docs.agora.io/en/Interactive%20Broadcast/API%20Reference/java/index.html)
88+
89+
## Related resources
90+
91+
- Check our [FAQ](https://docs.agora.io/en/faq) to see if your issue has been recorded.
4392
- Dive into [Agora SDK Samples](https://github.com/AgoraIO) to see more tutorials
4493
- Take a look at [Agora Use Case](https://github.com/AgoraIO-usecase) for more complicated real use case
4594
- Repositories managed by developer communities can be found at [Agora Community](https://github.com/AgoraIO-Community)
46-
- You can find full API documentation at [Document Center](https://docs.agora.io/en/)
47-
- If you encounter problems during integration, you can ask question in [Stack Overflow](https://stackoverflow.com/questions/tagged/agora.io)
48-
- You can file bugs about this sample at [issue](https://github.com/AgoraIO/Basic-Video-Call/issues)
95+
- If you encounter problems during integration, feel free to ask questions in [Stack Overflow](https://stackoverflow.com/questions/tagged/agora.io)
4996

5097
## License
5198

52-
The MIT License (MIT)
99+
The sample projects are under the MIT license. See the [LICENSE](/LICENSE) file for details.

0 commit comments

Comments
 (0)