addressbook - Get address in contacts using Android SDK -
I am trying to retrieve the contact's name, phone number, and address from the Android contact list. The name and phone are very straight forward but the address is not accessible from the API level.
Has anyone ever thought about how to get the contact's address? Apart from this, 2.0 has a completely new API. How can I take advantage of this and how can I fall back to the old API using 1 binary? If this is also possible.
Before Android 2.0, you need to ask contacts. Contact. To receive CONTENT_URI, you must have postal addresses that you have to pass
contact. Contact. PERSON_ID + "=" and "+ contacts. ContactMedinKIND +" =? "
for the selection and for the selectArgs parameter <
As 2.0 you can use new contacts which is more complex because a contact can now gather information in many sources, there are some good group postings on the new API and.
< P> It is recommended to target multiple platform APIs from the same binary, use this reflection (see this). If you have targeted your app to 1.6 or less in the manifest, but to set the build path to take the Android 2.0 jar file, you can call 2.0 episodes without the need for reflection. There is a need to be worried that 2.0 classes dependent on classes are not loaded into 1.6 devices or they will throw a class loader. To avoid this, you need to depend on the dependency (or the framework like a device) To break, you have to use some kind of factory. For further discussions see this.
Comments
Post a Comment