Scheduler Android
This is an example of real-time collaborative Scheduler using Yorkie Android SDK.
MainActivity.kt
1package dev.yorkie.example.scheduler23import android.os.Bundle4import androidx.activity.ComponentActivity5import androidx.activity.compose.setContent6import androidx.activity.enableEdgeToEdge7import androidx.compose.foundation.layout.fillMaxSize8import androidx.compose.foundation.layout.navigationBarsPadding9import androidx.compose.foundation.layout.statusBarsPadding10import androidx.compose.material.MaterialTheme11import androidx.compose.material.Surface12import androidx.compose.ui.Modifier13import androidx.navigation.compose.rememberNavController14import dev.yorkie.example.scheduler.ui.SchedulerAppHost15import dev.yorkie.example.scheduler.ui.theme.SchedulerTheme1617class MainActivity : ComponentActivity() {18 override fun onCreate(savedInstanceState: Bundle?) {19 super.onCreate(savedInstanceState)20 enableEdgeToEdge()21 // Matches JS example behaviour (Yorkie JS PR #1108): if the launcher22 // provides a "key" extra (e.g. `adb shell am start ... --es key my-room`),23 // skip the Enter-Document-Key screen and open that document directly.24 val initialDocumentKey = intent?.getStringExtra(EXTRA_DOCUMENT_KEY)25 setContent {26 SchedulerTheme {27 Surface(28 modifier = Modifier29 .fillMaxSize()30 .statusBarsPadding()31 .navigationBarsPadding(),32 color = MaterialTheme.colors.background,33 ) {34 SchedulerAppHost(35 navController = rememberNavController(),36 initialDocumentKey = initialDocumentKey,37 )38 }39 }40 }41 }4243 companion object {44 private const val EXTRA_DOCUMENT_KEY = "key"45 }46}
Recorded demo. Two Android clients edit the same calendar side by side.