Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
plutoless committed Mar 20, 2020
1 parent 2d11060 commit 64151f7
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 3 deletions.
80 changes: 80 additions & 0 deletions Android/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Android Samples for Advanced Applications of Agora Video SDK APIs

*English | [中文](README.zh.md)*

This demo will give examples of how to use Agora Video SDK combined with Android framework APIs, as well as potential scenarios that applies audio & video modules.

## Configuration
Expand Down Expand Up @@ -58,5 +60,83 @@ The App's compiled library name should start with a pre-defined prefix like **"l

Plugins use header files which are in the SDK downloaded zip files but not a part of JCenter dependency. The headers are submitted along with the project right now, but if Agora SDK dependency needs to be upgraded, the headers might as well. Once necessary, we suggest that developers download the latest SDK version and replace those headers. Or rather, download and copy the whole SDK instead of introducing from JCenter.


## Prerequisites

- Android Studio 3.3 or above
- Android device (e.g. Nexus 5X). A real device is recommended because some simulators have missing functionality or lack the performance necessary to run the sample.

## Quick Start

This section shows you how to prepare, build, and run the sample application.

### Obtain an App ID

To build and run the sample application, get an App ID:
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.
2. Navigate in the Dashboard tree on the left to **Projects** > **Project List**.
3. Save the **App ID** from the Dashboard for later use.
4. Generate a temp **Access Token** (valid for 24 hours) from dashboard page with given channel name, save for later use.

5. Locate the file **lib-component/src/main/res/values/strings_config.xml** and replace <#YOUR APP ID#> with the App ID in the dashboard.

```xml
<string name="agora_app_id"><#YOUR APP ID#></string>
<!-- Obtain a temp Access Token at https://dashboard.agora.io -->
<!-- You will need to deploy your own token server for production release -->
<!-- Leave this value empty if Security keys/Token is not enabled for your project -->
<string name="agora_access_token"><#YOUR TOKEN#></string>
```

### Integrate the Agora Video SDK

The SDK must be integrated into the sample project before it can opened and built. There are two methods for integrating the Agora Video SDK into the sample project. The first method uses JCenter to automatically integrate the SDK files. The second method requires you to manually copy the SDK files to the project.

#### Method 1 - Integrate the SDK Automatically Using JCenter (Recommended)

1. Clone this repository.
2. Open **lib-component/build.gradle** and add the following line to the `dependencies` list:

```
...
dependencies {
...
implementation 'io.agora.rtc:full-sdk:3.0.0'
}
```

#### Method 2 - Manually copy the SDK files

