ohyooo / Wessager

Communication between phone and wear in a HTTP-like way by using coroutines.

Repository from Github https://github.comohyooo/WessagerRepository from Github https://github.comohyooo/Wessager

Wessager

Wessager is wear messager Communication between phone and wear in a simple way by using coroutines. No callback & Main-Safe

Dependencies

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "com.google.android.gms:play-services-wearable:$gms_wearable_version"

Usage

copy Wessager to your project

sample:

// get a token from phone or wear
launch {
    val token = Wessager.send(msg = "get token", waitResponse = true)
    updateToken(token)
}
...
// on another device
 override fun onMessageReceived(msg: String, sessionId: Long) {
        Wessager.send(msg = "token:xxx", waitResponse = false, sessionId = sessionId)
 }

About

Communication between phone and wear in a HTTP-like way by using coroutines.

License:Do What The F*ck You Want To Public License


Languages

Language:Kotlin 100.0%