Absolute URI to insert a Contact - android

I was wondering if I could provide a link to be followed by a web browser (most specifically in a QRCODE) to insert a contact with the contact data already filled. I tried content://com.android.contacts in my mobile firefox but it crashed. I also couldn't find any absolute URI for this in the Android documentation. Is it possible?

If you want to do this with QR code, another phone should always have program which can parse QR code information and call system method to add contact.
But in Android you can programmatically share contact.
This link can be helpful: How to share a contact programatically in android

Related

Android: Directory data provider for PhoneLookup

I'm writing a custom Android contacts directory, I have implemented the ContactsContract.Directory provider and the search from within the phone app works fine.
The problem I am facing now is that when I have an incoming/outgoing call the Android dialer does not query the custom directory I registered. Is it possible to partake in caller ID resolution via PhoneLookup or some other way?
Also as a possible workaround I have tried implementing an outgoing/incoming call interceptor with BroadcastReceiver but I see no way of returning the contact data to the dialer. The only option I have found for displaying the data is to overlay a transparent activity over the native dialer. Is there a way to return contact data back to the dialer that sent the broadcast? Any other ideas I could try?
PS. Google uses the functionality I'm trying to implement for nearby places directory listings and Caller ID by Google.
PPS. By reading the ContactsContract implementation of PhoneLookup I stumbled upon corporate contacts directory that can be appended to the user profile's default directory, according to the code it should get queried for PhoneLookup, so I'm going to try that on Monday.

Link Android application with contacts/phonebook programmatically

I'm currently writing an App which allows to extend the standart Android contacts / phonebook. The user can add some informations / content associated with a specific contact. I want the standart phonebook to show an link to my application on every contact which has additional data in my application. For example WhatsApp is able to do so. If somebody from you phonebook has an WhatsApp account the phonebook displays a small WhatsApp icon next to the contact. If you hit the icon WhatsApp starts automatically a chat with this specific person.
My question is now how this can be achieved ? If someone can point me in the right direction it would be great.
I guess it must be done somehow with an ContentProvider. I already specified an ContentProvider but I don't know how to tell the Contacts app that this one exist or where I need to register this provider.
You need to use Contacts Provider. Class ContactsContract.Contacts provide access to all the contacts available in android mobile.
You need to have Read contacts permission in your app manifest.
<uses-permission android:name="android.permission.READ_CONTACTS" />
Refer following Android developer site.
http://developer.android.com/training/contacts-provider/index.html
Source code can be downloaded at http://developer.android.com/shareables/training/ContactsList.zip

Displaying contact details like android's native app

I am making an app that displays a list of people in a listview. When tapped, the app should transition to another screen displaying the contact details of that person loaded from a Person object i have retrieved from the DB. My question is how to display these details. In iOS, there was a ABUnknownPersonViewController that would mimic the native iOS addressbook entry to let me display the contact details in a clean and easy way. Is there anything similar for android that would let me use the People app's view or api to basically create and display a record exactly as android displays in its own People app?
your exact answer is contained here:
Open Contacts
The method described in the above link opens native contacts app and lets the user pick a contact. Then onActivityResult() comes into picture, here you can process the contact as per your requirement.
If you want to customize the look and feel you need to check here
You can retrieve the list and customize the UI.
If you just want to display a single contact's details. you can use this code. (contactId is the contactId of the contact that user picked)
Intent contactIntent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.withAppendedPath(
ContactsContract.Contacts.CONTENT_URI,
String.valueOf(contactId));
contactIntent.setData(uri);
startActivity(contactIntent);
Hope this helps.
No. You can look through the AOSP and see if the contacts app was released as open source, and if so use it. But remember that the contact app on all phones isn't the same, Samsung for example uses several different apps of their own. And some people download their own contact apps. So its impossible to have the native feel for everyone, unless you launch the contact app via an intent.

How to beam a contact from you app (using NFC) and save it in contact list on receiving device?

How would you beam a contact using your own app (and using Android Beam) to another device and have it saved in their contact list (i.e. the default contacts app). The contact on the sending device will be provided by the ContactsContract provider.
Preferably I don't want to have the other device running my app. The built-in contacts app (Android's default app) can beam and receive contacts. So it should be possible to beam a contact using a custom app to the built-in contacts app.
The answers to this question suggest that it's possible and that you can use the VCARD format.
Currently, my app will search for a contact by phone number, then display it in a new activity (which is the built-in contacts app). See below.
Uri uri = Uri.fromParts("tel", number.getText().toString(), "");
Log.d("ContactPicker", uri.toString());
startActivity(new Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT, uri));
// Example log message for the number (123)-123-1234 is "tel:(123)%20123-1234"
I'd prefer to do it this way, but don't think it's possible because I can't return the contact that was found (or the contact that was created if no existing one was found). And I need that information if I want to beam that specific contact.
I'll probably need to query all contacts, find the contact I'm looking for and save its ID.
Note: I'm using API 14
Edit
I made a proof of concept app that does this: https://github.com/dideler/HiFive
The app might be buggy. It's not maintained, but pull requests are welcome.
Yes, vCard is the way to go. It is the format that the built-in Contacts/People app will pick up. It is also the format that the app uses to store its own data, and I believe.

Pull business info from QR code

I am not sure if this can be done. I am trying to pull a business info (mainly business name) from QR code. I am using zxing and I am able to scan it and get the URL. Now is there any other hidden info such as business name, address ..etc that I can pull from the QR code. If not, then can I use the URL maybe to get some of these info? Pleeease any insight is appreciate to how it can be achieved
PS: Ultimitally, I want the business to be shown on google map. Thats all
If the company name is recorded in a standard format in the QR code, like vCard encoding using the "ORG" attribute, then yes you can parse the raw text you get back by Intent from Barcode Scanner zxing using its ResultParser class. It will detect and parse vCard and you will get an AddressBookParsedResult object with an "org" property with this info.
Otherwise you're talking about guessing from free-form text what the company name is. There's no way to do that with zxing and that's a generally hard problem.

Categories

Resources