1. Download the Agora Video SDK from [Agora.io SDK](https://www.agora.io/en/download/).
2. Unzip the downloaded SDK package.
3. Copy the following files from from the **libs** folder of the downloaded SDK package:

Copy from SDK|Copy to Project Folder
---|---
.jar file|**/lib-component/libs** folder
**arm64-v8a** folder|**/lib-component/src/main/jniLibs** folder
**x86** folder|**/lib-component/src/main/jniLibs** folder
**armeabi-v7a** folder|**/lib-component/src/main/jniLibs** folder



### Run the Application

Open project with Android Studio, connect your Android device, build and run.

Or use `Gradle` to build and run.


## Contract Us

- For potential issues, take a look at our [FAQ](https://docs.agora.io/cn/faq) first
- Dive into [Agora SDK Samples](https://github.com/AgoraIO) to see more tutorials
- Take a look at [Agora Use Case](https://github.com/AgoraIO-usecase) for more complicated real use case
- Repositories managed by developer communities can be found at [Agora Community](https://github.com/AgoraIO-Community)
- You can find full API documentation at [Document Center](https://docs.agora.io/en/)
- If you encounter problems during integration, you can ask question in [Stack Overflow](https://stackoverflow.com/questions/tagged/agora.io)
- You can file bugs about this sample at [issue](https://github.com/AgoraIO/Advanced-Video/issues)


## Licence
The MIT License (MIT).
67 changes: 67 additions & 0 deletions Android/README.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Android Samples for Advanced Applications of Agora Video SDK APIs

*[English](README.md) | 中文*

## 运行示例程序

这个段落主要讲解了如何编译和运行实例程序。

### 创建Agora账号并获取AppId

在编译和启动实例程序前,您需要首先获取一个可用的App ID:
1.[agora.io](https://dashboard.agora.io/signin/)创建一个开发者账号
2. 前往后台页面,点击左部导航栏的 **项目 > 项目列表** 菜单
3. 复制后台的 **App ID** 并备注,稍后启动应用时会用到它
4. 在项目页面生成临时 **Access Token** (24小时内有效)并备注,注意生成的Token只能适用于对应的频道名。

5. 将 AppID 填写进 "lib-component/src/main/res/values/strings_config.xml"
```
<string name="private_app_id"><#YOUR APP ID#></string>
<!-- 临时Token 可以在 https://dashboard.agora.io 获取 -->
<!-- 在正式上线生产环境前,你必须部署你自己的Token服务器 -->
<!-- 如果你的项目没有打开安全证书,下面的值可以直接留空 -->
<string name="agora_access_token"><#YOUR TOKEN#></string>
```

### 集成 Agora 视频 SDK

*Demo已默认集成JCenter的方式,可以直接编译运行。*

集成方式有以下两种:
- 通过JCenter集成:
- 在项目对应的模块的 `lib-component/build.gradle` 文件的依赖属性中加入通过 JCenter 自动集成 Agora 视频 SDK 的地址:
```
implementation 'io.agora.rtc:full-sdk:3.0.0'
```
- 手动集成:
-[Agora.io SDK](https://www.agora.io/cn/download/) 下载 **视频通话 + 直播 SDK**并解压,按以下对应关系将 **libs** 目录的内容复制到项目内。

SDK目录|项目目录
---|---
.jar file|**/lib-component/libs** folder
**arm64-v8a** folder|**/lib-component/src/main/jniLibs** folder
**x86** folder|**/lib-component/src/main/jniLibs** folder
**armeabi-v7a** folder|**/lib-component/src/main/jniLibs** folder
- 若需要需要使用C++头文件,可以在解压SDK后将其中的 **libs**/**include** 文件夹下的 ***.h** 复制到本项目的 **lib-component**/**src**/**main**/**cpp**/**agora** 下。


### 启动应用程序

用 Android Studio 打开该项目,连上设备,编译并运行。

也可以使用 `Gradle` 直接编译运行。


## 联系我们

- 如果你遇到了困难,可以先参阅[常见问题](https://docs.agora.io/cn/faq)
- 如果你想了解更多官方示例,可以参考[官方SDK示例](https://github.com/AgoraIO)
- 如果你想了解声网SDK在复杂场景下的应用,可以参考[官方场景案例](https://github.com/AgoraIO-usecase)
- 如果你想了解声网的一些社区开发者维护的项目,可以查看[社区](https://github.com/AgoraIO-Community)
- 完整的 API 文档见 [文档中心](https://docs.agora.io/cn/)
- 若遇到问题需要开发者帮助,你可以到 [开发者社区](https://rtcdeveloper.com/) 提问
- 如果发现了示例代码的 bug,欢迎提交 [issue](https://github.com/AgoraIO/Basic-Video-Call/issues)

## 代码许可

The MIT License (MIT)
2 changes: 1 addition & 1 deletion Android/lib-component/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

api 'io.agora.rtc:full-sdk:2.9.2'
api 'io.agora.rtc:full-sdk:3.0.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
Expand Down
4 changes: 2 additions & 2 deletions Android/lib-component/src/main/res/values/strings_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- PLEASE KEEP THIS App ID IN SAFE PLACE -->
<!-- Get your own App ID at https://dashboard.agora.io/ -->
<!-- After you entered the App ID, remove <##> outside of Your App ID -->
<string name="agora_app_id">ce8673eb931840dbbe7fd3848ebc037f</string>
<string name="agora_app_id"><#YOUR APP ID#></string>
<!-- Obtain a temp Access Token at https://dashboard.agora.io -->
<!-- You will need to deploy your own token server for production release -->
<!-- Leave this value empty if Security keys/Token is not enabled for your project -->
<string name="agora_access_token"></string>
<string name="agora_access_token"><#YOUR ACCESS TOKEN#></string>
</resources>

0 comments on commit 64151f7

Please sign in to comment.