SDK导入
重要提示
1、建议先测试我们Demo,并仔细阅读我们Demo中的集成代码,会对您的对接过程有很大的帮助。
2、集成SDK后,请将集成后的安装包发给我们测试,双方测试通过后APP方能上线并进入售后流程。若没有提供给我方测试将APP上线,造成后果由集成方承担。
3、若需要小能协助测试,要发一封测试申请邮件并附带测试账号和测试安装包给到小能技术支持人员。
4、如需小能方周末提供对接支持,请至少提前一天提出邮件申请,我们好安排加班人员。
AndroidStudio导入小能SDK的步骤如下:
方式一
1)点击File —> New —> Import Module,如下图所示:
2)选中XiaonengChatUI(V3.1.3及后续版本Module更名为"ntalkerChatUI")工程,点击Finish,如下图所示:
3)在APP模块的build.gradle的dependencies中添加compile project(':XiaonengChatUI') - (V3.1.3及后续版本Module更名为"ntalkerChatUI")进行关联
4)在主工程的清单文件AndroidManifest.xml里加入配置,具体配置请查看下面的AndroidManifest配置信息
方式二
1)解压小能提供的Demo压缩包,将xiaonengChatUI(V3.1.3及后续版本Module更名为"ntalkerChatUI")的module完整复制到主项目中
2)在 settings.gradle 中添加include ':xiaonengChatUI'(V3.1.3及后续版本Module更名为"ntalkerChatUI")
3)在APP模块的build.gradle的dependencies中添加 compile project(':xiaonengChatUI') 或implementation project(':xiaonengChatUI'),进行关联(V3.1.3及后续版本Module更名为"ntalkerChatUI")
4)在主工程的清单文件AndroidManifest.xml里加入配置,具体配置请查看下面的AndroidManifest配置信息
【重要】AndroidManifest配置信息
1)在您的清单文件AndroidManifest.xml里加入以下权限的配置。注意:不要与已有的权限冲突。
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
2)在您的清单文件AndroidManifest.xml里加入以下Activity的配置。
V3.1.3及后续版本:
<activity
android:name="cn.ntalker.newchatwindow.ChatActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/XNAppTheme"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="${packageName}.chatwindow" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="cn.ntalker.leavemsg.LeaveMsgActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme"
android:windowSoftInputMode="adjustPan|adjustResize">
<intent-filter>
<action android:name="${packageName}.leaveactivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="cn.ntalker.album.ShowAlbumActivity"
android:screenOrientation="portrait"
android:theme="@style/XNAppTheme" />
<activity
android:name="cn.ntalker.evaluation.EvaluationActivity"
android:launchMode="singleTask"
android:theme="@style/translucent" />
<activity
android:name="cn.ntalker.picture.ShowPictureActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/XNAppTheme" />
<activity
android:name="cn.ntalker.picture.ShowPictureListActivity"
android:launchMode="singleTask"
android:theme="@style/AppTheme.FullScreen" />
<activity
android:name="cn.ntalker.nsettings.NtSettingsActivity"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme" />
<activity
android:name="cn.ntalker.popHyper.PopHyperActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/hyperpopstyle">
<intent-filter>
<action android:name="${packageName}.popHyper" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="cn.ntalker.nsettings.NtWindowSettings"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme" />
<activity
android:name="cn.ntalker.utils.common.XNExplorerActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/XNAppTheme">
<intent-filter>
<action android:name="${packageName}.exploreactivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="cn.ntalker.video.RecordVideoActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme" />
<activity
android:name="cn.ntalker.video.XNVideoPlayer"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme" />
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${packageName}.fileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/nt_file_paths" />
</provider>
V3.1.2及以前版本:
<activity
android:name="cn.xiaoneng.newchatwindow.ChatActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/XNAppTheme"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="${packageName}.chatwindow" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="cn.xiaoneng.leavemsg.LeaveMsgActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme"
android:windowSoftInputMode="adjustPan|adjustResize">
<intent-filter>
<action android:name="${packageName}.leaveactivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="cn.xiaoneng.album.ShowAlbumActivity"
android:theme="@style/XNAppTheme"
android:screenOrientation="portrait" />
<activity
android:name="cn.xiaoneng.valuation.ValuationActivity"
android:launchMode="singleTask"
android:theme="@style/translucent" />
<activity
android:name="cn.xiaoneng.picture.ShowPictureActivity"
android:launchMode="singleTask"
android:theme="@style/XNAppTheme"
android:screenOrientation="portrait" />
<activity
android:name="cn.xiaoneng.nsettings.NtSettingsActivity"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme" />
<activity
android:name="cn.xiaoneng.nsettings.NtWindowSettings"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme" />
<activity
android:name="cn.xiaoneng.utils.common.XNExplorerActivity"
android:launchMode="singleTask"
android:theme="@style/XNAppTheme"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="${packageName}.exploreactivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="cn.xiaoneng.video.VideoPreviewActivity"
android:theme="@style/XNAppTheme"
android:screenOrientation="portrait" />
<activity
android:name="cn.xiaoneng.video.RecordVideoActivity"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme" />
<activity
android:name="cn.xiaoneng.video.XNVideoPlayer"
android:screenOrientation="portrait"
android:theme="@style/BlueBarTheme" />
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${packageName}.fileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/nt_file_paths" />
</provider>