I can give you a more accurate answer if you would post some code, but if you would implement a method in your library which would retrieve contacts, then you will alyways have to have a Context instance as parameter of this method.
Try something like this:
public Contact readContacts(Context context)
{
ContentResolver resolver = context.getContentResolver();
Cursor cursor = resolver.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
....
}
You would then call this method in an app which uses your library like this:
ContactHelper.readContacts(activity);
or like this:
ContactHelper.readContacts(getApplicationContext());
etc...
I assume you already have all required permissions, but don't forget to add this or you will not be able to read contacts:
<uses-permission android:name="android.permission.READ_CONTACTS" />
Here you can find more information about reading contacts with several code examples: https://developer.android.com/training/contacts-provider/retrieve-names.html