提交 47b14e56 authored 作者: 汪显鹏's avatar 汪显鹏

瞩目SDK 第一次提交

上级 64125669
流水线 #228 已取消 于阶段
# Created by .ignore support plugin (hsz.mobi)
#它主要的写法规则为:"#"表示注释,"*"表示通配符,可多个,"/"表示目录,
#"!"表示不忽略匹配到的文件或目录,"?"表示通配单个字符,"[]"表示包含单个字符的匹配列表。
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/captures
.idea
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# Intellij
*.iml
# Keystore files
*.jks
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
maven { url 'https://maven.google.com' }
jcenter()
google()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.android.sdkexample"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'progua rd-rules.txt'
}
}
/*compileOptions {
encoding "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}*/
}
dependencies {
implementation 'com.android.support:support-v4:27.1.0'
implementation project(':zhumucommonlib')
implementation project(':zhumumobilertc')
implementation project(':zhumusdk')
implementation 'org.xutils:xutils:3.1.24'
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.6'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
implementation 'com.amitshekhar.android:rx2-android-networking:1.0.0'
implementation 'commons-codec:commons-codec:20041127.091804'
implementation 'com.android.support:multidex:1.0.2'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.sdkexample"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
<uses-sdk android:targetSdkVersion="23"/>
<uses-feature android:glEsVersion="0x00020000"/>
<!--
Commented content should be opened if your ADT version is lower than v20,
or you remove the "manifestmerger.enabled=true" from project.properties
-->
<!--
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<permission android:name="com.android.sdkexample.permission.KUBI_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.android.sdkexample.permission.KUBI_MESSAGE" />
<application
android:label="@string/this_app_name"
android:icon="@drawable/ic_launcher">
<activity android:name=".MainActivity"
android:label="@string/this_app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/ZMTheme.MainWindow" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MyInviteActivity"
android:label="@string/invite_acitivity_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/ZMTheme.MainWindow" >
<intent-filter>
<action android:name="com.android.sdkexample.intent.action.MeetingInvite" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".MyWaitJoinActivity"
android:icon="@drawable/ic_launcher"
android:theme="@style/ZMTheme.MainWindow" >
<intent-filter>
<action android:name="com.android.sdkexample.intent.action.JoinBeforeHost" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".MyCallMeByPhoneActivity"
android:icon="@drawable/ic_launcher"
android:theme="@style/ZMTheme.MainWindow" >
<intent-filter>
<action android:name="com.android.sdkexample.intent.action.CallMyPhone" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.dropbox.client2.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:theme="@style/ZMTheme.SubWindow"
android:launchMode="singleTask" >
<intent-filter>
<!-- Change this to be db- followed by your app key -->
<data android:scheme="db-YourAppKey" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!--
Commented content should be opened if your ADT version is lower than v20,
or you remove the "manifestmerger.enabled=true" from project.properties
-->
<!--
<activity
android:name="com.zipow.videobox.JoinByURLActivity"
android:launchMode="singleTask"
android:theme="@style/ZMTheme.Transparent" />
<activity
android:name="com.zipow.videobox.IntegrationActivity"
android:configChanges="orientation|screenSize"
android:launchMode="singleTask"
android:theme="@style/ZMTheme.Transparent" />
<activity
android:name="com.zipow.videobox.MeetingEndMessageActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZMDialog.Transparent" />
<activity
android:name="com.zipow.videobox.ConfActivityNormal"
android:configChanges="orientation|screenSize"
android:hardwareAccelerated="false"
android:theme="@style/ZMTheme.SubWindow"
android:process=":zoom_meeting" />
<activity
android:name="com.zipow.videobox.PListActivity"
android:configChanges="orientation|screenSize"
android:hardwareAccelerated="false"
android:theme="@style/ZMTheme.SubWindow"
android:process=":zoom_meeting" />
<activity
android:name="com.zipow.videobox.ConfChatActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZMTheme.SubWindow"
android:process=":zoom_meeting" />
<activity
android:name="com.zipow.videobox.MeetingRunningInfoActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZMTheme.SubWindow"
android:process=":zoom_meeting" />
<activity
android:name="com.zipow.videobox.CallInActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZMTheme.SubWindow"
android:process=":zoom_meeting" />
<activity
android:name="com.zipow.videobox.SimpleActivity"
android:configChanges="orientation|screenSize"
android:windowSoftInputMode="stateHidden|adjustResize"
android:theme="@style/ZMTheme.SubWindow" />
<activity
android:name="com.zipow.videobox.SimpleInMeetingActivity"
android:configChanges="orientation|screenSize"
android:windowSoftInputMode="stateHidden|adjustResize"
android:theme="@style/ZMTheme.SubWindow"
android:process=":zoom_meeting" />
<activity
android:name="com.zipow.videobox.poll.PollingActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZMTheme.SubWindow" />
<activity
android:name="com.zipow.videobox.poll.WebinarPollingActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZMTheme.SubWindow"
android:process=":zoom_meeting" />
<activity
android:name="com.zipow.videobox.poll.PollingResultActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZMTheme.SubWindow" />
<activity
android:name="com.zipow.videobox.poll.WebinarPollingResultActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZMTheme.SubWindow"
android:process=":zoom_meeting" />
<activity
android:name="us.zoom.androidlib.app.ZMFileListActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/ZMTheme.SubWindow" />
<service android:name="com.zipow.videobox.PTService" />
<service android:name="com.zipow.videobox.ConfService" android:process=":zoom_meeting" />
-->
</application>
</manifest>
package com.android.sdkexample;
public interface Constants {
public final static String url = "https://api.zhumu.me/v3/user/get";
public final static String API_KEY = "9993779D06833B0CE3A5F8308B07DD59";
public final static String API_SECRET = "DB07FC37CC7782E70D3D86CA171B8EB5";
public final static String API_LOGINTYPE= "";
public final static String API_LOGINNAME = "";
/**
* 如果sdk 初始化失败,请询问相关人员 找到 [ WEB_DOMAIN ,APP_KEY, APP_SECRET ]的值,并设置
*/
public final static String WEB_DOMAIN = "launcher.zhumu.me";
public final static String APP_KEY = "xoqzRRVy4dpUIxabbTvayKBzRV0VBFhrxFqy";
public final static String APP_SECRET = "v4Z7o4ds8A9UUGSOs7bXLOlNrAkoByfWHQlF";
// TODO Change it to your Dropbox APP Key to enable "Share Dropbox"
public final static String DROPBOX_APP_KEY = null;
// TODO Change it to your Dropbox APP Secret to enable "Share Dropbox"
public final static String DROPBOX_APP_SECRET = null;
// TODO Change it to your OneDrive client ID to enable "Share OneDrive"
public final static String ONEDRIVE_CLIENT_ID = null;
}
package com.android.sdkexample;
import android.util.Log;
/**
*/
public final class Logs {
private int debugType = DebugType.V;
public static final class DebugType {
public static final int V = 0;
public static final int D = 1;
public static final int I = 2;
public static final int W = 3;
public static final int E = 4;
public static final int N = 5; // close all debug info
}
private String TAG = "";
public Logs(String TAG) {
this.TAG = TAG;
}
public Logs(String TAG, int debugType){
this.TAG = TAG;
this.debugType = debugType;
}
public void D(String s) {
if (debugType <= DebugType.D) {
Log.d(TAG, s);
}
}
public void E(String s) {
if (debugType <= DebugType.E) {
Log.e(TAG, s);
}
}
public void I(String s) {
if (debugType <= DebugType.I) {
Log.i(TAG, s);
}
}
public void W(String s) {
if (debugType <= DebugType.W) {
Log.w(TAG, s);
}
}
public void V(String s) {
if (debugType <= DebugType.V) {
Log.v(TAG, s);
}
}
}
package com.android.sdkexample;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.suirui.zhumu.ZHUMUError;
import com.suirui.zhumu.ZHUMUInMeetingService;
import com.suirui.zhumu.ZHUMUInMeetingServiceListener;
import com.suirui.zhumu.ZHUMUInstantMeetingOptions;
import com.suirui.zhumu.ZHUMUInviteOptions;
import com.suirui.zhumu.ZHUMUJoinMeetingOptions;
import com.suirui.zhumu.ZHUMUJoinMeetingParams;
import com.suirui.zhumu.ZHUMUMeetingService;
import com.suirui.zhumu.ZHUMUMeetingServiceListener;
import com.suirui.zhumu.ZHUMUMeetingSettingsHelper;
import com.suirui.zhumu.ZHUMUMeetingStatus;
import com.suirui.zhumu.ZHUMUSdk;
import com.suirui.zhumu.ZHUMUSdkAuthenticationListener;
import com.suirui.zhumu.ZHUMUSdkInitializeListener;
import com.suirui.zhumu.ZHUMUStartMeetingOptions;
import com.suirui.zhumu.ZHUMUStartMeetingParamsWithoutLogin;
import com.zipow.videobox.ptapp.PTApp;
import org.json.JSONObject;
import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.x;
import java.util.List;
import us.zoom.sdk.InMeetingAudioController;
import us.zoom.sdk.InMeetingChatMessage;
import us.zoom.sdk.InMeetingEventHandler;
import us.zoom.sdk.JoinMeetingParams;
import us.zoom.sdk.MeetingStatus;
import us.zoom.sdk.StartMeetingParamsWithoutLogin;
public class MainActivity extends Activity implements Constants, ZHUMUSdkInitializeListener, ZHUMUMeetingServiceListener {
private final static String TAG = MainActivity.class.getName();
private EditText mEdtMeetingNo;
private EditText mEdtMeetingPassword;
//瞩目用户名
private EditText edtZhumuUsername;
//瞩目密码
private EditText edtZhumuPassword;
private final static int STYPE = ZHUMUMeetingService.USER_TYPE_API_USER;
private final static String DISPLAY_NAME = "ZHUMU SDK";
private boolean mbPendingStartMeeting = false;
public static String user_id = "";
public static String token = "";
public static String user_name = "";
public static String meet_num = "";
private Meeting mMeeting;
Handler mHandler = new Handler();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.i(TAG, "onCreate()");
mEdtMeetingNo = (EditText) findViewById(R.id.edtMeetingNo);
mEdtMeetingPassword = (EditText) findViewById(R.id.edtMeetingPassword);
edtZhumuUsername = (EditText) findViewById(R.id.edtZhumuUsername);
edtZhumuPassword = (EditText) findViewById(R.id.edtZhumuPassword);
x.Ext.init(this.getApplication());
RequestParams params = new RequestParams(Constants.url);
params.addBodyParameter("api_key", Constants.API_KEY);
params.addBodyParameter("api_secret", Constants.API_SECRET);
params.addBodyParameter("logintype", Constants.API_LOGINTYPE);
params.addBodyParameter("loginname", Constants.API_LOGINNAME);
x.http().post(params, new Callback.CommonCallback<String>() {
@Override
public void onSuccess(String s) {
Log.e("MainActivity", "服务器返回结果:" + s);
mMeeting = getMeeting(s);
if (mMeeting != null) {
user_id = mMeeting.getId();
token = mMeeting.getToken();
user_name = mMeeting.getUsername();
meet_num = mMeeting.getPmi();
mHandler.post(new Runnable() {
//
@Override
public void run() {
mEdtMeetingNo.setText(meet_num);
}
});
} else {
//log.W("onCreate():--mMeeting is null !!!");
}
//
}
//
@Override
public void onError(Throwable throwable, boolean b) {
Log.e("MainActivity", "onError:");
}
@Override
public void onCancelled(CancelledException e) {
Log.e("MainActivity", "onCancelled():");
}
@Override
public void onFinished() {
Log.e("MainActivity", "onFinished():meet_num:" + meet_num);
}
});
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if (!sdk.isInitialized()) {
sdk.initSDK(this, APP_KEY, APP_SECRET, WEB_DOMAIN, this);
}
// if(savedInstanceState == null) {
// } else {
// registerMeetingServiceListener();
// }
}
private void registerMeetingServiceListener() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if (meetingService != null) {
meetingService.addListener(this);
}
}
@Override
public void onZHUMUSdkInitializeResult(int errorCode, int internalErrorCode) {
Log.i(TAG, "onZHUMUSdkInitializeResult, errorCode=" + errorCode + ", internalErrorCode=" + internalErrorCode);
if (errorCode != ZHUMUError.ERROR_SUCCESS) {
Toast.makeText(this, "Failed to initialize ZHUMUSDK. Error: " + errorCode + ", internalErrorCode=" + internalErrorCode, Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Initialize ZHUMUSDK successfully.", Toast.LENGTH_LONG).show();
registerMeetingServiceListener();
}
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
sdk.setDomain(WEB_DOMAIN);
String domain = PTApp.getInstance().getZoomDomain();
Log.e("domain", domain);
}
@Override
protected void onDestroy() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if (sdk.isInitialized()) {
ZHUMUMeetingService meetingService = sdk.getMeetingService();
meetingService.removeListener(this);
}
super.onDestroy();
}
public void onClickBtnJoinMeeting(View view) {
String meetingNo = mEdtMeetingNo.getText().toString().trim();
String meetingPassword = mEdtMeetingPassword.getText().toString().trim();
if (meetingNo.length() == 0) {
Toast.makeText(this, "You need to enter a meeting number which you want to join.", Toast.LENGTH_LONG).show();
return;
}
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
ZHUMUInMeetingService service = sdk.getInMeetingService();
service.addListener(new ZHUMUInMeetingServiceListener() {
@Override
public void onMeetingUserJoin(List<Long> list) {
}
@Override
public void onMeetingUserLeave(List<Long> list) {
}
@Override
public void onMeetingUserUpdated(long l) {
}
@Override
public void onMeetingHostChanged(long l) {
}
@Override
public void onSpotlightVideoChanged(boolean b) {
}
@Override
public void onUserVideoStatusChanged(long l) {
}
@Override
public void onUserAudioStatusChanged(long l) {
}
@Override
public void onUserAudioTypeChanged(long l) {
}
@Override
public void onLowOrRaiseHandStatusChanged(long l, boolean b) {
}
@Override
public void onMeetingReady() {
}
@Override
public void onMeetingNeedWaitHost() {
}
@Override
public void onMeetingReadyToJoin() {
}
@Override
public void onMeetingNeedPasswordOrDisplayName(boolean b, boolean b1, InMeetingEventHandler inMeetingEventHandler) {
}
@Override
public void onWebinarNeedRegister() {
}
@Override
public void onJoinWebinarNeedUserNameAndEmail(InMeetingEventHandler inMeetingEventHandler) {
}
@Override
public void onMeetingNeedColseOtherMeeting(InMeetingEventHandler inMeetingEventHandler) {
}
@Override
public void onMeetingFail(int i, int i1) {
}
@Override
public void onMeetingLeaveComplete(long l) {
}
@Override
public void onMeetingCoHostChanged(long l) {
}
@Override
public void onMicrophoneStatusError(InMeetingAudioController.MobileRTCMicrophoneError mobileRTCMicrophoneError) {
}
@Override
public void onMyAudioSourceTypeChanged(int i) {
}
@Override
public void onMeetingSecureKeyNotification(byte[] bytes) {
}
@Override
public void onChatMessageReceived(InMeetingChatMessage inMeetingChatMessage) {
//收到聊天消息
Log.e("收到消息", inMeetingChatMessage.getContent());
}
});
if (!sdk.isInitialized()) {
Toast.makeText(this, "ZHUMUSDK has not been initialized successfully", Toast.LENGTH_LONG).show();
return;
}
ZHUMUMeetingService meetingService = sdk.getMeetingService();
ZHUMUJoinMeetingOptions opts = new ZHUMUJoinMeetingOptions();
// opts.no_driving_mode = true;
opts.no_invite = true;
// opts.no_meeting_end_message = true;
// opts.no_titlebar = true;
// opts.no_bottom_toolbar = true;
// opts.no_dial_in_via_phone = true;
// opts.no_dial_out_to_phone = true;
opts.no_disconnect_audio = true;
// opts.no_share = true;
// opts.invite_options = ZHUMUInviteOptions.INVITE_VIA_EMAIL + ZHUMUInviteOptions.INVITE_VIA_SMS;
// opts.meeting_views_options = ZHUMUMeetingViewsOptions.NO_BUTTON_SHARE;
opts.no_audio = false;
opts.no_video = false;
// opts.no_meeting_error_message = true;
// opts.participant_id = "participant id";
JoinMeetingParams params = new JoinMeetingParams();
params.displayName = "zhumusdk";
params.meetingNo = meetingNo;
int ret = meetingService.joinMeetingWithParams(this,params);
// int ret = meetingService.joinMeeting(this, meetingNo, DISPLAY_NAME, meetingPassword, opts);
Log.i(TAG, "onClickBtnJoinMeeting, ret=" + ret);
}
public void onClickBtnStartMeeting(View view) {
String meetingNo = mEdtMeetingNo.getText().toString().trim();
if (meetingNo.length() == 0) {
Toast.makeText(this, "You need to enter a scheduled meeting number.", Toast.LENGTH_LONG).show();
return;
}
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if (!sdk.isInitialized()) {
Toast.makeText(this, "ZHUMUSDK has not been initialized successfully", Toast.LENGTH_LONG).show();
return;
}
final ZHUMUMeetingService meetingService = sdk.getMeetingService();
meetingService.addListener(new ZHUMUMeetingServiceListener() {
@Override
public void onMeetingStatusChanged(MeetingStatus meetingStatus, int i, int i1) {
Log.e("meetingstatus", "" + meetingStatus);
}
});
if (meetingService.getMeetingStatus().equals(ZHUMUMeetingStatus.MEETING_STATUS_IDLE)) {
long lMeetingNo = 0;
try {
lMeetingNo = Long.parseLong(meetingNo);
} catch (NumberFormatException e) {
Toast.makeText(this, "Invalid meeting number: " + meetingNo, Toast.LENGTH_LONG).show();
return;
}
if (meetingService.getCurrentRtcMeetingNumber() == lMeetingNo) {
meetingService.returnToMeeting(this);
return;
}
new AlertDialog.Builder(this)
.setMessage("Do you want to leave current meeting and start another?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mbPendingStartMeeting = true;
meetingService.leaveCurrentMeeting(false);
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
})
.show();
return;
}
ZHUMUStartMeetingOptions opts = new ZHUMUStartMeetingOptions();
// opts.no_driving_mode = true;
opts.no_invite = true;
// opts.no_meeting_end_message = true;
// opts.no_titlebar = true;
// opts.no_bottom_toolbar = true;
// opts.no_dial_in_via_phone = true;
// opts.no_dial_out_to_phone = true;
opts.no_disconnect_audio = true;
// opts.no_share = true;
opts.invite_options = ZHUMUInviteOptions.INVITE_ENABLE_ALL;
// opts.meeting_views_options = ZHUMUMeetingViewsOptions.NO_BUTTON_SHARE + ZHUMUMeetingViewsOptions.NO_BUTTON_VIDEO;
opts.no_audio = false;
opts.no_video = false;
// opts.no_meeting_error_message = true;
int ret = meetingService.startMeeting(this, user_id, token, STYPE, meetingNo, DISPLAY_NAME, opts);
// int ret1 =meetingService.startInstantMeeting(this);
/*ZHUMUStartMeetingParams4NormalUser params = new ZHUMUStartMeetingParams4NormalUser();
params.meetingNo = meetingNo;
int ret = meetingService.startMeetingWithParams(this, params, opts);*/
ZHUMUStartMeetingParamsWithoutLogin params = new ZHUMUStartMeetingParamsWithoutLogin();
params.userId = user_id;
params.zoomToken = token;
params.userType = STYPE;
params.displayName = DISPLAY_NAME;
params.meetingNo = meetingNo;
ret = meetingService.startMeetingWithParams(this, params, opts);
Log.i(TAG, "onClickBtnStartMeeting, ret=" + ret);
}
private Meeting getMeeting(String strResult) {
try {
JSONObject jsonObject = new JSONObject(strResult.toString());
int code = jsonObject.getInt("code");
int zcode = jsonObject.getInt("zcode");
String id = jsonObject.getString("id");// User_id
String username = jsonObject.getString("username");
String mobile = jsonObject.getString("mobile");
int usertype = jsonObject.getInt("usertype");
String det = jsonObject.getString("det");
String createtime = jsonObject.getString("createtime");
String createby = jsonObject.getString("createby");
String pmi = jsonObject.getString("pmi");
int role = jsonObject.getInt("role");
String email = jsonObject.getString("email");
int isowner = jsonObject.getInt("isowner");
int accounttype = jsonObject.getInt("accounttype");
String token = jsonObject.getString("token");
Meeting meet = new Meeting();
meet.setCode(code);
meet.setZcode(zcode);
meet.setId(id);
meet.setUsername(username);
meet.setMobile(mobile);
meet.setUsertype(usertype);
meet.setDet(det);
meet.setCreatetime(createtime);
meet.setCreateby(createby);
meet.setPmi(pmi);
meet.setRole(role);
meet.setEmail(email);
meet.setIsowner(isowner);
meet.setAccounttype(accounttype);
meet.setToken(token);
return meet;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public void onclickLogin(View view) {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if (!sdk.isInitialized()) {
sdk.initSDK(this, APP_KEY, APP_SECRET, WEB_DOMAIN, this);
}
sdk.addZhuMuAuthenticationListener(new ZHUMUSdkAuthenticationListener() {
@Override
public void onZhuMuSDKLoginResult(long l) {
Log.e("resultCode", "login" + l);
}
@Override
public void onZhuMuSDKLogoutResult(long l) {
Log.e("resultCode", "logout" + l);
}
});
sdk.addZhuMuAuthenticationListener(new ZHUMUSdkAuthenticationListener() {
@Override
public void onZhuMuSDKLoginResult(long l) {
Log.e("ZhuMuSDKLoginResult", "code:" + l);
}
@Override
public void onZhuMuSDKLogoutResult(long l) {
Log.e("onZhuMuSDKLogoutResult", "code:" + l);
}
});
int ret = sdk.zmlogin(edtZhumuUsername.getText().toString(), edtZhumuPassword.getText().toString());
Log.e("ret", "rtddr" + ret);
}
/**
* @param view 登录用户启动即时会
*/
public void onclickStartInstantMeeting(View view) {
if(!ZHUMUSdk.getInstance().isLoggedIn()){
Toast.makeText(this, "only loged in user", Toast.LENGTH_SHORT).show();
}
ZHUMUInstantMeetingOptions opts = new ZHUMUInstantMeetingOptions();
opts.no_driving_mode = true;
ZHUMUSdk sdk1 = ZHUMUSdk.getInstance();
ZHUMUMeetingService meetingservice1 = sdk1.getMeetingService();
int ret = meetingservice1.startInstantMeeting(MainActivity.this, opts);
meetingservice1.addListener(new ZHUMUMeetingServiceListener() {
@Override
public void onMeetingStatusChanged(MeetingStatus meetingStatus, int i, int i1) {
Log.e("meetingStatus", "status = " + meetingStatus);
}
});
Log.e("code", "code=" + ret);
}
@Override
public void onMeetingStatusChanged(MeetingStatus meetingStatus, int i, int i1) {
}
}
package com.android.sdkexample;
import java.io.Serializable;
public class Meeting implements Serializable {
private int code;
private int zcode;
private String id;
private String username;
private String mobile;
private int usertype;
private String det;
private String createtime;
private String createby;
private String pmi;
private int role;
private String email;
private int isowner;
private int accounttype;
private String token;
public void setCode(int code) {
this.code = code;
}
public int getCode() {
return this.code;
}
public void setZcode(int zcode) {
this.zcode = zcode;
}
public int getZcode() {
return this.zcode;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return this.id;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getMobile() {
return this.mobile;
}
public void setUsername(String username) {
this.username = username;
}
public String getUsername() {
return this.username;
}
public void setUsertype(int usertype) {
this.usertype = usertype;
}
public int getUsertype() {
return this.usertype;
}
public void setDet(String det) {
this.det = det;
}
public String getDet() {
return this.det;
}
public void setCreatetime(String createtime) {
this.createtime = createtime;
}
public String getCreatetime() {
return this.createtime;
}
public void setCreateby(String createby) {
this.createby = createby;
}
public String getCreateby() {
return this.createby;
}
public void setPmi(String pmi) {
this.pmi = pmi;
}
public String getPmi() {
return this.pmi;
}
public void setRole(int role) {
this.role = role;
}
public int getRole() {
return this.role;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return this.email;
}
public void setIsowner(int isowner) {
this.isowner = isowner;
}
public int getIsowner() {
return this.isowner;
}
public void setAccounttype(int accounttype) {
this.accounttype = accounttype;
}
public int getAccounttype() {
return this.accounttype;
}
public void setToken(String token) {
this.token = token;
}
public String getToken() {
return this.token;
}
}
\ No newline at end of file
package com.android.sdkexample;
import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
/**
* Created by liyh on 2017/11/29.
*/
public class MyApplication extends Application {
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(newBase);
MultiDex.install(this);
}
}
package com.android.sdkexample;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.suirui.zhumu.ZHUMUDialOutStatus;
import com.suirui.zhumu.ZHUMUDialOutStatusListener;
import com.suirui.zhumu.ZHUMUMeetingService;
import com.suirui.zhumu.ZHUMUSdk;
public class MyCallMeByPhoneActivity extends Activity implements View.OnClickListener, ZHUMUDialOutStatusListener {
private static final String TAG = MyCallMeByPhoneActivity.class.getSimpleName();
private Button mBtnCall;
private Button mBtnHangup;
private EditText mEdtPhoneNumber;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.call_me_activity);
mEdtPhoneNumber = (EditText)findViewById(R.id.edtPhoneNumber);
mBtnCall = (Button)findViewById(R.id.btnCall);
mBtnCall.setOnClickListener(this);
mBtnHangup = (Button)findViewById(R.id.btnHangUp);
mBtnHangup.setOnClickListener(this);
initButtons();
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if(meetingService != null) {
meetingService.addDialOutListener(this);
}
}
@Override
public void onDialOutStatusChanged(int status) {
Log.d(TAG, "onDialOutStatusChanged status = " + status);
if(status == ZHUMUDialOutStatus.DIALOUT_STATUS_JOIN_SUC) {
finish();
}
updateButtons(status);
}
@Override
public void onClick(View arg0) {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if(arg0.getId() == R.id.btnCall) {
if(meetingService != null) {
String number = mEdtPhoneNumber.getText().toString().trim();
meetingService.dialOutUser(number, null, true);
}
} else if(arg0.getId() == R.id.btnHangUp) {
meetingService.cancelDialOut(true);
}
}
private void initButtons() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if(meetingService != null && meetingService.isDialOutInProgress()) {
mBtnCall.setEnabled(false);
mBtnHangup.setEnabled(true);
} else {
mBtnCall.setEnabled(true);
mBtnHangup.setEnabled(false);
}
}
private void updateButtons(int status) {
switch(status) {
case ZHUMUDialOutStatus.DIALOUT_STATUS_UNKNOWN:
case ZHUMUDialOutStatus.DIALOUT_STATUS_CANCEL_CALL_FAIL:
case ZHUMUDialOutStatus.DIALOUT_STATUS_CALL_CANCELED:
case ZHUMUDialOutStatus.DIALOUT_STATUS_BUSY:
case ZHUMUDialOutStatus.DIALOUT_STATUS_NOT_AVAILABLE:
case ZHUMUDialOutStatus.DIALOUT_STATUS_USER_HANGUP:
case ZHUMUDialOutStatus.DIALOUT_STATUS_OTHER_FAIL:
case ZHUMUDialOutStatus.DIALOUT_STATUS_TIMEOUT:
mBtnCall.setEnabled(true);
mBtnHangup.setEnabled(false);
break;
case ZHUMUDialOutStatus.DIALOUT_STATUS_CALLING:
case ZHUMUDialOutStatus.DIALOUT_STATUS_RINGING:
case ZHUMUDialOutStatus.DIALOUT_STATUS_ACCEPTED:
case ZHUMUDialOutStatus.DIALOUT_STATUS_JOIN_SUC:
mBtnCall.setEnabled(false);
mBtnHangup.setEnabled(true);
break;
case ZHUMUDialOutStatus.DIALOUT_STATUS_START_CANCEL_CALL:
mBtnCall.setEnabled(false);
mBtnHangup.setEnabled(false);
break;
}
}
@Override
protected void onDestroy() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if(sdk.isInitialized()) {
ZHUMUMeetingService meetingService = sdk.getMeetingService();
meetingService.removeDialOutListener(this);
}
super.onDestroy();
}
}
package com.android.sdkexample;
import us.zoom.androidlib.util.AndroidAppUtil;
import com.android.sdkexample.R;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;
/**
此为自定义界面
* 视频界面 点击‘参与者’中‘邀请’ 弹出的界面,
*
*
* 在 res/values/config.xml 中配置
*
* 修改为‘true’
* <bool name="zm_config_invite_by_only_action_meeting_invite">true</bool>
*
*
* 修改为当前项目的包名:
Invitation content generator class. It must implement com.zipow.videobox.util.InviteContentGenerator
<string name="zm_config_invite_content_generator">suirui.zhumu.sdkexample.MyInviteContentGenerator</string>
*
*
*/
public class MyInviteActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.invite_activity);
TextView txtUrl = (TextView)findViewById(R.id.txtUrl);
TextView txtSubject = (TextView)findViewById(R.id.txtSubject);
TextView txtMeetingId = (TextView)findViewById(R.id.txtMeetingId);
TextView txtPassword = (TextView)findViewById(R.id.txtPassword);
TextView txtRawPassword = (TextView)findViewById(R.id.txtRawPassword);
EditText edtText = (EditText)findViewById(R.id.edtText);
Intent intent = getIntent();
Uri uri = intent.getData();
if(uri != null)
txtUrl.setText("URL:" + uri.toString());
String subject = intent.getStringExtra(AndroidAppUtil.EXTRA_SUBJECT);
if(subject != null)
txtSubject.setText("Subject: " + subject);
long meetingId = intent.getLongExtra(AndroidAppUtil.EXTRA_MEETING_ID, 0);
if(meetingId > 0)
txtMeetingId.setText("Meeting ID: " + meetingId);
String meetingPassword = intent.getStringExtra(AndroidAppUtil.EXTRA_MEETING_PSW);
if(meetingPassword != null)
txtPassword.setText("Password: " + meetingPassword);
String meetingRawPassword = intent.getStringExtra(AndroidAppUtil.EXTRA_MEETING_RAW_PSW);
if(meetingRawPassword != null)
txtRawPassword.setText("Raw Password: " + meetingRawPassword);
String text = intent.getStringExtra(AndroidAppUtil.EXTRA_TEXT);
if(text != null)
edtText.setText(text);
}
}
package com.android.sdkexample;
import android.content.Context;
import com.zipow.videobox.util.InviteContentGenerator;
public class MyInviteContentGenerator implements InviteContentGenerator {
@Override
public String genEmailTopic(Context context, long meetingId, String meetingUrl,
String myName, String password, String rawPassword) {
// TODO Auto-generated method stub
return null;
}
@Override
public String genEmailContent(Context context, long meetingId,
String meetingUrl, String myName, String password, String rawPassword) {
// TODO Auto-generated method stub
return null;
}
@Override
public String genSmsContent(Context context, long meetingId,
String meetingUrl, String myName, String password, String rawPassword) {
// TODO Auto-generated method stub
return null;
}
@Override
public String genCopyUrlText(Context context, long meetingId,
String meetingUrl, String myName, String password, String rawPassword) {
// TODO Auto-generated method stub
return null;
}
}
package com.android.sdkexample;
import us.zoom.androidlib.util.AndroidAppUtil;
import us.zoom.sdk.MeetingStatus;
import com.android.sdkexample.R;
import com.suirui.zhumu.ZHUMUMeetingEvent;
import com.suirui.zhumu.ZHUMUMeetingService;
import com.suirui.zhumu.ZHUMUMeetingServiceListener;
import com.suirui.zhumu.ZHUMUMeetingStatus;
import com.suirui.zhumu.ZHUMUSdk;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
/**
* 加入未开启会议,等待UI
*
*/
public class MyWaitJoinActivity extends Activity implements View.OnClickListener, ZHUMUMeetingServiceListener {
private final static String TAG = MyWaitJoinActivity.class.getName();
private Button mLeave;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.wait_join_activity);
Intent intent = getIntent();
String topic = intent.getStringExtra(AndroidAppUtil.EXTRA_TOPIC);
long meetingId = intent.getLongExtra(AndroidAppUtil.EXTRA_MEETING_ID, 0);
boolean isRepeat = intent.getBooleanExtra(AndroidAppUtil.EXTRA_IS_REPEAT, false);
String date = intent.getStringExtra(AndroidAppUtil.EXTRA_DATE);
String time = intent.getStringExtra(AndroidAppUtil.EXTRA_TIME);
TextView txtTopic = (TextView)findViewById(R.id.txtTopic);
if(topic != null)
txtTopic.setText("Topic: " + topic);
TextView txtMeetingId = (TextView)findViewById(R.id.txtMeetingId);
if(meetingId > 0)
txtMeetingId.setText("Meeting ID: " + meetingId);
TextView txtIsRepeat = (TextView)findViewById(R.id.txtIsRepeat);
txtIsRepeat.setText("Is Repeat Meeting: " + isRepeat);
TextView txtTime = (TextView)findViewById(R.id.txtTime);
if(time != null)
txtTime.setText("Time: " + time);
TextView txtDate = (TextView)findViewById(R.id.txtDate);
if(date != null)
txtDate.setText("Date: " + date);
mLeave = (Button)findViewById(R.id.btnLeave);
mLeave.setOnClickListener(this);
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if(meetingService != null) {
meetingService.addListener(this);
}
}
@Override
public void onClick(View v) {
if(v.getId() == R.id.btnLeave) {
onClickLeave();
}
}
private void onClickLeave() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if(meetingService != null) {
meetingService.leaveCurrentMeeting(false);
}
finish();
}
@Override
public void onBackPressed() {
onClickLeave();
}
@Override
protected void onDestroy() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if(sdk.isInitialized()) {
ZHUMUMeetingService meetingService = sdk.getMeetingService();
meetingService.removeListener(this);
}
super.onDestroy();
}
@Override
public void onMeetingStatusChanged(MeetingStatus meetingStatus, int errorCode, int internalErrorCode) {
Log.i(TAG, "onMeetingEvent, meetingEvent=" + meetingStatus + ", errorCode=" + errorCode
+ ", internalErrorCode=" + internalErrorCode);
//枚举 ZHUMUMeetingStatus
}
}
package com.android.sdkexample.auther;
/**
* Created by liyh on 2017/11/14.
*/
public interface Httpurl {
//====================================================================
//移动端额通讯录接口
// String url_contract = "https://contacts.125339.com.cn";
//测试
String url_contract = "https://14.23.86.58:8090/web_ability";
String url_contract_gettoken = url_contract + "/rest/v120/token";
String url_contract_queryUser = url_contract + "/rest/v120/queryUserInfo";
//生产环境接口地址---api==================================================华丽分割线
String url_root = "https://ysxapi.zhumu.me";
/**
* login
*/
String url_login_by_pwd = url_root + "/auth/loginByPwd";
String url_login_by_code = url_root + "/auth/loginByVCode";
}
package com.android.sdkexample.auther;
/**
* Created by liyh on 2017/11/10.
*/
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.codec.digest.DigestUtils;
public class Sign {
private static final String CHARSET = "UTF-8";
// 秘钥
private static final String KEY = "e10adc3949ba59abbe56e057f20f883e";
// 标识
public static final String IDENTITY = "5b357915281c0fef984cd974bcd07f17";
/**
*
* @return 通过手机号密码获取的sign
*/
public static String getSign(String phoneno , String password){
Map<String, String> parameters = new HashMap<>();
// HTTP 参数列表
parameters.put("mobile", "13900001111");
parameters.put("password", "123456");
parameters.put("identity", IDENTITY);
String sign = sign(KEY, parameters);
return sign;
}
/**
* 生成签名
*
* @param key 签名秘钥
* @param parameters 参数
* @return
*/
public static String sign(String key, Map<String, String> parameters) {
Map<String, String> filteredParams = filterParameters(parameters);
String link = linkParameters(filteredParams);
System.out.println(link);
String mysign = MD5.sign(link, key, CHARSET);
return mysign;
}
/**
* sign不参与生成签名
*
* @param parameters
* @return
*/
private static Map<String, String> filterParameters(Map<String, String>
parameters) {
Map<String, String> result = new HashMap<String, String>();
if (parameters == null || parameters.size() <= 0) {
return result;
}
for (String key : parameters.keySet()) {
String value = parameters.get(key);
if (value == null || "".equals(value) || "sign".equalsIgnoreCase(key)) {
continue;
}
result.put(key, value);
}
return result;
}
/**
* 参数按照字典顺序排序并按规则连接
*
* @param parameters
* @return
*/
private static String linkParameters(Map<String, String> parameters) {
List<String> keys = new ArrayList<String>(parameters.keySet());
// 将参数按照字典顺序排序
Collections.sort(keys);
String linkedContent = "";
int size = keys.size();
for (int i = 0; i < size; i++) {
String key = keys.get(i);
String value = parameters.get(key);
if (i == keys.size() - 1) {
linkedContent = linkedContent + key + "=" + value;
} else {
linkedContent = linkedContent + key + "=" + value + "&";
}
}
return linkedContent;
}
public static class MD5 {
/**
* 签名字符串
*
* @param text 需要签名的字符串
* @param key 签名使用的密钥
* @param charset 编码格式
* @return
*/
public static String sign(String text, String key, String charset) {
text = text + key;
// org.apache.commons.codec.digest.DigestUtils
try {
return DigestUtils.md5Hex(getBytes(text, charset));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
/**
* 获取字节数组
*
* @param content
* @param charset
* @return
* @throws UnsupportedEncodingException
*/
private static byte[] getBytes(String content, String charset) throws
UnsupportedEncodingException {
if (charset == null || "".equals(charset)) {
return content.getBytes();
}
return content.getBytes(charset);
}
}
}
\ No newline at end of file
/**
* Copyright 2017 bejson.com
*/
package com.android.sdkexample.auther.bean;
/**
* Auto-generated: 2017-11-10 14:45:23
*
* @author bejson.com (i@bejson.com)
* @website http://www.bejson.com/java2pojo/
*/
public class Authorities {
private boolean canAccessKnowLedge;
private boolean canAccessPortal;
public void setCanAccessKnowLedge(boolean canAccessKnowLedge) {
this.canAccessKnowLedge = canAccessKnowLedge;
}
public boolean getCanAccessKnowLedge() {
return canAccessKnowLedge;
}
public void setCanAccessPortal(boolean canAccessPortal) {
this.canAccessPortal = canAccessPortal;
}
public boolean getCanAccessPortal() {
return canAccessPortal;
}
}
\ No newline at end of file
package com.android.sdkexample.auther.bean;
import java.util.List;
/**
* Created by liyh on 2017/11/10.
*/
public class TokenBean {
private Authorities authorities;
private int code;
private int createTime;
private String enterpriseId;
private int expires;
private String msg;
private List<String> roles;
private String token;
private String userId;
private String username;
public void setAuthorities(Authorities authorities) {
this.authorities = authorities;
}
public Authorities getAuthorities() {
return authorities;
}
public void setCode(int code) {
this.code = code;
}
public int getCode() {
return code;
}
public void setCreateTime(int createTime) {
this.createTime = createTime;
}
public int getCreateTime() {
return createTime;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setExpires(int expires) {
this.expires = expires;
}
public int getExpires() {
return expires;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getMsg() {
return msg;
}
public void setRoles(List<String> roles) {
this.roles = roles;
}
public List<String> getRoles() {
return roles;
}
public void setToken(String token) {
this.token = token;
}
public String getToken() {
return token;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
public void setUsername(String username) {
this.username = username;
}
public String getUsername() {
return username;
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:orientation="vertical" >
<EditText
android:id="@+id/edtPhoneNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="Phone Number"
android:imeOptions="actionNext|flagNoExtractUi"
android:focusable="true">
</EditText>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:layout_marginTop="10dp" >
<Button
android:id="@+id/btnCall"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="2dp"
android:text="Call out"/>
<Button
android:id="@+id/btnHangUp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Hang up"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/txtUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="URL: "/>
<TextView
android:id="@+id/txtSubject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Subject: "/>
<TextView
android:id="@+id/txtMeetingId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Meeting ID: "/>
<TextView
android:id="@+id/txtPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Password: "/>
<TextView
android:id="@+id/txtRawPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Raw Password: "/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Text: "/>
<EditText
android:id="@+id/edtText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ems="10"
android:inputType="textMultiLine" >
</EditText>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:orientation="vertical" >
<EditText
android:id="@+id/edtMeetingNo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Meeting ID"
android:imeOptions="actionNext|flagNoExtractUi"
android:focusable="true"
android:maxLength="13">
<requestFocus />
</EditText>
<EditText
android:id="@+id/edtMeetingPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="Meeting Password(For join meeting only)"
android:imeOptions="actionNext|flagNoExtractUi"
android:focusable="true">
</EditText>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:layout_marginTop="10dp" >
<Button
android:id="@+id/btnStartMeeting"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="2dp"
android:text="Start this Meeting"
android:onClick="onClickBtnStartMeeting" />
<Button
android:id="@+id/btnJoinMeeting"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Join this Meeting"
android:onClick="onClickBtnJoinMeeting" />
</LinearLayout>
<EditText
android:id="@+id/edtZhumuUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:imeOptions="actionNext|flagNoExtractUi"
android:focusable="true"
>
<requestFocus />
</EditText>
<EditText
android:id="@+id/edtZhumuPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="Password"
android:imeOptions="actionNext|flagNoExtractUi"
android:focusable="true">
</EditText>
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="loginwithzhumu"
android:onClick="onclickLogin" />
<Button
android:id="@+id/startinstantmeeting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="startInstrantMeeting(for logged in users)"
android:onClick="onclickStartInstantMeeting" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/txtTopic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Topic: "/>
<TextView
android:id="@+id/txtMeetingId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Meeting ID: "/>
<TextView
android:id="@+id/txtIsRepeat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Is Repeat Meeting: "/>
<TextView
android:id="@+id/txtDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Date: "/>
<TextView
android:id="@+id/txtTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Time: "/>
<Button
android:id="@+id/btnLeave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="80dp"
android:layout_gravity="center"
android:text="Leave" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="zm_config_invite_by_only_action_meeting_invite">true</bool>
<!-- Invitation content generator class. It must implement com.zipow.videobox.util.InviteContentGenerator -->
<string name="zm_config_invite_content_generator">com.android.sdkexample.MyInviteContentGenerator</string>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="this_app_name">ZHUMU SDK RTC1_AS</string>
<string name="invite_acitivity_name">Meeting Invite Example</string>
</resources>
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.android.sdkexample2"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
/*compileOptions {
encoding "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}*/
}
dependencies {
implementation 'com.android.support:support-v4:26.1.0'
implementation project(':zhumucommonlib')
implementation project(':zhumumobilertc')
implementation project(':zhumusdk')
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'org.xutils:xutils:3.1.24'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.sdkexample2"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
<uses-sdk android:targetSdkVersion="23"/>
<uses-feature android:glEsVersion="0x00020000"/>
<permission android:name="com.android.sdkexample2.permission.KUBI_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.android.sdkexample2.permission.KUBI_MESSAGE" />
<application android:label="@string/this_app_name"
android:icon="@drawable/ic_launcher">
<activity
android:name="com.android.sdkexample2.MainActivity"
android:icon="@drawable/ic_launcher"
android:label="@string/this_app_name"
android:screenOrientation="landscape"
android:theme="@style/ZMTheme.MainWindow" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.android.sdkexample2.MyMeetingActivity"
android:configChanges="orientation|screenSize"
android:hardwareAccelerated="false"
android:theme="@style/ZMTheme.SubWindow"
android:process=":zoom_meeting"
android:screenOrientation="landscape" />
</application>
</manifest>
package com.android.sdkexample2;
public interface Constants {
public final static String url = "https://api.zhumu.me/v3/user/get";
public final static String API_KEY = "9993779D06833B0CE3A5F8308B07DD59";
public final static String API_SECRET = "DB07FC37CC7782E70D3D86CA171B8EB5";
/**
*
* 如果sdk 初始化失败,请询问相关人员 找到 [ WEB_DOMAIN ,APP_KEY, APP_SECRET ]的值,并设置
*/
//
public final static String WEB_DOMAIN = "launcher.zhumu.me";
public final static String APP_KEY = "xoqzRRVy4dpUIxabbTvayKBzRV0VBFhrxFqy";
public final static String APP_SECRET = "v4Z7o4ds8A9UUGSOs7bXLOlNrAkoByfWHQlF";
// TODO Change it to your Dropbox APP Key to enable "Share Dropbox"
public final static String DROPBOX_APP_KEY = null;
// TODO Change it to your Dropbox APP Secret to enable "Share Dropbox"
public final static String DROPBOX_APP_SECRET = null;
// TODO Change it to your OneDrive client ID to enable "Share OneDrive"
public final static String ONEDRIVE_CLIENT_ID = null;
}
package com.android.sdkexample2;
import android.util.Log;
/**
*/
public final class Logs {
private int debugType = DebugType.V;
public static final class DebugType {
public static final int V = 0;
public static final int D = 1;
public static final int I = 2;
public static final int W = 3;
public static final int E = 4;
public static final int N = 5; // close all debug info
}
private String TAG = "";
public Logs(String TAG) {
this.TAG = TAG;
}
public Logs(String TAG, int debugType){
this.TAG = TAG;
this.debugType = debugType;
}
public void D(String s) {
if (debugType <= DebugType.D) {
Log.d(TAG, s);
}
}
public void E(String s) {
if (debugType <= DebugType.E) {
Log.e(TAG, s);
}
}
public void I(String s) {
if (debugType <= DebugType.I) {
Log.i(TAG, s);
}
}
public void W(String s) {
if (debugType <= DebugType.W) {
Log.w(TAG, s);
}
}
public void V(String s) {
if (debugType <= DebugType.V) {
Log.v(TAG, s);
}
}
}
package com.android.sdkexample2;
import com.google.gson.Gson;
import com.suirui.zhumu.ZHUMUError;
import com.suirui.zhumu.ZHUMUMeetingError;
import com.suirui.zhumu.ZHUMUMeetingEvent;
import com.suirui.zhumu.ZHUMUMeetingService;
import com.suirui.zhumu.ZHUMUMeetingServiceListener;
import com.suirui.zhumu.ZHUMUMeetingStatus;
import com.suirui.zhumu.ZHUMUSdk;
import com.suirui.zhumu.ZHUMUSdkInitializeListener;
import com.suirui.zhumu.ZHUMUStartMeetingOptions;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
import org.json.JSONObject;
import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.x;
import us.zoom.sdk.MeetingStatus;
public class MainActivity extends Activity implements Constants, ZHUMUMeetingServiceListener, ZHUMUSdkInitializeListener {
private final static String TAG = MainActivity.class.getName();
Logs log = new Logs(TAG);
public final static String ACTION_RETURN_FROM_MEETING = "com.android.sdkexample2.action.ReturnFromMeeting";
public final static String EXTRA_TAB_ID = "tabId";
public final static int TAB_WELCOME = 1;
public final static int TAB_MEETING = 2;
public final static int TAB_PAGE_2 = 3;
private final static int STYPE = ZHUMUMeetingService.USER_TYPE_API_USER;
private final static String DISPLAY_NAME = "ZHUMU SDK";
private View viewTabWelcome;
private View viewTabMeeting;
private View viewTabPage2;
private Button btnTabWelcome;
private Button btnTabMeeting;
private Button btnTabPage2;
public static String user_id = "";
public static String token = "";
public static String user_name = "";
public static String meet_num = "";
Meeting mMeeting;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setupTabs();
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
// if(savedInstanceState == null) {
sdk.initSDK(this, APP_KEY, APP_SECRET, WEB_DOMAIN, this);
// }
if(sdk.isInitialized()) {
registerMeetingServiceListener();
}
}
private void setupTabs() {
viewTabWelcome = findViewById(R.id.viewTabWelcome);
viewTabMeeting = findViewById(R.id.viewTabMeeting);
viewTabPage2 = findViewById(R.id.viewTabPage2);
btnTabWelcome = (Button)findViewById(R.id.btnTabWelcome);
btnTabMeeting = (Button)findViewById(R.id.btnTabMeeting);
btnTabPage2 = (Button)findViewById(R.id.btnTabPage2);
selectTab(TAB_WELCOME);
btnTabMeeting.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
selectTab(TAB_MEETING);
}
});
btnTabWelcome.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
selectTab(TAB_WELCOME);
}
});
btnTabPage2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
selectTab(TAB_PAGE_2);
}
});
}
private void selectTab(int tabId) {
if(tabId == TAB_WELCOME) {
viewTabWelcome.setVisibility(View.VISIBLE);
viewTabMeeting.setVisibility(View.GONE);
viewTabPage2.setVisibility(View.GONE);
btnTabWelcome.setSelected(true);
btnTabMeeting.setSelected(false);
btnTabPage2.setSelected(false);
} else if(tabId == TAB_PAGE_2) {
viewTabWelcome.setVisibility(View.GONE);
viewTabMeeting.setVisibility(View.GONE);
viewTabPage2.setVisibility(View.VISIBLE);
btnTabWelcome.setSelected(false);
btnTabMeeting.setSelected(false);
btnTabPage2.setSelected(true);
} else if(tabId == TAB_MEETING) {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if(!sdk.isInitialized()) {
Toast.makeText(this, "ZHUMUSDK has not been initialized successfully", Toast.LENGTH_LONG).show();
return;
}
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if(meetingService == null)
return;
if(meetingService.getMeetingStatus() .equals(ZHUMUMeetingStatus.MEETING_STATUS_IDLE) ){
viewTabWelcome.setVisibility(View.GONE);
viewTabPage2.setVisibility(View.GONE);
viewTabMeeting.setVisibility(View.VISIBLE);
btnTabWelcome.setSelected(false);
btnTabPage2.setSelected(false);
btnTabMeeting.setSelected(true);
startMeeting();
} else {
meetingService.returnToMeeting(this);
}
overridePendingTransition(0, 0);
}
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
// disable animation
overridePendingTransition(0,0);
String action = intent.getAction();
if(ACTION_RETURN_FROM_MEETING.equals(action)) {
int tabId = intent.getIntExtra(EXTRA_TAB_ID, TAB_WELCOME);
selectTab(tabId);
}
}
@Override
public void onZHUMUSdkInitializeResult(int errorCode, int internalErrorCode) {
Log.i(TAG, "onZHUMUSdkInitializeResult, errorCode=" + errorCode + ", internalErrorCode=" + internalErrorCode);
if(errorCode != ZHUMUError.ERROR_SUCCESS) {
Toast.makeText(this, "Failed to initialize ZHUMUSDK. Error: " + errorCode + ", internalErrorCode=" + internalErrorCode, Toast.LENGTH_LONG);
} else {
Toast.makeText(this, "Initialize ZHUMUSDK successfully.", Toast.LENGTH_LONG).show();
registerMeetingServiceListener();
}
}
private void registerMeetingServiceListener() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if(meetingService != null) {
meetingService.addListener(this);
}
}
@Override
protected void onDestroy() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if(sdk.isInitialized()) {
ZHUMUMeetingService meetingService = sdk.getMeetingService();
meetingService.removeListener(this);
}
super.onDestroy();
}
public void startMeeting() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if(!sdk.isInitialized()) {
Toast.makeText(this, "ZHUMUSDK has not been initialized successfully", Toast.LENGTH_LONG).show();
return;
}
if(meet_num == null) {
Toast.makeText(this, "MEETING_ID in Constants can not be NULL", Toast.LENGTH_LONG).show();
return;
}
ZHUMUMeetingService meetingService = sdk.getMeetingService();
ZHUMUStartMeetingOptions opts = new ZHUMUStartMeetingOptions();
// opts.no_meeting_end_message = true;
// opts.no_titlebar = true;
opts.no_bottom_toolbar = true;
opts.no_invite = true;
int ret = meetingService.startMeeting(this, user_id, token, STYPE, meet_num, DISPLAY_NAME, opts);
Log.i(TAG, "onClickBtnStartMeeting, ret=" + ret);
}
private Meeting getMeeting(String strResult){
try{
JSONObject jsonObject = new JSONObject(strResult.toString());
int code = jsonObject.getInt("code");
int zcode = jsonObject.getInt("zcode");
String id = jsonObject.getString("id");// User_id
String username = jsonObject.getString("username");
String mobile = jsonObject.getString("mobile");
int usertype = jsonObject.getInt("usertype");
String det = jsonObject.getString("det");
String createtime = jsonObject.getString("createtime");
String createby = jsonObject.getString("createby");
String pmi = jsonObject.getString("pmi");
int role = jsonObject.getInt("role");
String email = jsonObject.getString("email");
int isowner = jsonObject.getInt("isowner");
int accounttype = jsonObject.getInt("accounttype");
String token = jsonObject.getString("token");
Meeting meet = new Meeting();
meet.setCode(code);
meet.setZcode(zcode);
meet.setId(id);
meet.setUsername(username);
meet.setMobile(mobile);
meet.setUsertype(usertype);
meet.setDet(det);
meet.setCreatetime(createtime);
meet.setCreateby(createby);
meet.setPmi(pmi);
meet.setRole(role);
meet.setEmail(email);
meet.setIsowner(isowner);
meet.setAccounttype(accounttype);
meet.setToken(token);
return meet;
}catch (Exception e){
e.printStackTrace();
}
return null;
}
@Override
public void onMeetingStatusChanged(MeetingStatus meetingStatus, int i, int i1) {
}
}
package com.android.sdkexample2;
import java.io.Serializable;
public class Meeting implements Serializable {
private int code;
private int zcode;
private String id;
private String username;
private String mobile;
private int usertype;
private String det;
private String createtime;
private String createby;
private String pmi;
private int role;
private String email;
private int isowner;
private int accounttype;
private String token;
public void setCode(int code) {
this.code = code;
}
public int getCode() {
return this.code;
}
public void setZcode(int zcode) {
this.zcode = zcode;
}
public int getZcode() {
return this.zcode;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return this.id;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getMobile() {
return this.mobile;
}
public void setUsername(String username) {
this.username = username;
}
public String getUsername() {
return this.username;
}
public void setUsertype(int usertype) {
this.usertype = usertype;
}
public int getUsertype() {
return this.usertype;
}
public void setDet(String det) {
this.det = det;
}
public String getDet() {
return this.det;
}
public void setCreatetime(String createtime) {
this.createtime = createtime;
}
public String getCreatetime() {
return this.createtime;
}
public void setCreateby(String createby) {
this.createby = createby;
}
public String getCreateby() {
return this.createby;
}
public void setPmi(String pmi) {
this.pmi = pmi;
}
public String getPmi() {
return this.pmi;
}
public void setRole(int role) {
this.role = role;
}
public int getRole() {
return this.role;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return this.email;
}
public void setIsowner(int isowner) {
this.isowner = isowner;
}
public int getIsowner() {
return this.isowner;
}
public void setAccounttype(int accounttype) {
this.accounttype = accounttype;
}
public int getAccounttype() {
return this.accounttype;
}
public void setToken(String token) {
this.token = token;
}
public String getToken() {
return this.token;
}
}
\ No newline at end of file
package com.android.sdkexample2;
import us.zoom.sdk.MeetingActivity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.Button;
import com.android.sdkexample2.R;
/**
* 自定义 视频界面( 可自定义离开, 声音,相机,共享等按钮)
*
*/
public class MyMeetingActivity extends MeetingActivity {
private Button btnLeaveZmMeeting;
private Button btnSwitchToNextCamera;
private Button btnAudio;
private Button btnParticipants;
private Button btnShare;
private Button btnStopShare;
private Button btnMoreOptions;
private View viewTabMeeting;
private Button btnTabWelcome;
private Button btnTabMeeting;
private Button btnTabPage2;
@Override
protected int getLayout() {
return R.layout.my_meeting_layout;
}
@Override
protected boolean isAlwaysFullScreen() {
return false;
}
@Override
protected boolean isSensorOrientationEnabled() {
return false;
}
@SuppressLint("MissingSuperCall")
@Override
protected void onCreate (Bundle savedInstanceState) {
//super.onCreate(savedInstanceState);
disableFullScreenMode();
setupTabs();
btnLeaveZmMeeting = (Button)findViewById(R.id.btnLeaveZmMeeting);
btnSwitchToNextCamera = (Button)findViewById(R.id.btnSwitchToNextCamera);
btnAudio = (Button)findViewById(R.id.btnAudio);
btnParticipants = (Button)findViewById(R.id.btnParticipants);
btnShare = (Button)findViewById(R.id.btnShare);
btnStopShare = (Button)findViewById(R.id.btnStopShare);
btnMoreOptions = (Button)findViewById(R.id.btnMoreOptions);
btnLeaveZmMeeting.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showLeaveDialog();
}
});
btnSwitchToNextCamera.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
switchToNextCamera();
}
});
btnAudio.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
doAudioAction();
}
});
btnParticipants.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showParticipants();
}
});
btnShare.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showShareOptions();
}
});
btnStopShare.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
stopShare();
}
});
btnMoreOptions.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showMoreOptions();
}
});
}
@Override
public void onConfigurationChanged (Configuration newConfig) {
//super.onConfigurationChanged(newConfig);
disableFullScreenMode();
}
private void disableFullScreenMode() {
getWindow().setFlags(~WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams. FLAG_FULLSCREEN);
}
private void setupTabs() {
viewTabMeeting = findViewById(R.id.viewTabMeeting);
btnTabWelcome = (Button)findViewById(R.id.btnTabWelcome);
btnTabMeeting = (Button)findViewById(R.id.btnTabMeeting);
btnTabPage2 = (Button)findViewById(R.id.btnTabPage2);
selectTab(MainActivity.TAB_MEETING);
btnTabMeeting.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
selectTab(MainActivity.TAB_MEETING);
}
});
btnTabWelcome.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
selectTab(MainActivity.TAB_WELCOME);
}
});
btnTabPage2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
selectTab(MainActivity.TAB_PAGE_2);
}
});
}
private void selectTab(int tabId) {
if(tabId == MainActivity.TAB_MEETING) {
btnTabWelcome.setSelected(false);
btnTabPage2.setSelected(false);
btnTabMeeting.setSelected(true);
} else {
switchToMainActivity(tabId);
}
}
private void switchToMainActivity(int tab) {
Intent intent = new Intent(this, MainActivity.class);
intent.setAction(MainActivity.ACTION_RETURN_FROM_MEETING);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
intent.putExtra(MainActivity.EXTRA_TAB_ID, tab);
startActivity(intent);
}
@Override
public void onResume() {
updateButtonsStatus();
// disable animation
overridePendingTransition(0, 0);
super.onResume();
}
@Override
protected void onMeetingConnected() {
updateButtonsStatus();
}
@Override
protected void onSilentModeChanged(boolean inSilentMode) {
updateButtonsStatus();
}
@Override
protected void onStartShare() {
btnShare.setVisibility(View.GONE);
btnStopShare.setVisibility(View.VISIBLE);
}
@Override
protected void onStopShare() {
btnShare.setVisibility(View.VISIBLE);
btnStopShare.setVisibility(View.GONE);
}
private void updateButtonsStatus() {
boolean enabled = (isMeetingConnected() && !isInSilentMode());
btnSwitchToNextCamera.setEnabled(enabled);
btnAudio.setEnabled(enabled);
btnParticipants.setEnabled(enabled);
btnShare.setEnabled(enabled);
btnMoreOptions.setEnabled(enabled);
if(isSharingOut()) {
btnShare.setVisibility(View.GONE);
btnStopShare.setVisibility(View.VISIBLE);
} else {
btnShare.setVisibility(View.VISIBLE);
btnStopShare.setVisibility(View.GONE);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<FrameLayout
android:id="@+id/tabcontent"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" >
<TextView
android:id="@+id/viewTabWelcome"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Hello, world"/>
<TextView
android:id="@+id/viewTabPage2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Page 2"/>
<TextView
android:id="@+id/viewTabMeeting"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Waiting..." />
</FrameLayout>
<LinearLayout
android:id="@+id/tabs"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="top"
android:background="#8080ff"
android:orientation="vertical">
<Button
android:id="@+id/btnTabWelcome"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Welcome" />
<Button
android:id="@+id/btnTabPage2"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Page 2" />
<Button
android:id="@+id/btnTabMeeting"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Meeting" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/viewTabMeeting"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#8080cc"
android:gravity="center"
android:orientation="horizontal" >
<Button
style="@style/ZMButton.Small"
android:id="@+id/btnAudio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="Audio" />
<Button
style="@style/ZMButton.Small"
android:id="@+id/btnSwitchToNextCamera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="Camera" />
<Button
style="@style/ZMButton.Small"
android:id="@+id/btnShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="Share" />
<Button
style="@style/ZMButton.Small"
android:id="@+id/btnStopShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="Stop Share" />
<Button
style="@style/ZMButton.Small"
android:id="@+id/btnParticipants"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="Participants" />
<Button
style="@style/ZMButton.Small"
android:id="@+id/btnMoreOptions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="More"/>
<Button
style="@style/ZMButton.Small"
android:id="@+id/btnLeaveZmMeeting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:text="Leave" />
</LinearLayout>
<include
android:id="@+id/meetingContent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
layout="@layout/zm_conf_main_screen" />
</LinearLayout>
<LinearLayout
android:id="@+id/tabs"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="top"
android:background="#8080ff"
android:orientation="vertical" >
<Button
android:id="@+id/btnTabWelcome"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Welcome" />
<Button
android:id="@+id/btnTabPage2"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Page 2" />
<Button
android:id="@+id/btnTabMeeting"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Meeting" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="zm_config_conf_activity">com.android.sdkexample2.MyMeetingActivity</string>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="this_app_name">ZHUMU SDK RTC2_AS</string>
</resources>
VERSION_NAME=0.20-SNAPSHOT
VERSION_CODE=7
GROUP=com.github.erizet.signala
POM_DESCRIPTION=SignalR client for Android
POM_URL=https://github.com/erizet/signala
POM_SCM_URL=https://github.com/erizet/signala
POM_SCM_CONNECTION=scm:git@github.com:erizet/signala.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:erizet/signala.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=erizet
POM_DEVELOPER_NAME=Erik Zetterqvist
org.gradle.jvmargs=-Xmx2048m
\ No newline at end of file
#Wed Nov 21 09:10:41 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
if [ -n "$ANDROID_HOME" ] ; then
ANDROID_HOME="$ANDROID_SDK_HOME"
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
if "%ANDROID_HOME%" == "" set ANDROID_HOME=%ANDROID_SDK_HOME%
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
include ':zhumucommonlib'
include ':zhumumobilertc'
include ':zhumusdk'
include ':example'
include ':example2'
\ No newline at end of file
configurations.create("default")
artifacts.add("default", file('zhumucommonlib.aar'))
\ No newline at end of file
configurations.create("default")
artifacts.add("default", file('zhumumobilertc.aar'))
configurations.create("default")
artifacts.add("default", file('zhumusdk.aar'))
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论