Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ build/
.externalNativeBuild
.cxx
*.codecc/
/build.yml
/build.yml
tui*/
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import com.tencent.liteav.basic.UserModel;
import com.tencent.liteav.basic.UserModelManager;
import com.tencent.liteav.debug.GenerateTestUserSig;
import com.tencent.liteav.trtccalling.model.TRTCCalling;
import com.tencent.liteav.trtccalling.model.impl.TRTCCalling;
import com.tencent.liteav.trtccalling.model.TUICalling;
import com.tencent.liteav.trtccalling.model.impl.TUICallingManager;
import com.tencent.liteav.trtccalling.model.impl.base.CallingInfoManager;
Expand Down Expand Up @@ -84,23 +84,21 @@ private void startCallSomeone() {
bundle.putString(TUICallingConstants.PARAM_NAME_TYPE, TUICallingConstants.TYPE_VIDEO);
bundle.putStringArray(TUICallingConstants.PARAM_NAME_USERIDS, userIDs);
bundle.putString(TUICallingConstants.PARAM_NAME_GROUPID, "");
// TUICore.callService(TUIConstants.Service.TUI_CALLING, TUICallingConstants.METHOD_NAME_CALL, bundle);
TUICallingManager.sharedInstance().call(userIDs, TUICalling.Type.VIDEO);
TUICallingManager.sharedInstance(this).call(userIDs, TUICalling.Type.VIDEO);
} else if (mType == TRTCCalling.TYPE_AUDIO_CALL) {
ToastUtils.showShort(getString(R.string.toast_voice_call, mSearchModel.userName));
String[] userIDs = {mSearchModel.userId};
Bundle bundle = new Bundle();
bundle.putString(TUICallingConstants.PARAM_NAME_TYPE, TUICallingConstants.TYPE_AUDIO);
bundle.putStringArray(TUICallingConstants.PARAM_NAME_USERIDS, userIDs);
bundle.putString(TUICallingConstants.PARAM_NAME_GROUPID, "");
// TUICore.callService(TUIConstants.Service.TUI_CALLING, TUICallingConstants.METHOD_NAME_CALL, bundle);
TUICallingManager.sharedInstance().call(userIDs, TUICalling.Type.AUDIO);
TUICallingManager.sharedInstance(this).call(userIDs, TUICalling.Type.AUDIO);
}
}

