Android Programming Tutorials

(Romina) #1

TUTORIAL 32


Look Inside Yourself


In this tutorial, we will use the PackageManager to find out what operations


are all possible on a contact pulled out of the contacts database on the


device or emulator.


Step-By-Step Instructions


This tutorial starts a new application, independent from the LunchList and


Patchy applications developed in the preceding tutorials.


Note that this tutorial will not work on the Android 2.2 emulator due to


some sort of a bug, whereby contacts can be added but do not show up in


the contacts list.


Step #1: Create a Stub Project


Using Eclipse or android create project, make a project named Contacter


with a stub activity named apt.tutorial.four.Contacter. The generated


activity class should resemble the following:


package apt.tutorial.four;

import android.app.Activity;
import android.os.Bundle;

public class Contacter extends Activity
{

305
Free download pdf