Contact us functionality in Rails 3

This tutorial is an excellent example – and it’s Rails 3 Update: This article is a better example than the one I posted earlier, works flawlessly Second Update: I would also recommend merging-in some of the techniques outlined in this railscast on the active_attr gem, where Ryan Bates walks you through the process of setting … Read more

How to create a link to contact specific phone number via Telegram?

Update (2022): Links to phone numbers such as https://t.me/+1XXXXXXX will lead you to a web page the same as username links do, but you can only start chatting with the user if their privacy settings allows you. Old answer: It’s NOT possible to link to Telegram like this for a phone numbers so far, because … Read more

get contact info from android contact picker

Phone Numbers Phone numbers are stored in their own table and need to be queried separately. To query the phone number table use the URI stored in the SDK variable ContactsContract.CommonDataKinds.Phone.CONTENT_URI. Use a WHERE conditional to get the phone numbers for the specified contact. if (Integer.parseInt(cur.getString( cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) { Cursor pCur = cr.query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI, … Read more

iOS – add contact into Contacts?

If doing this in iOS 9 or later, you should use the Contacts framework: @import Contacts; You also need to update your Info.plist, adding a NSContactsUsageDescription to explain why your app requires access to contacts. Then, when you then want to programmatically add the contact, then you can do something like: CNAuthorizationStatus status = [CNContactStore … Read more

Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord in Android Studio

Due to the Marshmallow update Requesting Permissions at Run Time the read contact permission not work. The sample code is import android.Manifest; import android.content.ContentResolver; import android.content.pm.PackageManager; import android.database.Cursor; import android.os.Build; import android.provider.ContactsContract; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity { // … Read more

Android contacts Display Name and Phone Number(s) in single database query?

Try this code: Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI; String[] projection = new String[] {ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER}; Cursor people = getContentResolver().query(uri, projection, null, null, null); int indexName = people.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); int indexNumber = people.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); if(people.moveToFirst()) { do { String name = people.getString(indexName); String number = people.getString(indexNumber); // Do work… } while (people.moveToNext()); }