Whereby Android SDK
Last updated
Was this helpful?
Was this helpful?
dependencies {
...
def WHEREBY_SDK_VERSION = '1.+'
implementation("com.github.whereby:android-sdk:$WHEREBY_SDK_VERSION@aar") { transitive = true }
}dependencies {
val wherebySdkVersion = "1.+"
implementation("com.github.whereby:android-sdk:$wherebySdkVersion@aar") {
isTransitive = true
}
}package com.example.myapplication;
import android.os.Bundle;
import androidx.fragment.app.FragmentActivity;
import com.whereby.sdk.*;
public class MainActivity extends FragmentActivity {
// Replace with your own
public static final String ROOM_URL_STRING = "https://your-whereby-room-URL";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) return;
// 1. Setup the WherebyRoomConfig
WherebyRoomConfig config = new WherebyRoomConfig(ROOM_URL_STRING);
// 2. Instantiate the WherebyRoomFragment to be presented
WherebyRoomFragment fragment = WherebyRoomFragment.newInstance(config);
// 3. Replace the fragment with the WherebyRoomFragment
getSupportFragmentManager()
.beginTransaction()
.replace(android.R.id.content, fragment, "tag")
.commit();
}
}package com.example.myapplication
import android.os.Bundle
import androidx.fragment.app.FragmentActivity
import com.whereby.sdk.*
class MainActivity : FragmentActivity() {
companion object {
// Replace with your own
const val ROOM_URL_STRING = "https://your-whereby-room-URL"
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (savedInstanceState != null) return
// 1. Setup the WherebyRoomConfig
val config = WherebyRoomConfig(ROOM_URL_STRING)
// 2. Instantiate the WherebyRoomFragment to be presented
val fragment = WherebyRoomFragment.newInstance(config)
// 3. Replace the fragment with the WherebyRoomFragment
supportFragmentManager
.beginTransaction()
.replace(android.R.id.content, fragment, "tag")
.commit()
}
}