TUIRoomKit
Component in the shortest time. By following this document, you will complete the following key steps within an hour and ultimately obtain an audio/video conference function with a complete UI interface.include ':timcommon'include ':tuiroomkit'
include (":timcommon") include (":tuiroomkit")
api project(':tuiroomkit')
api(project(":tuiroomkit"))
-keep class com.tencent.** { *; }
TUILogin.login(context,1400000001, // Please replace it with the SDKAppID obtained in step 1."denny", // Please replace with your UserID"xxxxxxxxxxx", // You can calculate a UserSig in the console and fill it in this positionnew TUICallback() {@Overridepublic void onSuccess() {Log.i(TAG, "login success");}@Overridepublic void onError(int errorCode, String errorMessage) {Log.e(TAG, "login failed, errorCode: " + errorCode + " msg:" + errorMessage);}});
TUILogin.login(this,1400000001, // Please replace it with the SDKAppID obtained in step 1."denny", // Please replace with your UserID"xxxxxxxxxxx", // You can calculate a UserSig in the console and fill it in this positionobject : TUICallback() {override fun onSuccess() {Log.i(TAG, "login success")}override fun onError(errorCode: Int, errorMessage: String) {Log.e(TAG, "login failed, errorCode: " + errorCode + " msg:" + errorMessage);}})}
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/conference_container" android:layout_width="match_parent" android:layout_height="match_parent" />
public class ConferenceOwnerActivity extends AppCompatActivity {private static final String TAG = "ConferenceOwnerActivity";private ConferenceObserver mConferenceObserver;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_conference);ConferenceMainFragment fragment = new ConferenceMainFragment();mConferenceObserver = new ConferenceObserver() {@Overridepublic void onConferenceStarted(String conferenceId, ConferenceError error) {super.onConferenceStarted(conferenceId, error);if (error != ConferenceError.SUCCESS) {Log.e(TAG, "Error : " + error);return;}FragmentManager manager = getSupportFragmentManager();FragmentTransaction transaction = manager.beginTransaction();transaction.add(R.id.conference_container, fragment);transaction.commitAllowingStateLoss();}};fragment.setConferenceObserver(mConferenceObserver);// Replace "123456" with the corresponding conference numberfragment.quickStartConference("123456");}}
class ConferenceOwnerActivity : AppCompatActivity() { private val tag: String = "ConferenceOwnerActivity" private var mConferenceObserver : ConferenceObserver? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_conference) var fragment = ConferenceMainFragment() mConferenceObserver = object: ConferenceObserver() { override fun onConferenceStarted(conferenceId: String?, error: ConferenceError?) { super.onConferenceStarted(conferenceId, error) if (error != ConferenceError.SUCCESS) { Log.e(tag, "Error : $error") return } val fragmentManager = supportFragmentManager val transaction = fragmentManager.beginTransaction() transaction.add(R.id.conference_container, fragment) transaction.commitAllowingStateLoss() } } fragment.setConferenceObserver(mConferenceObserver) // Replace "123456" with the corresponding conference number fragment.quickStartConference("123456") } }
public class ConferenceGeneralActivity extends AppCompatActivity {private static final String TAG = "ConferenceGeneralActivity";private ConferenceObserver mConferenceObserver;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_conference);ConferenceMainFragment fragment = new ConferenceMainFragment();mConferenceObserver = new ConferenceObserver() {@Overridepublic void onConferenceJoined(String conferenceId, ConferenceError error) {super.onConferenceJoined(conferenceId, error);if (error != ConferenceError.SUCCESS) {Log.e(TAG, "Error : " + error);return;}FragmentManager manager = getSupportFragmentManager();FragmentTransaction transaction = manager.beginTransaction();transaction.add(R.id.conference_container, fragment);transaction.commitAllowingStateLoss();}};fragment.setConferenceObserver(mConferenceObserver);// Replace "123456" with the corresponding conference numberfragment.joinConference("123456");}}
class ConferenceGeneralActivity : AppCompatActivity() { private val tag: String = "ConferenceGeneralActivity" private var mConferenceObserver : ConferenceObserver? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_conference) var fragment = ConferenceMainFragment() mConferenceObserver = object: ConferenceObserver() { override fun onConferenceJoined(conferenceId: String?, error: ConferenceError?) { super.onConferenceJoined(conferenceId, error) if (error != ConferenceError.SUCCESS) { Log.e(tag, "Error : $error") return } val fragmentManager = supportFragmentManager val transaction = fragmentManager.beginTransaction() transaction.add(R.id.conference_container, fragment) transaction.commitAllowingStateLoss() } } fragment.setConferenceObserver(mConferenceObserver) // Replace "123456" with the corresponding conference number fragment.joinConference("123456789") } }
Conference main interface | User list |
Was this page helpful?