How to Declare a PackageManager object

PackageManager was added in API Level 1
Class for retrieving various kinds of information related to the application packages that are currently installed on the device.

1. In the MainActivity.java file, add the below import to the imports section.

import android.content.pm.PackageManager;

2. In the onCreate method, add the below line. This will declare a PackageManager named myPackageManager.

PackageManager myPackageManager;

3. Compile and run!

4. Next, Get a PackageManager Instance

Resources:
Professional Android 4 Application Development by Reto Meier, pg 702
http://developer.android.com/reference/android/content/pm/PackageManager.html