A android library for use service binding with rxjava
Using JCenter:
repositories {
jcenter()
}
dependencies {
compile 'com.jiechic.android.library:rxservice:1.0.0'
}
RxJava 2.1.0+
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Just enable RxService as soon as possible. In Android, for example:
class MainActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
RxService(this, ServiceHandler::class.java)
.connectService()
.map { IServiceHandler.Stub.asInterface(it) }
.subscribe { Log.d(MainActivity::class.java.simpleName, it.sendAndGet("hello world")) }
}
}