Giter Site home page Giter Site logo

contacts's People

Contributors

ewg777 avatar itzhardev avatar nixsm avatar stavfx avatar tamir7 avatar vbauer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contacts's Issues

phone number list getting in random sequence for single contact

List contactList = Contacts.getQuery().find();

I am getting random sequence for phone number when particular contact has multiple phone number.

I want it in the same order as we have stored on that contact, the sequence should not be changed.

Example :
Contact name : Mitesh Machhoya
Type : Mobile ---> 54682 58795
Type : Mobile ---> 24586 97412
Type : Home ---> 35648 71454
etc...

when I retrieve the list of numbers from "Mitesh Machhoya" contact, its giving random sequence of the phone numbers

can anyone help me?

Issues when returning results from API

Sorry for my bad English but I have problems with your library and need your help.

1 : When I add new contact or new number in my contacts, this API did not return correct results I desired. Which takes a while to display the correct new results.

2 : Some contact without number did not show even though I did not set "hasPhoneNumber()".

Thanks.

Library fetches phone contacts only

I am trying to get contact name using phone number but it returns null when the contact is in sim.

This is my code:

          fun getContactName(phone: String): String{
             val query = Contacts.getQuery()
             query.whereEqualTo(Contact.Field.PhoneNumber, phone)
             val contacts = query.find()
             return if (contacts.isNotEmpty())
                 contacts[0].displayName

             else
                 ""
         }
 

Exception

Fatal Exception: java.lang.RuntimeException: Parcel: unable to marshal value com.github.tamir7.contacts.Contact@bafece
at android.os.Parcel.writeValue(Parcel.java:1711)
at android.os.Parcel.writeList(Parcel.java:865)
at android.os.Parcel.writeValue(Parcel.java:1658)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:777)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1506)
at android.os.Bundle.writeToParcel(Bundle.java:1181)
at android.os.Parcel.writeBundle(Parcel.java:817)
at android.support.v4.app.FragmentState.writeToParcel(Unknown Source:53)
at android.os.Parcel.writeTypedArray(Parcel.java:1401)
at android.support.v4.app.FragmentManagerState.writeToParcel(Unknown Source:2)
at android.os.Parcel.writeParcelable(Parcel.java:1730)
at android.os.Parcel.writeValue(Parcel.java:1636)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:777)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1506)
at android.os.Bundle.writeToParcel(Bundle.java:1181)
at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:4617)
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3998)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Cant read contacts on some devices

Hi ,

Great library first of all very useful.

I have tested this library on couple of devices but on some i cant get contacts at all for example: AM405, HTC , Galaxy J2.

Does this library supports contacts from sources like SIM, local, or Google/CardDav accounts ? or just local ?

Thanks

getNumber

its normal that getNumber return normalizedNumber?

class PhoneNumber

/**
     * Gets the phone number.
     *
     * @return phone number.
     */
    public String getNumber() {
        return normalizedNumber;
    }

    /**
     * Gets the normalized phone number.
     *
     * @return normalized phone number.
     */
    public String getNormalizedNumber() {
        return normalizedNumber;
    }

Retrieve contacts by account type (i.e. Google, Phone Only, Whatsapp Contacts)

Hi,

When i retrieve the list of contacts i am getting all the contacts for all my accounts in device. e.g. My friend's name is "Smith John" and he is registered on WhatsApp and Skype. So after i make query, it shows WhatsApp, Skype, Phone device only and google contact with same name but 4 times in result. So my basic question is as below.

Is it possible to load the contacts only associated with WhatsApp?

Please ask me any question if you got any doubts.

Thanks,
Ankur

Phone numbers stored with spaces

Some devices store the phone numbers with spaces in the contacts db, which makes it currently impossible to search for unless you know where the exact spaces are.
There should be a method or it should always remove spaces when comparing.

E.g.
Phone storage Contact.Field.PhoneNumber = "123 456 789"
To find this contact I can't use whereEqualTo("123456789")
cos it won't match

Move away from JCenter

@tamir7 Are you planning to host the repository on some other platform such as mavenCentral, as jCenter will officially be discontinued starting May, 1st?

ENHANCEMENT: Fetch Contacts via CONTACT_LAST_UPDATED_TIMESTAMP

Behavior: Pass date to Contacts API which fetches all contacts with ContactsContract.Contacts.CONTACT_LAST_UPDATED_TIMESTAMP later than passed value.