private void custom() {
TUICallingManager.sharedInstance().enableCustomViewRoute(true);
TUICallingManager.sharedInstance().setCallingListener(new TUICalling.TUICallingListener() {
TUICallingManager.sharedInstance(this).enableCustomViewRoute(true);
TUICallingManager.sharedInstance(this).setCallingListener(new TUICalling.TUICallingListener() {
@Override
public boolean shouldShowOnCallView() {
return true;
Expand Down Expand Up @@ -336,6 +334,8 @@ public void onFailed(int code, String msg) {
}

private void initData() {
// 初始化calling组件
TUICallingManager.sharedInstance(this);
final UserModel userModel = UserModelManager.getInstance().getUserModel();
V2TIMSDKConfig config = new V2TIMSDKConfig();
config.setLogLevel(V2TIMSDKConfig.V2TIM_LOG_DEBUG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@
import com.blankj.utilcode.util.ToastUtils;
import com.tencent.imsdk.v2.V2TIMCallback;
import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMSDKConfig;
import com.tencent.imsdk.v2.V2TIMSDKListener;
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
import com.tencent.liteav.basic.AvatarConstant;
import com.tencent.liteav.basic.ImageLoader;
import com.tencent.liteav.basic.UserModel;
import com.tencent.liteav.basic.UserModelManager;
import com.tencent.liteav.debug.GenerateTestUserSig;
import com.tencent.qcloud.tuicore.TUILogin;

import java.util.Random;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -139,8 +135,8 @@ private void setProfile() {
@Override
public void onError(int code, String desc) {
Log.e(TAG, "set profile failed errorCode : " + code + " errorMsg : " + desc);
ToastUtils.showLong(getString(R.string.app_toast_failed_to_set, desc));
//头像和昵称设置失败,也可以进入到主界面(头像和昵称都用默认值),不影响功能
ToastUtils.showLong(getString(R.string.app_toast_failed_to_set, desc));
startMainActivity();
finish();
}
Expand Down
5 changes: 2 additions & 3 deletions Android/App/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<string name="app_text_user_name">Username</string>
<string name="app_hint_user_name">Enter a username</string>
<string name="app_tips_user_name">Chinese characters, letters, numbers and underscores, 2 – 20 words</string>
<string name="app_toast_register_success_and_logging_in">Registered successfully</string>
<string name="app_toast_failed_to_set">Failed: %s</string>

<string name="app_custom_name_1">Martijn</string>
<string name="app_custom_name_2">irfan</string>
Expand All @@ -40,7 +42,4 @@
<string name="app_custom_name_10">ivet</string>
<string name="app_custom_name_11">clinton</string>
<string name="app_custom_name_12">virelai</string>

<string name="app_toast_failed_to_set">Failed: %s</string>
<string name="app_toast_register_success_and_logging_in">Registered successfully</string>
</resources>
5 changes: 2 additions & 3 deletions Android/App/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<string name="app_text_user_name">用户名</string>
<string name="app_hint_user_name">请输入用户名</string>
<string name="app_tips_user_name">仅限中文、字母、数字和下划线,2–20个字</string>
<string name="app_toast_register_success_and_logging_in">注册成功</string>
<string name="app_toast_failed_to_set">设置失败: %s</string>

<!--自定义随机登录名-->
<string name="app_custom_name_1">路飞</string>
Expand All @@ -41,7 +43,4 @@
<string name="app_custom_name_10">乔巴</string>
<string name="app_custom_name_11">鸣人</string>
<string name="app_custom_name_12">艾斯</string>

<string name="app_toast_failed_to_set">设置失败: %s</string>
<string name="app_toast_register_success_and_logging_in">注册成功</string>
</resources>
5 changes: 2 additions & 3 deletions Android/App/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<string name="app_text_user_name">Username</string>
<string name="app_hint_user_name">Enter a username</string>
<string name="app_tips_user_name">Chinese characters, letters, numbers and underscores, 2 – 20 words</string>
<string name="app_toast_register_success_and_logging_in">Registered successfully</string>
<string name="app_toast_failed_to_set">Failed: %s</string>

<string name="app_custom_name_1">Martijn</string>
<string name="app_custom_name_2">irfan</string>
Expand All @@ -40,7 +42,4 @@
<string name="app_custom_name_10">ivet</string>
<string name="app_custom_name_11">clinton</string>
<string name="app_custom_name_12">virelai</string>

<string name="app_toast_failed_to_set">Failed: %s</string>
<string name="app_toast_register_success_and_logging_in">Registered successfully</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class GenerateTestUserSig {
* key:url_push 获取RTMP推流地址
* key:url_play_flv 获取FLV播放地址
*/
public static final String URL_FETCH_PUSH_URL = PLACEHOLDER;
public static final String URL_FETCH_PUSH_URL = "PLACEHOLDER";

/**
* 计算签名用的加密密钥,获取步骤如下:
Expand All @@ -67,7 +67,7 @@ public class GenerateTestUserSig {
* 注意:该方案仅适用于调试Demo,正式上线前请将 UserSig 计算代码和密钥迁移到您的后台服务器上,以避免加密密钥泄露导致的流量盗用。
* 文档:https://cloud.tencent.com/document/product/269/32688#Server
*/
private static final String SECRETKEY = PLACEHOLDER;
private static final String SECRETKEY = "PLACEHOLDER";

/**
* 计算 UserSig 签名
Expand Down
49 changes: 26 additions & 23 deletions Android/Source/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion COMPILE_SDK_VERSION as Integer
buildToolsVersion BUILD_TOOLS_VERSION
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion MIN_SDK_VERSION as Integer
targetSdkVersion TARGET_SDK_VERSION as Integer
versionName VERSION_NAME
versionCode VERSION_CODE as Integer
versionName "1.0"
versionCode 1
minSdkVersion 16
targetSdkVersion 26
}

buildTypes {
Expand All @@ -17,26 +17,29 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api "androidx.multidex:multidex:2.0.0"
api "androidx.recyclerview:recyclerview:1.0.0"
api "androidx.appcompat:appcompat:1.0.0"
api "com.google.android.material:material:1.0.0"
api "androidx.constraintlayout:constraintlayout:1.1.3"
api "com.squareup.okhttp3:logging-interceptor:$LOGGING_INTERCEPTOR_VERSION"
api "com.squareup.retrofit2:converter-gson:$CONVERTER_GSON_VERSION"
api "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
api "com.squareup.okhttp3:okhttp:$OKHTTP_VERSION"
api "com.github.bumptech.glide:glide:$GLIDE_VERSION"
api "com.github.ctiao:DanmakuFlameMaster:$DANMAKU_FLAME_MASTER_VERSION"
api "de.hdodenhof:circleimageview:$CIRCLEIMAGEVIEW_VERSION"
api "com.google.code.gson:gson:$GSON_VERSION"
api "com.blankj:utilcode:$UTIL_CODE_VERSION"
api rootProject.ext.liteavSdk
api rootProject.ext.imSdk
api project(':Debug')
api 'androidx.appcompat:appcompat:1.0.0'
api 'androidx.constraintlayout:constraintlayout:1.1.3'
api "com.squareup.okhttp3:logging-interceptor:3.8.1"
api "com.squareup.retrofit2:converter-gson:2.2.0"
api "com.squareup.retrofit2:retrofit:2.2.0"
api "com.squareup.okhttp3:okhttp:3.11.0"
api "com.github.bumptech.glide:glide:4.12.0"
api "com.github.ctiao:DanmakuFlameMaster:0.5.3"
api "de.hdodenhof:circleimageview:3.1.0"
api "com.google.code.gson:gson:2.3.1"
api "com.blankj:utilcode:1.25.9"
api(name: 'LiteAVSDK_Enterprise', ext: 'aar')

api project(':TUICore')
api project(':Debug')

}
Loading