Here is the way to adopt to get data from phone contacts, in Kotlin programming for Android devices :
https://gist.github.com/reuniware/53cbee352341a098c3f875d60cd79c55#file-get_contact_web_url-kt
This can be improved but this will be a good starting point for you if you need to implement this functionality in your application development.