Skip to content

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

License

Notifications You must be signed in to change notification settings

ohyooo/Wessager

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages