A mapper around Android's Contact APIs
To import the Android SDK, include it as a dependency in your build.gradle file
compile 'com.hackedcube:kontact:X.X.X'
To get all Contacts on the user's device
List<Kontact> kontacts = ContactUtils.queryAllContacts(this);
val context = ...
val kontactList: List<Kontact> = context.queryAllContacts()
To get a specific Contact from an id
Kontact kontact = ContactUtils.getContactFromId(this, <id>);
val context = ...
val kontact: Kontact = context.getContactFromId(<id>)
Grab the correct dependency for which version of RxJava you are using
For RxJava 1
compile 'com.hackedcube:kontact-rxjava:X.X.X'
For RxJava 2
compile 'com.hackedcube:kontact-rxjava2:X.X.X'
To get all Contacts on the user's device as a Single
Single<List<Kontact>> kontactsSingle = RxContactUtils.allContacts(this);
val context = ...
val kontactListSingle: Single<List<Kontact>> = context.allContacts()
To get a specific Contact from an id
Single<Kontact> kontact = RxContactUtils.contact(this, <id>);
val context = ...
val kontact: Single<Kontact> = context.contact(<id>)