Android contact extractor library is entitled to provide, simple contacts extraction API's to fetch contact from 'Contact' application

Overview

Android-Contact-Extractor-Library

platform Download API License

Extract all the contacts from android 'Contacts' application by using simple easy-to-use apis. It helps to remove the overhead of querying contact content provider.

Prerequisites

Add permission in AndriodManifest.xml:

<uses-permission android:name="android.permission.READ_CONTACTS"/>

Dependency

Add this to your module's build.gradle

Gradle

dependencies {
	...
	implementation 'com.coderconsole.cextracter:contact-extractor:1.0.0'
}

Maven

<dependency>
  <groupId>com.coderconsole.cextracter</groupId>
  <artifactId>contact-extractor</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Ivy

<dependency org='com.coderconsole.cextracter' name='contact-extractor' rev='1.0.0'>
  <artifact name='contact-extractor' ext='pom' ></artifact>
</dependency>

Output

Extract all the contacts from android 'Contacts' application by using simple easy-to-use apis. It helps to remove the overhead of querying contact content provider.

Name Phone
name phone

Examples:

Extract all the PHONE - Its contains home/work/phone/other contacts within as HashSet<String>
    CQuery cQuery = CQuery.getInstance(getActivity());
    cQuery.filter(ICFilter.ONLY_PHONE);
    cQuery.build(new IContact() {
        @Override
        public void onContactSuccess(List<CList> cList) {
            if (cList != null && cList.size() > 0) {
                CPhone cPhone = cList.getcPhone();
                HashSet<String> home = cPhone.getHome();
                HashSet<String> work = cPhone.getWork();
                HashSet<String> mobile = cPhone.getMobile();
                HashSet<String> other = cPhone.getOther();
            }

        }

        @Override
        public void onContactError(Throwable throwable) {

        }
    });
Extract all the Email - It contains home/work/phone/other contacts as simple HashSet<String>
    CQuery cQuery = CQuery.getInstance(getActivity());
    cQuery.filter(ICFilter.ONLY_EMAIL);
    cQuery.build(new IContact() {
        @Override
        public void onContactSuccess(List<CList> cList) {
            if (cList != null && cList.size() > 0) {
                  CEmail cEmail = cList.getcEmail();
                  HashSet<String> home = cEmail.getHome();
                  HashSet<String> work = cEmail.getWork();
                  HashSet<String> mobile = cEmail.getMobile();
                  HashSet<String> other = cEmail.getOther();
            }

        }

        @Override
        public void onContactError(Throwable throwable) {

        }
    });
Extract all the Account - It name and its type e.g name - [email protected]/ type - com.google.com
    CQuery cQuery = CQuery.getInstance(getActivity());
    cQuery.filter(ICFilter.ONLY_ACCOUNT);
    cQuery.build(new IContact() {
        @Override
        public void onContactSuccess(List<CList> cList) {
            if (cList != null && cList.size() > 0) {
                   CAccount cAccount = cList.getcAccount();
            }

        }

        @Override
        public void onContactError(Throwable throwable) {

        }
    });

Bingo Thats it !!!. Just change filter types and get the contact information accordingly.

Acknowledgement

RxAndroid

Thank You

Please do follows us on TWITTER and check out BLOG. #codingIsAnArt

Licence

    Copyright (C) 2021 Nitesh Tiwari.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
You might also like...
An android application that displays public apis' for developers to use
An android application that displays public apis' for developers to use

An android application that displays public apis' for developers to use. This application implements adaptive layout by use of a sliding pane layout

GitHub application fetches events, repositories and profile using GitHub APIs
GitHub application fetches events, repositories and profile using GitHub APIs

GitHub application using GitHub REST API Dagger MVVM architecture Mockk Jetpack Compose Kotlin Coroutines Application pages Attention If you want to u

This console based application calculates sales tax, import duty and provide a way to print the invoice

Sales Tax Problem This console based application calculates sales tax, import du