Usage: This would be a useful enhancement to detect changes to the contact database. Whenever a Content Observer detects a change in the contacts database, it could fetch the changed contacts based on the CONTACT_LAST_UPDATED_TIMESTAMP. This allows for efficient contacts management as it removes the need to iterate through the entire contacts library when changes are detected.

MinSdk

Hi,

Is there any reason for the minApi 16 ?
Cheers

Add support for LOOKUP_KEY

Hi @tamir7.
First off, good work with this great library.

Would you consider support for retrieving the lookup key?
And possibly a findContact(String lookupKey) method?

PhoneNumbers not populated

Hello,

I'm making a simple query such as :

Query q = Contacts.getQuery();
List<Contact> contacts = q.find();

Some of the contacts don't have PhoneNumbers populated whereas it is filled on the System stock Contact application.
Any idea ?...
Cheers

Query.include() without Field.ContactId will returns only last Contact

In the latest version Contact.InternalField.ContactId was moved to Contact.Field.ContactId causing Query.buildProjection() to exclude this field if not added when calling Query.include().

When iterating through the cursor in Query.find(ids), CursorHelper.getContactId() will always return null causing the contactsMap to be overriden with every new Contact.

IMO, adding projection.add(Contact.Field.ContactId.getColumn()); to Query.buildProjection() should do the trick

Find contact by id

Now that there is an id field visible within the Contact, do you intend on making the find contact by id a public query?

If not, how do you currently pass the Contact object to a new activity without it being a Parceable object? Do you just pass the display name to the new activity and then make query to find the Contact that way?

Thanks

Make the Contact Serializable?

Awesome library, able to fetch contacts fast. Is it possible to make the Contact object serializable? I am storing it in an array list and was hoping to pass it to every activity.

getGivenName() always null?

The following code is resulting in contacts that never have a first name, but I know that some of them do:

Query q = Contacts.getQuery();
q.hasPhoneNumber();
q.include(Contact.Field.DisplayName, Contact.Field.GivenName, Contact.Field.FamilyName);
List<Contact> contacts = q.find();

for (Contact contact : contacts) {
    Log.d(TAG, "Display: " + contact.getDisplayName());
    if (contact.getGivenName() != null) {
        Log.d(TAG, "First: " + contact.getGivenName());
    }
    if (contact.getFamilyName() != null) {
        Log.d(TAG, "Last: " + contact.getFamilyName());
    }
    Log.d(TAG, "\n");
}

Am I missing something, or is there a bug?

Displaying a Contact's photo uri

Hey,
I'm trying to display a contact's photoUri using UIL, and it's failing with the following FailReason:

java.lang.IllegalArgumentException:` URI: content://com.android.contacts/contacts/54971/photo/photo, calling user: , calling package:

Do you have any idea why this might happen?

If not, how would you suggest displaying photos retrieved from Contacts using contact.getPhotoUri()?

Thanks!

Repo Maintenance

Are you still maintaining this?

If you no longer have time, I'd love to help.

How to limit query?

We are building an app relying on this library to load device contacts. But problem arise when user have more than 3000 contacts in their device. I think it would be great if you can provide a limit function in this library. I know that you are using ContentResolver to load your contact, but there should be a way to limit the query.

Thanks

Bug - Miss sql escaping when using WHERE statement

Issue kind: BUG
Version: 1.1.3

While using where clause you should escape your query with

DatabaseUtils.sqlEscapeString(query)

or

query.replaceAll("'", "\'\'")

otherwise if LIKE operator of this query 'lior will raise

Caused by: java.lang.IllegalArgumentException: Unterminated quote in '( display_name LIKE '%'lior%' AND mimetype IN ('vnd.android.cursor.item/phone_v2', 'vnd.android.cursor.item/email_v2') )'

First/Last name support?

Great library!
But sometimes I need to query for the First name and Last name separately.
Any plans to add such a feature?

Thanks!

Not able to get values of relation,organisation and note

Hey great work.....!!! but I want to use some other filelds value from contact book like relation,organisation and note so how I can get the values of relation,organisation and note fields from contact book please guide me how i can get these values

Contact Update Event

Hello,

your API is very beautiful and easy to use. Thanks. Can you add event listeners for contact update or contact add which brings back that contact that was updated or added.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.