Home > Google Android > Android App Development – Contact Picker Example under Android 2.0

Android App Development – Contact Picker Example under Android 2.0

Currently I’m involved in application development for Android Platform. I have been reading couple days before the book from Wrox Publishing : “Professional Android Application Development”. This gonna be only brief news how to make work  “ContactPicker” example  from chatper 5.

Maybe couple of you have tried it also for SDK 2.0 and it didn’t work because of changes in the last SDK . I guess this book is focused on Andorid 1.0 SDK which is the first one.

To push this example work you need to do change in these files: ” AndroidManifest.xml and ContentPickerTester.java“.

1. AndroidManifest.xml

</application>
<uses-sdk android:minSdkVersion=”5″ />
<uses-permission android:name=”android.permission.READ_CONTACTS” />

2. ContentPickerTester.java – Main change is because of ContatsContract class People are not supported anymore here. So your part of code should look like follwing one.  Don’t forget to import class android.provider.ContactsContract.Contacts;

Intent intent = new Intent(Intent.ACTION_PICK, android.provider.ContactsContract.Contacts.CONTENT_URI);

Over these small changes your Picker Example will work ….


Advertisements
Categories: Google Android
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: