{"id":17236016,"url":"https://github.com/codinguser/android_contact_picker","last_synced_at":"2025-08-20T22:32:23.553Z","repository":{"id":1971400,"uuid":"2902626","full_name":"codinguser/android_contact_picker","owner":"codinguser","description":"Easily display and retrieve contact information on Android","archived":false,"fork":false,"pushed_at":"2019-01-15T02:41:44.000Z","size":709,"stargazers_count":140,"open_issues_count":7,"forks_count":69,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-12-10T04:10:15.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codinguser.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-03T01:08:55.000Z","updated_at":"2022-11-25T16:29:03.000Z","dependencies_parsed_at":"2022-09-26T21:40:39.520Z","dependency_job_id":null,"html_url":"https://github.com/codinguser/android_contact_picker","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codinguser%2Fandroid_contact_picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codinguser%2Fandroid_contact_picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codinguser%2Fandroid_contact_picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codinguser%2Fandroid_contact_picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codinguser","download_url":"https://codeload.github.com/codinguser/android_contact_picker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230462908,"owners_count":18229865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T05:35:11.040Z","updated_at":"2024-12-19T16:12:30.133Z","avatar_url":"https://github.com/codinguser.png","language":"Java","readme":"# Why?\n\nOften in Android development, there is need to support the following workflow:\n\n1. Display list of contacts\n2. User selects a contact\n3. Display contact details\n4. User selects a phone number\n5. Perform an action with the number\n\nThere is a standard way to call the contact list in Android, but this does not \nalways feel well-integrated in your app and does not work well expecially for tabbed\nAndroid applications. \n\nContactPicker is an Android library which allows you to easily integrate the above\nworkflow in your application with minimal effort. It uses the new Fragments API\nand asynchronous contact loading introduced in the newer versions of Android.\n\n*This library requires a minimum of Android API level 8 and above since it uses the new contact APIs introduced in Android 2.0*\n\n\n# Installation\n\nIn order to use the library, add the following line to your Gradle dependencies:\n\u003cpre\u003e \u003ccode\u003e\ncompile 'com.codinguser.android:contactpicker:3.0.0@aar'\n\u003c/code\u003e \u003c/pre\u003e\n# Usage\n\nThere are two ways to use the library. \n\n1. If you just want to open a contacts picker from within your app and then get a number, \n   do this:\n\n\t```java\n\tprivate static final int GET_PHONE_NUMBER = 3007;\n\t\n\tpublic void getContact() {\t\t\n\t\tstartActivityForResult(new Intent(this, ContactsPickerActivity.class), GET_PHONE_NUMBER);\n\t}\n\t\t\n\t// Listen for results.\n\t@Override  \n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data){\n\t    // See which child activity is calling us back.\n\t    switch (requestCode) {\n\t        case GET_PHONE_NUMBER:\n\t            // This is the standard resultCode that is sent back if the\n\t            // activity crashed or didn't doesn't supply an explicit result.\n\t        \tif (resultCode == RESULT_CANCELED){\n\t            \tToast.makeText(this, \"No phone number found\", Toast.LENGTH_SHORT).show();\n\t            } \n\t            else {\n\t            \tString phoneNumber = (String) data.getExtras().get(ContactsPickerActivity.KEY_PHONE_NUMBER);  \n\t                //Do what you wish to do with phoneNumber e.g.\n\t                //Toast.makeText(this, \"Phone number found: \" + phoneNumber , Toast.LENGTH_SHORT).show();\n\t            }\n\t        default:\n\t            break;\n\t    }\n\t}\n\t\n\t```\n\n2. If you have a tabbed application with multiple activities in Android and you \n   wish to make a contacts list as one of the tabs, then your contacts activity should \n   subclass the `ContactsPickerActivity` and override the `OnContactNumberSelected` method \n   in order to get notified when a number is selected. The default implementation of\n   `OnContactNumberSelected` just sets the number as a result and finishes the activity, \n   so make sure to override it to do what you want. \n\n# License\nThe code is provided under an MIT license, so get hacking!!\n\n# Acknowledgements\nThanks to Avi Hayun for feedback used to improve the library\n\n# Contact\nFor any inquiries, you can reach me at ngewif@codinguser.com\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodinguser%2Fandroid_contact_picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodinguser%2Fandroid_contact_picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodinguser%2Fandroid_contact_picker/lists"}