集成指南
<p>该文档是对sdk的集成准备工作及一些事项进行说明,一个完整的demo项目请参考开发包中的示例程序PictureBook-demo。</p>
<h3>1. 准备工作</h3>
<p>在使用sdk之前,请联系玩瞳科技索取授权码Key。</p>
<h3>2. 添加SDK到工程</h3>
<p>fingersdk以AndroidStudio开发方式提供,以下介绍在android studio开发工具导入绘本sdk。</p>
<ol>
<li>
<p>拷贝 .aar 文件到项目下的 lib 文件夹;</p>
</li>
<li>
<p>修改 build.gradle 文件,引入aar 文件;</p>
<pre><code class="language-gradle">// 添加依赖:引入第三库文件
allprojects {
repositories {
flatDir {
dirs &#039;libs&#039;
}
google()
}
}
dependencies {
...
// visiontalk
// 新增--start
implementation &#039;androidx.annotation:annotation:1.0.0&#039;
implementation &#039;com.google.android.exoplayer:exoplayer-core:2.10.3&#039;
// 新增--end
implementation &#039;com.android.support:support-annotations:28.0.0&#039;
implementation &#039;com.squareup.retrofit2:retrofit:2.5.0&#039;
implementation &#039;com.squareup.retrofit2:converter-gson:2.5.0&#039;
implementation &#039;com.squareup.retrofit2:adapter-rxjava2:2.5.0&#039;
implementation &#039;io.reactivex.rxjava2:rxjava:2.2.8&#039;
implementation &#039;io.reactivex.rxjava2:rxandroid:2.1.1&#039;
implementation (name: &#039;basesdk-release-1.4.0-20190604095015&#039;, ext: &#039;aar&#039;)
implementation (name: &#039;vtbrsdk-release-1.4.0-20190604095027&#039;, ext: &#039;aar&#039;)
configurations.all {
exclude group: &#039;com.android.support&#039;, module: &#039;support-v13&#039;
}
...
}</code></pre>
</li>
<li>make project;</li>
</ol>
<h3>3. 权限声明</h3>
<table>
<thead>
<tr>
<th>权限名称</th>
<th>用途</th>
</tr>
</thead>
<tbody>
<tr>
<td>android.permission.CAMERA</td>
<td>允许调用相机进行预览和拍照</td>
</tr>
<tr>
<td>android.permission.READ_EXTERNAL_STORAGE</td>
<td>读取sdk所需的文件(数据模型等)</td>
</tr>
<tr>
<td>android.permission.WRITE_EXTERNAL_STORAGE</td>
<td>写入sdk所需的文件(数据模型等)</td>
</tr>
<tr>
<td>android.permission.INTERNET</td>
<td>网络访问,用于license校验、资源包更新下载等操作</td>
</tr>
</tbody>
</table>
<h3>4. 运行Demo示例</h3>
<p>使用 AndroidStudio 打开 demo 项目工程,将玩瞳授予的license.lcs文件中的内容拷贝,赋值BRBaseActivity中的LICENSE变量,Build project 后 run 即可。</p>
<pre><code class="language-java">public class BRBaseActivity {
private static final String LICENSE = &quot;license&quot;;
}</code></pre>
<h2></h2>