Skip to content

Full object mapping and querying of the Android Contact API

License

Notifications You must be signed in to change notification settings

rubixhacker/Kontact

Repository files navigation

Kontact

A mapper around Android's Contact APIs

Import the Dependency Download

To import the Android SDK, include it as a dependency in your build.gradle file

compile 'com.hackedcube:kontact:X.X.X'

Usage


To get all Contacts on the user's device

Java
List<Kontact> kontacts = ContactUtils.queryAllContacts(this);
Kotlin
val context = ...
        
val kontactList: List<Kontact> = context.queryAllContacts()

To get a specific Contact from an id

Java
Kontact kontact = ContactUtils.getContactFromId(this, <id>);
Kotlin
val context = ...
            
val kontact: Kontact = context.getContactFromId(<id>)




RX Support

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

Java
Single<List<Kontact>> kontactsSingle = RxContactUtils.allContacts(this);
Kotlin
val context = ...
        
val kontactListSingle: Single<List<Kontact>> = context.allContacts()

To get a specific Contact from an id

Java
Single<Kontact> kontact = RxContactUtils.contact(this, <id>);
Kotlin
val context = ...
            
val kontact: Single<Kontact> = context.contact(<id>)






About

Full object mapping and querying of the Android Contact API

Resources

License

Stars

Watchers

Forks

Packages

No packages published