|
AnyChat r6454版本优化AnyChat for Java SDK(Win32):
一、提供单例模式接口:- AnyChatCoreSDK.getInstance();
复制代码
二、支持加载指定路径的AnyChat库
通过API接口:anychat.SetSDKOptionString(AnyChatDefine.BRAC_SO_CORESDK_PATH, "dll path");可设置AnyChat库(BRAnyChatCore.dll及其它dll)的加载路径。
设置加载路径后,打包Java应用程序时,只需要将anychatcore4java.dll打包进应用程序,而AnyChat库可放置在其它位置,实现上层应用与AnyChat库之间的解耦,当AnyChat库有更新时,Java应用程序不需要重新打包发布,只需更新指定位置的库文件即可。
示例代码如下:- anychat = AnyChatCoreSDK.getInstance();
- int ret = anychat.SetSDKOptionString(AnyChatDefine.BRAC_SO_CORESDK_PATH, "C:\\Program Files (x86)\\BaiRuiTech\\AnyChatWeb");
- if(ret != 0)
- ret = anychat.SetSDKOptionString(AnyChatDefine.BRAC_SO_CORESDK_PATH, "C:\\Program Files\\BaiRuiTech\\AnyChatWeb");
- if(ret != 0)
- ret = anychat.SetSDKOptionString(AnyChatDefine.BRAC_SO_CORESDK_PATH, "D:\\Program Files (x86)\\BaiRuiTech\\AnyChatWeb");
- if(ret != 0)
- ret = anychat.SetSDKOptionString(AnyChatDefine.BRAC_SO_CORESDK_PATH, "D:\\Program Files\\BaiRuiTech\\AnyChatWeb");
复制代码 |
|