1、声网jar + 下载so开发 基本完成

This commit is contained in:
laopi
2024-09-03 17:16:37 +08:00
parent f5d8b7fed1
commit 09395b152e
5 changed files with 43 additions and 38 deletions

View File

@@ -8,6 +8,7 @@ import android.opengl.EGLContext;
import android.opengl.EGLDisplay;
import android.opengl.EGLSurface;
import android.opengl.GLES20;
import android.os.Build;
import android.util.Log;
import android.view.Surface;
import android.view.TextureView;
@@ -117,8 +118,11 @@ public class SWAuManager extends BaseCacheManager {
if(CommonAppConfig.IS_GOOGLE_PLAY == 0){
//链接包,声网加载下载的 So文件
File file = new File(mContext.getApplicationInfo().dataDir, com.yunbao.common.Constants.DOWNLOAD_SO);
String cpuAbi = "";
cpuAbi = Build.CPU_ABI;
File file = new File(mContext.getDir("lib", Context.MODE_PRIVATE).getAbsoluteFile(), com.yunbao.common.Constants.DOWNLOAD_SO + File.separator + cpuAbi);
config.mNativeLibPath = file.getAbsolutePath();
Log.i("downLoad", "config.mNativeLibPath 1 = " + config.mNativeLibPath);
}
// 创建并初始化 RtcEngine
@@ -143,6 +147,14 @@ public class SWAuManager extends BaseCacheManager {
config.mContext = mContext;
config.mAppId = CommonAppConfig.getSwAppId();
config.mEventHandler = mEventHandler;
if(CommonAppConfig.IS_GOOGLE_PLAY == 0){
//链接包,声网加载下载的 So文件
String cpuAbi = "";
cpuAbi = Build.CPU_ABI;
File file = new File(mContext.getDir("lib", Context.MODE_PRIVATE).getAbsoluteFile(), com.yunbao.common.Constants.DOWNLOAD_SO + File.separator + cpuAbi);
config.mNativeLibPath = file.getAbsolutePath();
Log.i("downLoad", "config.mNativeLibPath 2 = " + config.mNativeLibPath);
}
// 创建并初始化 RtcEngine
mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config);
}

View File

@@ -6,7 +6,9 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import android.view.SurfaceView;
import android.widget.FrameLayout;
@@ -128,6 +130,16 @@ public class SWManager extends BaseCacheManager {
config.mContext = mContext;
config.mAppId = CommonAppConfig.getSwAppId();
config.mEventHandler = mRtcEventHandler;
if(CommonAppConfig.IS_GOOGLE_PLAY == 0){
//链接包,声网加载下载的 So文件
String cpuAbi = "";
cpuAbi = Build.CPU_ABI;
File file = new File(mContext.getDir("lib", Context.MODE_PRIVATE).getAbsoluteFile(), com.yunbao.common.Constants.DOWNLOAD_SO + File.separator + cpuAbi);
config.mNativeLibPath = file.getAbsolutePath();
Log.i("downLoad", "config.mNativeLibPath 2 = " + config.mNativeLibPath);
}
// 创建并初始化 RtcEngine
mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config);
}