A simple Discord bot that aims to provide a snapshot of the join logs given a range of time for servers.
A simple Discord bot that aims to provide a snapshot of the join logs given a range of time for servers.

🧋 What is Humpy Dumpy? Humpy Dumpy is a simple Discord bot that aims to provide a snapshot of the join logs given a range of time for servers. It was

Wiremock-testing - WireMock - A great library to mock APIs in your tests and supports Junit5
Wiremock-testing - WireMock - A great library to mock APIs in your tests and supports Junit5

WireMock Testing WireMock is a great library to mock APIs in your tests and supp

Android library for finding connected devices on same WiFi network. It can provide IP Address, device name, MAC Address and vendor names.
Android library for finding connected devices on same WiFi network. It can provide IP Address, device name, MAC Address and vendor names.

Android WiFi Tools Android library for finding connected devices on the same WiFi network. It can provide IP Addresses, device names, MAC Address and

A general purpose kotlin library that use kotlin coroutines, flows and channels to provide timer features with the most easy and efficient way

Timer Timer is a general purpose kotlin library that use kotlin coroutines, flows and channels to provide timer features with the most easy and effici

Android samples for Google Workspace APIs

Google Workspace Android Samples A collection of samples that demonstrate how to call Google Workspace APIs from Android. Products Drive Deprecation A

A Mars Photos app for Android using NASA APIs with MVVM + Clean Architecture

Mars Photos App 🚀 Mars Photos App for Android that display a list of photos taken from cameras from different rovers - Made with Hilt, Coroutines, Re

Owner
Nitesh Tiwari
Application Engineer
Nitesh Tiwari
Allows usage of vCard resources with the Android contacts provider

vcard4android vcard4android is an Android library that brings together VCard and Android. It's a framework for parsing and generating VCard resources

bitfire web engineering 7 Dec 15, 2022
A Free, open source Contacts Butler App built with kotlin

Contacts Butler Do you have a bunch of contacts that are missing a lot of info such as names, emails, phone numbers, etc? Do you really know the conta

Android Contacts Butlers 1 Nov 30, 2021
MovieLibrary -An android application which uses tmdb API to fetch the data for various movies and TV Shows

MovieLibrary -An android application which uses tmdb API to fetch the data for various movies and TV Shows

null 1 May 1, 2022
inderjeet yadav 2 May 5, 2022
Android port of Simon Tatham's Puzzles. *git replace in use* - you might want to {{ git fetch origin 'refs/replace/*:refs/replace/*' }}

This is the README accompanying the source code to Simon Tatham's puzzle collection. The collection's web site is at <https://www.chiark.greenend.org.

Chris Boyle 470 Dec 22, 2022
Newesy is news app which uses NewsAPI to fetch news.

Newesy is news app which uses NewsAPI to fetch news.The main aim of this app was to learn Modern Android Architecture (MVVM).It uses MVVM,Kotlin-coroutines,Room,ViewModal,Retrofit,GSON and Navigation graph

SHANTANU RATHOD 7 Oct 29, 2022
An app to fetch a random user and display the results on UI

An app to fetch a random user and display the results on UI

Patricio J. Conti 4 Aug 11, 2022
Easy and quick contact management with no ads, handles groups and favorites too.

Simple Contacts A simple app for creating or managing your contacts from any source. The contacts can be stored on your device only, but also synchron

Simple Mobile Tools 621 Dec 26, 2022
Android application that implements location and network related Android APIs

Location and network data collection Location and network data collection with Android's telephonyManager class. Introduction Technologies Android's A

jquk 0 Oct 31, 2021
A full-stack application showing the power 💪 of KOTLIN. Entire android app + backend Apis written in Kotlin 🔥

Gamebaaz ?? A full-stack application showing the power ?? of KOTLIN. Entire android app + backend Apis written in Kotlin ?? Android Backend Jetpack Co

Sarnava Konar 85 Nov 17, 2022