Merge change 20409 into donut

* changes:
  Split AdbWinApi.dll into two dlls to remove dependency on WINUSB.DLL
diff --git a/build/sdk.atree b/build/sdk.atree
index 4b7b4a9..9136e5e 100644
--- a/build/sdk.atree
+++ b/build/sdk.atree
@@ -78,6 +78,7 @@
 development/samples/Snake platforms/${PLATFORM_NAME}/samples/Snake
 development/samples/SoftKeyboard platforms/${PLATFORM_NAME}/samples/SoftKeyboard
 development/samples/JetBoy platforms/${PLATFORM_NAME}/samples/JetBoy
+development/samples/SearchableDictionary platforms/${PLATFORM_NAME}/samples/SearchableDictionary
 
 # dx
 bin/dx platforms/${PLATFORM_NAME}/tools/dx
diff --git a/build/tools/make_windows_sdk.sh b/build/tools/make_windows_sdk.sh
index 7b6a17b..2a6433a 100755
--- a/build/tools/make_windows_sdk.sh
+++ b/build/tools/make_windows_sdk.sh
@@ -19,25 +19,26 @@
 TEMP_DIR="$3"
 [ -z "$TEMP_DIR" ] && TEMP_DIR=${TMP:-/tmp}
 
-
 function die() {
-  echo "Error:" $*
-  echo "Aborting"
-  exit 1
+    echo "Error:" $*
+    echo "Aborting"
+    exit 1
 }
 
 function usage() {
-  echo "Usage: ${PROG_NAME} linux_or_mac_sdk.zip output_dir [temp_dir]"
-  echo "If temp_dir is not given, \$TMP is used. If that's missing, /tmp is used."
-  status
-  exit 2
+    local NAME
+    NAME=`basename ${PROG_NAME}`
+    echo "Usage: ${NAME} linux_or_mac_sdk.zip output_dir [temp_dir]"
+    echo "If temp_dir is not given, \$TMP is used. If that's missing, /tmp is used."
+    status
+    exit 2
 }
 
 function status() {
-  echo "Current values:"
-  echo "- Input  SDK: ${SDK_ZIP:-missing}"
-  echo "- Output dir: ${DIST_DIR:-missing}"
-  echo "- Temp   dir: ${TEMP_DIR:-missing}"
+    echo "Current values:"
+    echo "- Input  SDK: ${SDK_ZIP:-missing}"
+    echo "- Output dir: ${DIST_DIR:-missing}"
+    echo "- Temp   dir: ${TEMP_DIR:-missing}"
 }
 
 function check() {
@@ -114,6 +115,10 @@
         "Instead found " $THE_PLATFORM
     [[ -d "$PLATFORM_TOOLS" ]] || die "Missing folder $PLATFORM_TOOLS."
 
+    # Package USB Driver
+    if type package_usb_driver 2>&1 | grep -q function ; then
+        package_usb_driver $TEMP_SDK_DIR
+    fi
 
     # Remove obsolete stuff from tools & platform
     TOOLS="$TEMP_SDK_DIR/tools"
@@ -190,14 +195,14 @@
     # Now move the final zip from the temp dest to the final dist dir
     mv -v "$TEMP_DIR/$DEST_NAME_ZIP" "$DIST_DIR/$DEST_NAME_ZIP"
 
-    echo "Done"
-    echo
-    echo "Resulting SDK is in $DIST_DIR/$DEST_NAME_ZIP"
-
     # We want fastboot and adb next to the new SDK
     for i in fastboot.exe adb.exe AdbWinApi.dll; do
         mv -vf out/host/windows-x86/bin/$i "$DIST_DIR"/$i
     done
+
+    echo "Done"
+    echo
+    echo "Resulting SDK is in $DIST_DIR/$DEST_NAME_ZIP"
 }
 
 check
diff --git a/cmds/monkey/Android.mk b/cmds/monkey/Android.mk
index 6bedc43..ba9cf04 100644
--- a/cmds/monkey/Android.mk
+++ b/cmds/monkey/Android.mk
@@ -7,6 +7,7 @@
 LOCAL_MODULE := monkey
 include $(BUILD_JAVA_LIBRARY)
 
+################################################################
 include $(CLEAR_VARS)
 ALL_PREBUILT += $(TARGET_OUT)/bin/monkey
 $(TARGET_OUT)/bin/monkey : $(LOCAL_PATH)/monkey | $(ACP)
diff --git a/cmds/monkey/README.NETWORK.txt b/cmds/monkey/README.NETWORK.txt
new file mode 100644
index 0000000..f3f69d4
--- /dev/null
+++ b/cmds/monkey/README.NETWORK.txt
@@ -0,0 +1,86 @@
+SIMPLE PROTOCOL FOR AUTOMATED NETWORK CONTROL
+
+The Simple Protocol for Automated Network Control was designed to be a
+low-level way to programmability inject KeyEvents and MotionEvents
+into the input system.  The idea is that a process will run on a host
+computer that will support higher-level operations (like conditionals,
+etc.) and will talk (via TCP over ADB) to the device in Simple
+Protocol for Automated Network Control.  For security reasons, the
+Monkey only binds to localhost, so you will need to use adb to setup
+port forwarding to actually talk to the device.
+
+INITIAL SETUP
+
+Setup port forwarding from a local port on your machine to a port on
+the device:
+
+$ adb forward tcp:1080 tcp:1080
+
+Start the monkey server
+
+$ adb shell monkey --port 1080
+
+Now you're ready to run commands
+
+COMMAND LIST
+
+Individual commands are separated by newlines.  The Monkey will
+respond to every command with a line starting with OK for commands
+that executed without a problem, or a line starting with ERROR for
+commands that had problems being run.  The Monkey may decide to return
+more information about command execution.  That information would come
+on the same line after the OK or ERROR.  A possible example:
+
+key down menu
+OK
+touch monkey
+ERROR: monkey not a number
+
+The complete list of commands follows:
+
+key [down|up] keycode
+
+This command injects KeyEvent's into the input system.  The keycode
+parameter refers to the KEYCODE list in the KeyEvent class
+(http://developer.android.com/reference/android/view/KeyEvent.html).
+The format of that parameter is quite flexible.  Using the menu key as
+an example, it can be 82 (the integer value of the keycode),
+KEYCODE_MENU (the name of the keycode), or just menu (and the Monkey
+will add the KEYCODE part).  Do note that this last part doesn't work
+for things like KEYCODE_1 for obvious reasons.
+
+Note that sending a full button press requires sending both the down
+and the up event for that key
+
+touch [down|up|move] x y
+
+This command injects a MotionEvent into the input system that
+simulates a user touching the touchscreen (or a pointer event).  x and
+y specify coordinates on the display (0 0 being the upper left) for
+the touch event to happen.  Just like key events, touch events at a
+single location require both a down and an up.  To simulate dragging,
+send a "touch down", then a series of "touch move" events (to simulate
+the drag), followed by a "touch up" at the final location.
+
+trackball dx dy
+
+This command injects a MotionEvent into the input system that
+simulates a user using the trackball. dx and dy indicates the amount
+of change in the trackball location (as opposed to exact coordinates
+that the touch events use)
+
+flip [open|close]
+
+This simulates the opening or closing the keyboard (like on dream).
+
+OTHER NOTES
+
+There are some convenience features added to allow running without
+needing a host process.
+
+Lines starting with a # character are considered comments.  The Monkey
+eats them and returns no indication that it did anything (no ERROR and
+no OK).
+
+You can put the Monkey to sleep by using the "sleep" command with a
+single argument, how many ms to sleep.
diff --git a/cmds/monkey/example_script.txt b/cmds/monkey/example_script.txt
new file mode 100644
index 0000000..5c1c61d
--- /dev/null
+++ b/cmds/monkey/example_script.txt
@@ -0,0 +1,57 @@
+# Touch the android
+touch down 160 200
+touch up 160 200
+sleep 1000
+
+# Hit Next
+touch down 300 450
+touch up 300 450
+sleep 1000
+
+# Hit Next
+touch down 300 450
+touch up 300 450
+sleep 1000
+
+# Hit Next
+touch down 300 450
+touch up 300 450
+sleep 1000
+
+# Go down and select the account username
+key down dpad_down
+key up dpad_down
+key down dpad_down
+key up dpad_down
+key down dpad_center
+key up dpad_center
+# account name: bill
+key down b
+key up b
+key down i
+key up i
+key down l
+key up l
+key down l
+key up l
+
+# Go down to the password field
+key down dpad_down
+key up dpad_down
+
+# password: bill
+key down b
+key up b
+key down i
+key up i
+key down l
+key up l
+key down l
+key up l
+
+# Select next
+touch down 300 450
+touch up 300 450
+
+# quit
+quit
diff --git a/cmds/monkey/src/com/android/commands/monkey/Monkey.java b/cmds/monkey/src/com/android/commands/monkey/Monkey.java
index 7ebd727..6b10147 100644
--- a/cmds/monkey/src/com/android/commands/monkey/Monkey.java
+++ b/cmds/monkey/src/com/android/commands/monkey/Monkey.java
@@ -47,10 +47,10 @@
  * Application that injects random key events and other actions into the system.
  */
 public class Monkey {
-    
+
     /**
      * Monkey Debugging/Dev Support
-     * 
+     *
      * All values should be zero when checking in.
      */
     private final static int DEBUG_ALLOW_ANY_STARTS = 0;
@@ -74,20 +74,20 @@
 
     /** Ignore any not responding timeouts while running? */
     private boolean mIgnoreTimeouts;
-    
+
     /** Ignore security exceptions when launching activities */
     /** (The activity launch still fails, but we keep pluggin' away) */
     private boolean mIgnoreSecurityExceptions;
-    
+
     /** Monitor /data/tombstones and stop the monkey if new files appear. */
     private boolean mMonitorNativeCrashes;
-    
+
     /** Send no events.  Use with long throttle-time to watch user operations */
     private boolean mSendNoEvents;
 
     /** This is set when we would like to abort the running of the monkey. */
     private boolean mAbort;
-    
+
     /** This is set by the ActivityController thread to request collection of ANR trace files */
     private boolean mRequestAnrTraces = false;
 
@@ -96,7 +96,7 @@
 
     /** Kill the process after a timeout or crash. */
     private boolean mKillProcessAfterError;
-    
+
     /** Generate hprof reports before/after monkey runs */
     private boolean mGenerateHprof;
 
@@ -106,16 +106,16 @@
     ArrayList<String> mMainCategories = new ArrayList<String>();
     /** Applications we can switch to. */
     private ArrayList<ComponentName> mMainApps = new ArrayList<ComponentName>();
-    
+
     /** The delay between event inputs **/
     long mThrottle = 0;
-    
+
     /** The number of iterations **/
     int mCount = 1000;
-    
+
     /** The random number seed **/
     long mSeed = 0;
-    
+
     /** Dropped-event statistics **/
     long mDroppedKeyEvents = 0;
     long mDroppedPointerEvents = 0;
@@ -124,14 +124,17 @@
 
     /** a filename to the script (if any) **/
     private String mScriptFileName = null;
-    
+
+    /** a TCP port to listen on for remote commands. */
+    private int mServerPort = -1;
+
     private static final File TOMBSTONES_PATH = new File("/data/tombstones");
     private HashSet<String> mTombstones = null;
-    
-    float[] mFactors = new float[MonkeySourceRandom.FACTORZ_COUNT];    
+
+    float[] mFactors = new float[MonkeySourceRandom.FACTORZ_COUNT];
     MonkeyEventSource mEventSource;
     private MonkeyNetworkMonitor mNetworkMonitor = new MonkeyNetworkMonitor();
-    
+
     /**
      * Monitor operations happening in the system.
      */
@@ -144,7 +147,7 @@
             }
             return allow;
         }
-        
+
         public boolean activityResuming(String pkg) {
             System.out.println("    // activityResuming(" + pkg + ")");
             boolean allow = checkEnteringPackage(pkg) || (DEBUG_ALLOW_ANY_RESTARTS != 0);
@@ -156,7 +159,7 @@
             }
             return allow;
         }
-        
+
         private boolean checkEnteringPackage(String pkg) {
             if (pkg == null) {
                 return true;
@@ -168,7 +171,7 @@
                 return mValidPackages.contains(pkg);
             }
         }
-        
+
         public boolean appCrashed(String processName, int pid, String shortMsg,
                 String longMsg, byte[] crashData) {
             System.err.println("// CRASH: " + processName + " (pid " + pid
@@ -223,14 +226,14 @@
             return 1;
         }
     }
-  
+
     /**
      * Run the procrank tool to insert system status information into the debug report.
      */
     private void reportProcRank() {
       commandLineReport("procrank", "procrank");
     }
-  
+
     /**
      * Run "cat /data/anr/traces.txt".  Wait about 5 seconds first, to let the asynchronous
      * report writing complete.
@@ -238,21 +241,21 @@
     private void reportAnrTraces() {
         try {
             Thread.sleep(5 * 1000);
-        } catch (InterruptedException e) { 
+        } catch (InterruptedException e) {
         }
         commandLineReport("anr traces", "cat /data/anr/traces.txt");
     }
-    
+
     /**
      * Run "dumpsys meminfo"
-     * 
+     *
      * NOTE:  You cannot perform a dumpsys call from the ActivityController callback, as it will
      * deadlock.  This should only be called from the main loop of the monkey.
      */
     private void reportDumpsysMemInfo() {
         commandLineReport("meminfo", "dumpsys meminfo");
     }
-    
+
     /**
      * Print report from a single command line.
      * @param reportName Simple tag that will print before the report and in various annotations.
@@ -266,7 +269,7 @@
         try {
             // Process must be fully qualified here because android.os.Process is used elsewhere
             java.lang.Process p = Runtime.getRuntime().exec(command);
-            
+
             // pipe everything from process stdout -> System.err
             InputStream inStream = p.getInputStream();
             InputStreamReader inReader = new InputStreamReader(inStream);
@@ -275,7 +278,7 @@
             while ((s = inBuffer.readLine()) != null) {
                 System.err.println(s);
             }
-            
+
             int status = p.waitFor();
             System.err.println("// " + reportName + " status was " + status);
         } catch (Exception e) {
@@ -307,26 +310,26 @@
                 Debug.waitForDebugger();
             }
         }
-        
+
         // Default values for some command-line options
         mVerbose = 0;
         mCount = 1000;
         mSeed = 0;
         mThrottle = 0;
-        
+
         // prepare for command-line processing
         mArgs = args;
         mNextArg = 0;
-        
+
         //set a positive value, indicating none of the factors is provided yet
         for (int i = 0; i < MonkeySourceRandom.FACTORZ_COUNT; i++) {
             mFactors[i] = 1.0f;
         }
-        
+
         if (!processOptions()) {
             return -1;
         }
-        
+
         // now set up additional data in preparation for launch
         if (mMainCategories.size() == 0) {
             mMainCategories.add(Intent.CATEGORY_LAUNCHER);
@@ -348,11 +351,11 @@
                 }
             }
         }
-        
+
         if (!checkInternalConfiguration()) {
             return -2;
         }
-        
+
         if (!getSystemInterfaces()) {
             return -3;
         }
@@ -360,11 +363,14 @@
         if (!getMainApps()) {
             return -4;
         }
-        
+
         if (mScriptFileName != null) {
             // script mode, ignore other options
             mEventSource = new MonkeySourceScript(mScriptFileName, mThrottle);
             mEventSource.setVerbose(mVerbose);
+        } else if (mServerPort != -1) {
+            mEventSource = new MonkeySourceNetwork(mServerPort);
+            mCount = Integer.MAX_VALUE;
         } else {
             // random source by default
             if (mVerbose >= 2) {    // check seeding performance
@@ -378,7 +384,7 @@
                     ((MonkeySourceRandom) mEventSource).setFactors(i, mFactors[i]);
                 }
             }
-            
+
             //in random mode, we start with a random activity
             ((MonkeySourceRandom) mEventSource).generateActivity();
         }
@@ -387,7 +393,7 @@
         if (!mEventSource.validate()) {
             return -5;
         }
-        
+
         if (mScriptFileName != null) {
             // in random mode, count is the number of single events
             // while in script mode, count is the number of repetition
@@ -396,12 +402,12 @@
             mCount = mCount * ((MonkeySourceScript) mEventSource)
                 .getOneRoundEventCount();
         }
-        
+
         // If we're profiling, do it immediately before/after the main monkey loop
         if (mGenerateHprof) {
             signalPersistentProcesses();
         }
-        
+
         mNetworkMonitor.start();
         int crashedAtCycle = runMonkeyCycles();
         mNetworkMonitor.stop();
@@ -423,7 +429,7 @@
                 System.out.println("// Generated profiling reports in /data/misc");
             }
         }
-        
+
         try {
             mAm.setActivityController(null);
             mNetworkMonitor.unregister(mAm);
@@ -434,7 +440,7 @@
                 crashedAtCycle = mCount - 1;
             }
         }
-        
+
         // report dropped event stats
         if (mVerbose > 0) {
             System.out.print(":Dropped: keys=");
@@ -446,7 +452,7 @@
             System.out.print(" flips=");
             System.out.println(mDroppedFlipEvents);
         }
-        
+
         // report network stats
         mNetworkMonitor.dump();
 
@@ -461,10 +467,10 @@
             return 0;
         }
     }
-    
+
     /**
      * Process the command-line options
-     * 
+     *
      * @return Returns true if options were parsed with no apparent errors.
      */
     private boolean processOptions() {
@@ -498,28 +504,28 @@
                 } else if (opt.equals("--hprof")) {
                     mGenerateHprof = true;
                 } else if (opt.equals("--pct-touch")) {
-                    mFactors[MonkeySourceRandom.FACTOR_TOUCH] = 
+                    mFactors[MonkeySourceRandom.FACTOR_TOUCH] =
                         -nextOptionLong("touch events percentage");
                 } else if (opt.equals("--pct-motion")) {
-                    mFactors[MonkeySourceRandom.FACTOR_MOTION] = 
+                    mFactors[MonkeySourceRandom.FACTOR_MOTION] =
                         -nextOptionLong("motion events percentage");
                 } else if (opt.equals("--pct-trackball")) {
-                    mFactors[MonkeySourceRandom.FACTOR_TRACKBALL] = 
+                    mFactors[MonkeySourceRandom.FACTOR_TRACKBALL] =
                         -nextOptionLong("trackball events percentage");
                 } else if (opt.equals("--pct-nav")) {
-                    mFactors[MonkeySourceRandom.FACTOR_NAV] = 
+                    mFactors[MonkeySourceRandom.FACTOR_NAV] =
                         -nextOptionLong("nav events percentage");
                 } else if (opt.equals("--pct-majornav")) {
-                    mFactors[MonkeySourceRandom.FACTOR_MAJORNAV] = 
+                    mFactors[MonkeySourceRandom.FACTOR_MAJORNAV] =
                         -nextOptionLong("major nav events percentage");
                 } else if (opt.equals("--pct-appswitch")) {
-                    mFactors[MonkeySourceRandom.FACTOR_APPSWITCH] = 
+                    mFactors[MonkeySourceRandom.FACTOR_APPSWITCH] =
                         -nextOptionLong("app switch events percentage");
                 } else if (opt.equals("--pct-flip")) {
                     mFactors[MonkeySourceRandom.FACTOR_FLIP] =
                         -nextOptionLong("keyboard flip percentage");
                 } else if (opt.equals("--pct-anyevent")) {
-                    mFactors[MonkeySourceRandom.FACTOR_ANYTHING] = 
+                    mFactors[MonkeySourceRandom.FACTOR_ANYTHING] =
                         -nextOptionLong("any events percentage");
                 } else if (opt.equals("--throttle")) {
                     mThrottle = nextOptionLong("delay (in milliseconds) to wait between events");
@@ -527,7 +533,9 @@
                     // do nothing - it's caught at the very start of run()
                 } else if (opt.equals("--dbg-no-events")) {
                     mSendNoEvents = true;
-                } else  if (opt.equals("-f")) {
+                } else if (opt.equals("--port")) {
+                    mServerPort = (int) nextOptionLong("Server port to listen on for commands");
+                } else if (opt.equals("-f")) {
                     mScriptFileName = nextOptionData();
                 } else if (opt.equals("-h")) {
                     showUsage();
@@ -544,19 +552,23 @@
             return false;
         }
 
-        String countStr = nextArg();
-        if (countStr == null) {
-            System.err.println("** Error: Count not specified");
-            showUsage();
-            return false;
-        }
+        // If a server port hasn't been specified, we need to specify
+        // a count
+        if (mServerPort == -1) {
+            String countStr = nextArg();
+            if (countStr == null) {
+                System.err.println("** Error: Count not specified");
+                showUsage();
+                return false;
+            }
 
-        try {
-            mCount = Integer.parseInt(countStr);
-        } catch (NumberFormatException e) {
-            System.err.println("** Error: Count is not a number");
-            showUsage();
-            return false;
+            try {
+                mCount = Integer.parseInt(countStr);
+            } catch (NumberFormatException e) {
+                System.err.println("** Error: Count is not a number");
+                showUsage();
+                return false;
+            }
         }
 
         return true;
@@ -564,7 +576,7 @@
 
     /**
      * Check for any internal configuration (primarily build-time) errors.
-     * 
+     *
      * @return Returns true if ready to rock.
      */
     private boolean checkInternalConfiguration() {
@@ -585,7 +597,7 @@
 
     /**
      * Attach to the required system interfaces.
-     * 
+     *
      * @return Returns true if all system interfaces were available.
      */
     private boolean getSystemInterfaces() {
@@ -621,7 +633,7 @@
     /**
      * Using the restrictions provided (categories & packages), generate a list of activities
      * that we can actually switch to.
-     * 
+     *
      * @return Returns true if it could successfully build a list of target activities
      */
     private boolean getMainApps() {
@@ -644,7 +656,7 @@
                 final int NA = mainApps.size();
                 for (int a = 0; a < NA; a++) {
                     ResolveInfo r = mainApps.get(a);
-                    if (mValidPackages.size() == 0 || 
+                    if (mValidPackages.size() == 0 ||
                             mValidPackages.contains(r.activityInfo.applicationInfo.packageName)) {
                         if (mVerbose >= 2) {     // very verbose
                             System.out.println("//   + Using main activity "
@@ -676,15 +688,15 @@
             System.out.println("** No activities found to run, monkey aborted.");
             return false;
         }
-        
+
         return true;
     }
 
     /**
      * Run mCount cycles and see if we hit any crashers.
-     * 
+     *
      * TODO: Meta state on keys
-     * 
+     *
      * @return Returns the last cycle which executed. If the value == mCount, no errors detected.
      */
     private int runMonkeyCycles() {
@@ -749,9 +761,11 @@
                 } else if (injectCode == MonkeyEvent.INJECT_ERROR_SECURITY_EXCEPTION) {
                     systemCrashed = !mIgnoreSecurityExceptions;
                 }
+            } else {
+                // Event Source has signaled that we have no more events to process
+                break;
             }
         }
-
         // If we got this far, we succeeded!
         return mCount;
     }
@@ -775,18 +789,18 @@
 
     /**
      * Watch for appearance of new tombstone files, which indicate native crashes.
-     * 
+     *
      * @return Returns true if new files have appeared in the list
      */
     private boolean checkNativeCrashes() {
         String[] tombstones = TOMBSTONES_PATH.list();
-        
+
         // shortcut path for usually empty directory, so we don't waste even more objects
         if ((tombstones == null) || (tombstones.length == 0)) {
             mTombstones = null;
             return false;
         }
-        
+
         // use set logic to look for new files
         HashSet<String> newStones = new HashSet<String>();
         for (String x : tombstones) {
@@ -804,14 +818,14 @@
     /**
      * Return the next command line option.  This has a number of special cases which
      * closely, but not exactly, follow the POSIX command line options patterns:
-     *  
+     *
      * -- means to stop processing additional options
      * -z means option z
      * -z ARGS means option z with (non-optional) arguments ARGS
      * -zARGS means option z with (optional) arguments ARGS
      * --zz means option zz
      * --zz ARGS means option zz with (non-optional) arguments ARGS
-     * 
+     *
      * Note that you cannot combine single letter options;  -abc != -a -b -c
      *
      * @return Returns the option string, or null if there are no more options.
@@ -857,10 +871,10 @@
         mNextArg++;
         return data;
     }
-    
+
     /**
      * Returns a long converted from the next data argument, with error handling if not available.
-     * 
+     *
      * @param opt The name of the option.
      * @return Returns a long converted from the argument.
      */
@@ -904,6 +918,7 @@
       System.err.println("              [--pct-appswitch PERCENT] [--pct-flip PERCENT]");
       System.err.println("              [--pct-anyevent PERCENT]");
       System.err.println("              [--wait-dbg] [--dbg-no-events] [-f scriptfile]");
+      System.err.println("              [--port port]");
       System.err.println("              [-s SEED] [-v [-v] ...] [--throttle MILLISEC]");
       System.err.println("              COUNT");
   }
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceNetwork.java b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceNetwork.java
new file mode 100644
index 0000000..de784d0
--- /dev/null
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceNetwork.java
@@ -0,0 +1,376 @@
+/*
+ * Copyright 2009, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.commands.monkey;
+
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.lang.Integer;
+import java.lang.NumberFormatException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/**
+ * An Event source for getting Monkey Network Script commands from
+ * over the network.
+ */
+public class MonkeySourceNetwork implements MonkeyEventSource {
+    private static final String TAG = "MonkeyStub";
+
+    private interface MonkeyCommand {
+        MonkeyEvent translateCommand(List<String> command);
+    }
+
+    /**
+     * Command to simulate closing and opening the keyboard.
+     */
+    private static class FlipCommand implements MonkeyCommand {
+        // flip open
+        // flip closed
+        public MonkeyEvent translateCommand(List<String> command) {
+            if (command.size() > 1) {
+                String direction = command.get(1);
+                if ("open".equals(direction)) {
+                    return new MonkeyFlipEvent(true);
+                } else if ("close".equals(direction)) {
+                    return new MonkeyFlipEvent(false);
+                }
+            }
+            return null;
+        }
+    }
+
+    /**
+     * Command to send touch events to the input system.
+     */
+    private static class TouchCommand implements MonkeyCommand {
+        // touch [down|up|move] [x] [y]
+        // touch down 120 120
+        // touch move 140 140
+        // touch up 140 140
+        public MonkeyEvent translateCommand(List<String> command) {
+            if (command.size() == 4) {
+                String actionName = command.get(1);
+                int x = 0;
+                int y = 0;
+                try {
+                    x = Integer.parseInt(command.get(2));
+                    y = Integer.parseInt(command.get(3));
+                } catch (NumberFormatException e) {
+                    // Ok, it wasn't a number
+                    Log.e(TAG, "Got something that wasn't a number", e);
+                    return null;
+                }
+
+                // figure out the action
+                int action = -1;
+                if ("down".equals(actionName)) {
+                    action = MotionEvent.ACTION_DOWN;
+                } else if ("up".equals(actionName)) {
+                    action = MotionEvent.ACTION_UP;
+                } else if ("move".equals(actionName)) {
+                    action = MotionEvent.ACTION_MOVE;
+                }
+                if (action == -1) {
+                    Log.e(TAG, "Got a bad action: " + actionName);
+                    return null;
+                }
+
+                return new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_POINTER,
+                                             -1, action, x, y, 0);
+            }
+            return null;
+
+        }
+    }
+
+    /**
+     * Command to send Trackball events to the input system.
+     */
+    private static class TrackballCommand implements MonkeyCommand {
+        // trackball [dx] [dy]
+        // trackball 1 0 -- move right
+        // trackball -1 0 -- move left
+        public MonkeyEvent translateCommand(List<String> command) {
+            if (command.size() == 3) {
+                int dx = 0;
+                int dy = 0;
+                try {
+                    dx = Integer.parseInt(command.get(1));
+                    dy = Integer.parseInt(command.get(2));
+                } catch (NumberFormatException e) {
+                    // Ok, it wasn't a number
+                    Log.e(TAG, "Got something that wasn't a number", e);
+                    return null;
+                }
+                return new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_TRACKBALL, -1,
+                    MotionEvent.ACTION_MOVE, dx, dy, 0);
+
+            }
+            return null;
+        }
+    }
+
+    /**
+     * Command to send Key events to the input system.
+     */
+    private static class KeyCommand implements MonkeyCommand {
+        // key [down|up] [keycode]
+        // key down 82
+        // key up 82
+        public MonkeyEvent translateCommand(List<String> command) {
+            if (command.size() == 3) {
+                int keyCode = -1;
+                String keyName = command.get(2);
+                try {
+                    keyCode = Integer.parseInt(keyName);
+                } catch (NumberFormatException e) {
+                    // Ok, it wasn't a number, see if we have a
+                    // keycode name for it
+                    keyCode = MonkeySourceRandom.getKeyCode(keyName);
+                    if (keyCode == -1) {
+                        // OK, one last ditch effort to find a match.
+                        // Build the KEYCODE_STRING from the string
+                        // we've been given and see if that key
+                        // exists.  This would allow you to do "key
+                        // down menu", for example.
+                        keyCode = MonkeySourceRandom.getKeyCode("KEYCODE_" + keyName.toUpperCase());
+                        if (keyCode == -1) {
+                            // Ok, you gave us something bad.
+                            Log.e(TAG, "Can't find keyname: " + keyName);
+                            return null;
+                        }
+                    }
+                }
+                Log.d(TAG, "keycode: " + keyCode);
+                int action = -1;
+                if ("down".equals(command.get(1))) {
+                    action = KeyEvent.ACTION_DOWN;
+                } else if ("up".equals(command.get(1))) {
+                    action = KeyEvent.ACTION_UP;
+                }
+                if (action == -1) {
+                    Log.e(TAG, "got unknown action.");
+                    return null;
+                }
+                return new MonkeyKeyEvent(action, keyCode);
+            }
+            return null;
+        }
+    }
+
+    /**
+     * Command to put the Monkey to sleep.
+     */
+    private static class SleepCommand implements MonkeyCommand {
+        // sleep 2000
+        public MonkeyEvent translateCommand(List<String> command) {
+            if (command.size() == 2) {
+                int sleep = -1;
+                String sleepStr = command.get(1);
+                try {
+                    sleep = Integer.parseInt(sleepStr);
+                } catch (NumberFormatException e) {
+                    Log.e(TAG, "Not a number: " + sleepStr, e);
+                }
+                return new MonkeyThrottleEvent(sleep);
+            }
+            return null;
+        }
+    }
+
+    // This maps from command names to command implementations.
+    private static final Map<String, MonkeyCommand> COMMAND_MAP = new HashMap<String, MonkeyCommand>();
+
+    static {
+        // Add in all the commands we support
+        COMMAND_MAP.put("flip", new FlipCommand());
+        COMMAND_MAP.put("touch", new TouchCommand());
+        COMMAND_MAP.put("trackball", new TrackballCommand());
+        COMMAND_MAP.put("key", new KeyCommand());
+        COMMAND_MAP.put("sleep", new SleepCommand());
+    }
+
+    // QUIT command
+    private static final String QUIT = "quit";
+
+    // command response strings
+    private static final String OK = "OK";
+    private static final String ERROR = "ERROR";
+
+
+    private final int port;
+    private BufferedReader input;
+    private PrintWriter output;
+    private boolean started = false;
+
+    public MonkeySourceNetwork(int port) {
+        this.port = port;
+    }
+
+    /**
+     * Start a network server listening on the specified port.  The
+     * network protocol is a line oriented protocol, where each line
+     * is a different command that can be run.
+     *
+     * @param port the port to listen on
+     */
+    private void startServer() throws IOException {
+        // Only bind this to local host.  This means that you can only
+        // talk to the monkey locally, or though adb port forwarding.
+        ServerSocket server = new ServerSocket(port,
+                                               0, // default backlog
+                                               InetAddress.getLocalHost());
+        Socket s = server.accept();
+        input = new BufferedReader(new InputStreamReader(s.getInputStream()));
+        // auto-flush
+        output = new PrintWriter(s.getOutputStream(), true);
+    }
+
+    /**
+     * This function splits the given line into String parts.  It obey's quoted
+     * strings and returns them as a single part.
+     *
+     * "This is a test" -> returns only one element
+     * This is a test -> returns four elements
+     *
+     * @param line the line to parse
+     * @return the List of elements
+     */
+    private static List<String> commandLineSplit(String line) {
+        ArrayList<String> result = new ArrayList<String>();
+        StringTokenizer tok = new StringTokenizer(line);
+
+        boolean insideQuote = false;
+        StringBuffer quotedWord = new StringBuffer();
+        while (tok.hasMoreTokens()) {
+            String cur = tok.nextToken();
+            if (!insideQuote && cur.startsWith("\"")) {
+                // begin quote
+                quotedWord.append(cur);
+                insideQuote = true;
+            } else if (insideQuote) {
+                // end quote
+                if (cur.endsWith("\"")) {
+                    insideQuote = false;
+                    quotedWord.append(cur);
+                    String word = quotedWord.toString();
+
+                    // trim off the quotes
+                    result.add(word.substring(1, word.length() - 1));
+                } else {
+                    quotedWord.append(cur);
+                }
+            } else {
+                result.add(cur);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Translate the given command line into a MonkeyEvent.
+     *
+     * @param commandLine the full command line given.
+     * @returns the MonkeyEvent corresponding to the command, or null
+     * if there was an issue.
+     */
+    private MonkeyEvent translateCommand(String commandLine) {
+        Log.d(TAG, "translateCommand: " + commandLine);
+        List<String> parts = commandLineSplit(commandLine);
+        if (parts.size() > 0) {
+            MonkeyCommand command = COMMAND_MAP.get(parts.get(0));
+            if (command != null) {
+                return command.translateCommand(parts);
+            }
+            return null;
+        }
+        return null;
+    }
+
+    public MonkeyEvent getNextEvent() {
+        if (!started) {
+            try {
+                startServer();
+            } catch (IOException e) {
+                Log.e(TAG, "Got IOException from server", e);
+                return null;
+            }
+            started = true;
+        }
+
+        // Now, get the next command.  This call may block, but that's OK
+        try {
+            while (true) {
+                String command = input.readLine();
+                if (command == null) {
+                    Log.d(TAG, "Connection dropped.");
+                    return null;
+                }
+                // Do quit checking here
+                if (QUIT.equals(command)) {
+                    // then we're done
+                    Log.d(TAG, "Quit requested");
+                    // let the host know the command ran OK
+                    output.println(OK);
+                    return null;
+                }
+
+                // Do comment checking here.  Comments aren't a
+                // command, so we don't echo anything back to the
+                // user.
+                if (command.startsWith("#")) {
+                  // keep going
+                  continue;
+                }
+
+                // Translate the command line
+                MonkeyEvent event = translateCommand(command);
+                if (event != null) {
+                    // let the host know the command ran OK
+                    output.println(OK);
+                    return event;
+                }
+                // keep going.  maybe the next command will make more sense
+                Log.e(TAG, "Got unknown command! \"" + command + "\"");
+                output.println(ERROR);
+            }
+        } catch (IOException e) {
+            Log.e(TAG, "Exception: ", e);
+            return null;
+        }
+    }
+
+    public void setVerbose(int verbose) {
+        // We're not particualy verbose
+    }
+
+    public boolean validate() {
+        // we have no pre-conditions to validate
+        return true;
+    }
+}
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
index 5f9c10f..27c8a51 100644
--- a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
@@ -31,7 +31,7 @@
 /**
  * monkey event queue
  */
-public class MonkeySourceRandom implements MonkeyEventSource {    
+public class MonkeySourceRandom implements MonkeyEventSource {
     /** Key events that move around the UI. */
     private static final int[] NAV_KEYS = {
         KeyEvent.KEYCODE_DPAD_UP, KeyEvent.KEYCODE_DPAD_DOWN,
@@ -55,7 +55,7 @@
     /** Nice names for all key events. */
     private static final String[] KEY_NAMES = {
         "KEYCODE_UNKNOWN",
-        "KEYCODE_MENU",
+        "KEYCODE_SOFT_LEFT",
         "KEYCODE_SOFT_RIGHT",
         "KEYCODE_HOME",
         "KEYCODE_BACK",
@@ -146,7 +146,7 @@
         "KEYCODE_REWIND",
         "KEYCODE_FORWARD",
         "KEYCODE_MUTE",
-        
+
         "TAG_LAST_KEYCODE"      // EOL.  used to keep the lists in sync
     };
 
@@ -158,34 +158,50 @@
     public static final int FACTOR_SYSOPS       = 5;
     public static final int FACTOR_APPSWITCH    = 6;
     public static final int FACTOR_FLIP         = 7;
-    public static final int FACTOR_ANYTHING     = 8;    
+    public static final int FACTOR_ANYTHING     = 8;
     public static final int FACTORZ_COUNT       = 9;    // should be last+1
-    
-    
+
+
     /** percentages for each type of event.  These will be remapped to working
      * values after we read any optional values.
-     **/    
+     **/
     private float[] mFactors = new float[FACTORZ_COUNT];
     private ArrayList<ComponentName> mMainApps;
     private int mEventCount = 0;  //total number of events generated so far
     private MonkeyEventQueue mQ;
-    private Random mRandom;    
+    private Random mRandom;
     private int mVerbose = 0;
     private long mThrottle = 0;
 
     private boolean mKeyboardOpen = false;
 
-    /** 
+    /**
      * @return the last name in the key list
      */
     public static String getLastKeyName() {
         return KEY_NAMES[KeyEvent.getMaxKeyCode() + 1];
     }
-    
+
     public static String getKeyName(int keycode) {
         return KEY_NAMES[keycode];
     }
-    
+
+    /**
+     * Looks up the keyCode from a given KEYCODE_NAME.  NOTE: This may
+     * be an expensive operation.
+     *
+     * @param keyName the name of the KEYCODE_VALUE to lookup.
+     * @returns the intenger keyCode value, or -1 if not found
+     */
+    public static int getKeyCode(String keyName) {
+        for (int x = 0; x < KEY_NAMES.length; x++) {
+            if (KEY_NAMES[x].equals(keyName)) {
+                return x;
+            }
+        }
+        return -1;
+    }
+
     public MonkeySourceRandom(long seed, ArrayList<ComponentName> MainApps, long throttle) {
         // default values for random distributions
         // note, these are straight percentages, to match user input (cmd line args)
@@ -199,7 +215,7 @@
         mFactors[FACTOR_APPSWITCH] = 2.0f;
         mFactors[FACTOR_FLIP] = 1.0f;
         mFactors[FACTOR_ANYTHING] = 15.0f;
-        
+
         mRandom = new SecureRandom();
         mRandom.setSeed((seed == 0) ? -1 : seed);
         mMainApps = MainApps;
@@ -220,25 +236,25 @@
             } else {
                 defaultSum += mFactors[i];
                 ++defaultCount;
-            }            
+            }
         }
-        
+
         // if the user request was > 100%, reject it
         if (userSum > 100.0f) {
             System.err.println("** Event weights > 100%");
             return false;
         }
-        
+
         // if the user specified all of the weights, then they need to be 100%
         if (defaultCount == 0 && (userSum < 99.9f || userSum > 100.1f)) {
             System.err.println("** Event weights != 100%");
             return false;
         }
-        
+
         // compute the adjustment necessary
         float defaultsTarget = (100.0f - userSum);
         float defaultsAdjustment = defaultsTarget / defaultSum;
-        
+
         // fix all values, by adjusting defaults, or flipping user values back to >0
         for (int i = 0; i < FACTORZ_COUNT; ++i) {
             if (mFactors[i] <= 0.0f) {   // user values are zero or negative
@@ -247,46 +263,46 @@
                 mFactors[i] *= defaultsAdjustment;
             }
         }
-        
+
         // if verbose, show factors
-        
+
         if (mVerbose > 0) {
             System.out.println("// Event percentages:");
             for (int i = 0; i < FACTORZ_COUNT; ++i) {
                 System.out.println("//   " + i + ": " + mFactors[i] + "%");
             }
-        } 
-        
+        }
+
         // finally, normalize and convert to running sum
         float sum = 0.0f;
         for (int i = 0; i < FACTORZ_COUNT; ++i) {
             sum += mFactors[i] / 100.0f;
             mFactors[i] = sum;
-        }        
+        }
         return true;
     }
-   
+
     /**
      * set the factors
-     * 
+     *
      * @param factors: percentages for each type of event
      */
     public void setFactors(float factors[]) {
         int c = FACTORZ_COUNT;
         if (factors.length < c) {
             c = factors.length;
-        }        
+        }
         for (int i = 0; i < c; i++)
             mFactors[i] = factors[i];
     }
-    
+
     public void setFactors(int index, float v) {
         mFactors[index] = v;
     }
-    
+
     /**
      * Generates a random motion event. This method counts a down, move, and up as multiple events.
-     * 
+     *
      * TODO:  Test & fix the selectors when non-zero percentages
      * TODO:  Longpress.
      * TODO:  Fling.
@@ -294,13 +310,13 @@
      * TODO:  More useful than the random walk here would be to pick a single random direction
      * and distance, and divvy it up into a random number of segments.  (This would serve to
      * generate fling gestures, which are important).
-     * 
+     *
      * @param random Random number source for positioning
-     * @param motionEvent If false, touch/release.  If true, touch/move/release. 
-     * 
+     * @param motionEvent If false, touch/release.  If true, touch/move/release.
+     *
      */
     private void generateMotionEvent(Random random, boolean motionEvent){
-        
+
         Display display = WindowManagerImpl.getDefault().getDefaultDisplay();
 
         float x = Math.abs(random.nextInt() % display.getWidth());
@@ -310,12 +326,12 @@
         if (downAt == -1) {
             downAt = eventTime;
         }
-        
-        MonkeyMotionEvent e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_POINTER, 
-                downAt, MotionEvent.ACTION_DOWN, x, y, 0);        
-        e.setIntermediateNote(false);        
+
+        MonkeyMotionEvent e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_POINTER,
+                downAt, MotionEvent.ACTION_DOWN, x, y, 0);
+        e.setIntermediateNote(false);
         mQ.addLast(e);
-        
+
         // sometimes we'll move during the touch
         if (motionEvent) {
             int count = random.nextInt(10);
@@ -323,34 +339,34 @@
                 // generate some slop in the up event
                 x = (x + (random.nextInt() % 10)) % display.getWidth();
                 y = (y + (random.nextInt() % 10)) % display.getHeight();
-                
-                e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_POINTER, 
-                        downAt, MotionEvent.ACTION_MOVE, x, y, 0);        
-                e.setIntermediateNote(true);        
+
+                e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_POINTER,
+                        downAt, MotionEvent.ACTION_MOVE, x, y, 0);
+                e.setIntermediateNote(true);
                 mQ.addLast(e);
             }
         }
 
         // TODO generate some slop in the up event
-        e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_POINTER, 
-                downAt, MotionEvent.ACTION_UP, x, y, 0);        
-        e.setIntermediateNote(false);        
+        e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_POINTER,
+                downAt, MotionEvent.ACTION_UP, x, y, 0);
+        e.setIntermediateNote(false);
         mQ.addLast(e);
     }
-  
+
     /**
      * Generates a random trackball event. This consists of a sequence of small moves, followed by
      * an optional single click.
-     * 
+     *
      * TODO:  Longpress.
      * TODO:  Meta state
      * TODO:  Parameterize the % clicked
      * TODO:  More useful than the random walk here would be to pick a single random direction
      * and distance, and divvy it up into a random number of segments.  (This would serve to
      * generate fling gestures, which are important).
-     * 
+     *
      * @param random Random number source for positioning
-     * 
+     *
      */
     private void generateTrackballEvent(Random random) {
         Display display = WindowManagerImpl.getDefault().getDefaultDisplay();
@@ -362,47 +378,47 @@
             // generate a small random step
             int dX = random.nextInt(10) - 5;
             int dY = random.nextInt(10) - 5;
-            
-            
-            e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_TRACKBALL, -1, 
-                    MotionEvent.ACTION_MOVE, dX, dY, 0);        
-            e.setIntermediateNote(i > 0);        
+
+
+            e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_TRACKBALL, -1,
+                    MotionEvent.ACTION_MOVE, dX, dY, 0);
+            e.setIntermediateNote(i > 0);
             mQ.addLast(e);
         }
-        
+
         // 10% of trackball moves end with a click
         if (0 == random.nextInt(10)) {
             long downAt = SystemClock.uptimeMillis();
-            
-            
-            e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_TRACKBALL, downAt, 
-                    MotionEvent.ACTION_DOWN, 0, 0, 0);        
-            e.setIntermediateNote(true);        
+
+
+            e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_TRACKBALL, downAt,
+                    MotionEvent.ACTION_DOWN, 0, 0, 0);
+            e.setIntermediateNote(true);
             mQ.addLast(e);
-            
-            
-            e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_TRACKBALL, downAt, 
-                    MotionEvent.ACTION_UP, 0, 0, 0);        
-            e.setIntermediateNote(false);        
+
+
+            e = new MonkeyMotionEvent(MonkeyEvent.EVENT_TYPE_TRACKBALL, downAt,
+                    MotionEvent.ACTION_UP, 0, 0, 0);
+            e.setIntermediateNote(false);
             mQ.addLast(e);
-        }        
+        }
     }
-    
-    /** 
+
+    /**
      * generate a random event based on mFactor
      */
-    private void generateEvents() {        
+    private void generateEvents() {
         float cls = mRandom.nextFloat();
         int lastKey = 0;
 
         boolean touchEvent = cls < mFactors[FACTOR_TOUCH];
         boolean motionEvent = !touchEvent && (cls < mFactors[FACTOR_MOTION]);
-        if (touchEvent || motionEvent) {            
+        if (touchEvent || motionEvent) {
             generateMotionEvent(mRandom, motionEvent);
             return;
         }
-        
-        if (cls < mFactors[FACTOR_TRACKBALL]) {            
+
+        if (cls < mFactors[FACTOR_TRACKBALL]) {
             generateTrackballEvent(mRandom);
             return;
         }
@@ -427,23 +443,23 @@
         } else {
             lastKey = 1 + mRandom.nextInt(KeyEvent.getMaxKeyCode() - 1);
         }
-                
+
         MonkeyKeyEvent e = new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, lastKey);
         mQ.addLast(e);
-        
+
         e = new MonkeyKeyEvent(KeyEvent.ACTION_UP, lastKey);
         mQ.addLast(e);
     }
-    
+
     public boolean validate() {
         //check factors
         return adjustEventFactors();
     }
-    
+
     public void setVerbose(int verbose) {
         mVerbose = verbose;
     }
-    
+
     /**
      * generate an activity event
      */
@@ -452,18 +468,18 @@
                 mRandom.nextInt(mMainApps.size())));
         mQ.addLast(e);
     }
-    
+
     /**
      * if the queue is empty, we generate events first
-     * @return the first event in the queue 
+     * @return the first event in the queue
      */
     public MonkeyEvent getNextEvent() {
         if (mQ.isEmpty()) {
                 generateEvents();
-        }        
-        mEventCount++;        
-        MonkeyEvent e = mQ.getFirst();        
-        mQ.removeFirst();        
+        }
+        mEventCount++;
+        MonkeyEvent e = mQ.getFirst();
+        mQ.removeFirst();
         return e;
     }
 }
diff --git a/docs/SDK_RELEASE_NOTES b/docs/SDK_RELEASE_NOTES
index e117528..381c5da 100644
--- a/docs/SDK_RELEASE_NOTES
+++ b/docs/SDK_RELEASE_NOTES
@@ -1,8 +1,8 @@
 <html>
 <head>
-<meta http-equiv="refresh" content="0;url=docs/sdk/1.1_r1/index.html">
+<meta http-equiv="refresh" content="0;url=docs/sdk/RELEASENOTES.html">
 </head>
 <body>
-<a href="docs/sdk/1.1_r1/index.html">click here if you are not redirected</a>
+<a href="docs/sdk/RELEASENOTES.html">click here if you are not redirected</a>
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/samples/SearchableDictionary/Android.mk b/samples/SearchableDictionary/Android.mk
new file mode 100755
index 0000000..8c5fdf4
--- /dev/null
+++ b/samples/SearchableDictionary/Android.mk
@@ -0,0 +1,12 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := samples
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_SDK_VERSION := current
+
+LOCAL_PACKAGE_NAME := SearchableDictionary
+
+include $(BUILD_PACKAGE)
diff --git a/samples/SearchableDictionary/AndroidManifest.xml b/samples/SearchableDictionary/AndroidManifest.xml
new file mode 100644
index 0000000..93cd47b
--- /dev/null
+++ b/samples/SearchableDictionary/AndroidManifest.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+        package="com.example.android.searchabledict">
+
+    <uses-sdk android:minSdkVersion="4" />
+
+    <application android:label="@string/app_name"
+            android:icon="@drawable/ic_dictionary">
+
+        <!-- The default activity of the app.  Can also display search results. -->
+        <activity android:name=".SearchableDictionary"
+                android:label="@string/app_name"
+                android:theme="@android:style/Theme.NoTitleBar">
+
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+
+            <!-- Receives the search request. -->
+            <intent-filter>
+                <action android:name="android.intent.action.SEARCH" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+
+            <!-- Points to searchable meta data. -->
+            <meta-data android:name="android.app.searchable"
+                    android:resource="@xml/searchable"/>
+        </activity>
+
+        <!-- Displays the definition of a word. -->
+        <activity android:name=".WordActivity"
+                android:theme="@android:style/Theme.NoTitleBar"/>
+
+        <!-- Provides search suggestions for words and their definitions. -->
+        <provider android:name="DictionaryProvider"
+                android:authorities="dictionary"
+                android:syncable="false" />
+
+    </application>
+</manifest>
diff --git a/samples/SearchableDictionary/res/drawable/ic_dictionary.gif b/samples/SearchableDictionary/res/drawable/ic_dictionary.gif
new file mode 100644
index 0000000..47cdfc2
--- /dev/null
+++ b/samples/SearchableDictionary/res/drawable/ic_dictionary.gif
Binary files differ
diff --git a/samples/SearchableDictionary/res/layout/main.xml b/samples/SearchableDictionary/res/layout/main.xml
new file mode 100644
index 0000000..d0dd522
--- /dev/null
+++ b/samples/SearchableDictionary/res/layout/main.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:orientation="vertical"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+    <TextView
+            android:id="@+id/textField"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/search_instructions"/>
+
+    <ListView
+            android:id="@+id/list"
+            android:layout_width="fill_parent"
+            android:layout_height="0dip"
+            android:layout_weight="1"/>
+</LinearLayout>
+
+
diff --git a/samples/SearchableDictionary/res/layout/word.xml b/samples/SearchableDictionary/res/layout/word.xml
new file mode 100644
index 0000000..ba1a3da
--- /dev/null
+++ b/samples/SearchableDictionary/res/layout/word.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:orientation="vertical"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+    <TextView
+            android:id="@+id/word"
+            android:textAppearance="?android:attr/textAppearanceLarge"
+            android:textSize="30sp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/search_instructions"
+            android:layout_marginLeft="10dip"
+            android:layout_marginTop="5dip" />
+    <TextView
+            android:id="@+id/definition"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/search_instructions"
+            android:layout_marginLeft="10dip" />
+</LinearLayout>
diff --git a/samples/SearchableDictionary/res/raw/definitions.txt b/samples/SearchableDictionary/res/raw/definitions.txt
new file mode 100644
index 0000000..e4e1cbd
--- /dev/null
+++ b/samples/SearchableDictionary/res/raw/definitions.txt
@@ -0,0 +1,997 @@
+abbey - n. a monastery ruled by an abbot
+abide - v. dwell; inhabit or live in
+abound - v. be abundant or plentiful; exist in large quantities
+absence - n. the state of being absent
+absorb - v. assimilate or take in
+abstinence - n. practice of refraining from indulging an appetite especially alcohol
+absurd - j. inconsistent with reason or logic or common sense
+abundant - j. present in great quantity
+abusive - j. characterized by physical or psychological maltreatment
+academic - j. associated with school or learning
+academy - n. a school for special training
+accept - v. consider or hold as true
+access - v. reach or gain access to
+accessible - j. easily obtained
+acclaim - n. enthusiastic approval
+accommodate - v. provide with something desired or needed
+accompany - v. go or travel along with
+accomplish - v. to gain with effort
+account - v. furnish a justifying analysis or explanation
+accurate - j. conforming exactly or almost exactly to fact or to a standard or performing with total accuracy
+accusation - n. an assertion that someone is guilty of a fault or offence
+accuse - v. blame for, make a claim of wrongdoing or misbehavior against
+acid - j. biting, sarcastic, or scornful
+acknowledge - v. declare to be true or admit the existence or reality or truth of
+acquire - v. come into the possession of something concrete or abstract
+acquisition - n. something acquired or received
+adamant - j. impervious to pleas, persuasion, requests, reason
+adjacent - j. having a common boundary or edge; abutting; touching
+administrator - n. someone who manages a government agency or department
+advent - n. arrival that has been awaited (especially of something momentous)
+adverse - j. contrary to your interests or welfare
+advisory - n. an announcement that usually advises or warns the public of some threat
+advocacy - n. active support of an idea or cause etc.; especially the act of pleading or arguing for something
+advocate - v. speak, plead, or argue in favor of
+affect - n. the conscious subjective aspect of feeling or emotion
+affirmative - j. affirming or giving assent
+aggression - n. violent action that is hostile and usually unprovoked
+airy - j. not practical or realizable; speculative
+album - n. a book of blank pages with pockets or envelopes; for organizing photographs or stamp collections etc
+alcohol - n. a liquor or brew containing alcohol as the active agent
+alien - j. being or from or characteristic of another place or part of the world
+allegiance - n. the loyalty that citizens owe to their country (or subjects to their sovereign)
+alley - n. a narrow street with walls on both sides
+alliance - n. a formal agreement establishing an association or alliance between nations or other groups to achieve a particular aim
+ally - n. an associate who provides cooperation or assistance
+altar - n. a raised structure on which gifts or sacrifices to a god are made
+alter - v. cause to change; make different; cause a transformation
+alternate - j. serving or used in place of another
+alternative - j. serving or used in place of another
+altitude - n. elevation especially above sea level or above the earth's surface
+amateur - j. lacking professional skill or expertise
+ambiguous - j. having more than one possible meaning
+ambitious - j. having a strong desire for success or achievement
+ambivalent - j. uncertain or unable to decide about what course to follow
+analogy - n. drawing a comparison in order to show a similarity in some respect
+analyst - n. someone who is skilled at analyzing data
+analyze - v. break down into components or essential features
+anchor - v. fix firmly and stably
+annual - j. occurring or payable every year
+anonymous - j. having no known name or identity or known source
+antichrist - n. the adversary of Christ (or Christianity) mentioned in the New Testament
+antique - j. made in or typical of earlier times and valued for its age
+anxious - j. causing or fraught with or showing anxiety
+apartheid - n. a social policy or racial segregation involving political and economic and legal discrimination against people who are not Whites
+apocalyptic - j. prophetic of devastation or ultimate doom
+apology - n. an expression of regret at having caused trouble for someone
+apparel - n. clothing in general
+apparent - j. clearly revealed to the mind or the senses or judgment
+appease - v. make peace with
+appropriate - j. suitable for a particular person or place or condition etc
+apt - j. being of striking appropriateness and pertinence
+arbitrary - j. based on or subject to individual discretion or preference or sometimes impulse or caprice
+arcade - n. a covered passageway with shops and stalls on either side
+arrange - v. put into a proper or systematic order
+arrangement - n. an orderly grouping (of things or persons) considered as a unit; the result of arranging
+arrival - n. the act of arriving at a certain place
+arrogance - n. overbearing pride evidenced by a superior manner toward inferiors
+arrogant - j. having or showing feelings of unwarranted importance out of overbearing pride
+articulate - j. expressing yourself easily or characterized by clear expressive language
+assassination - n. murder of a public figure by surprise attack
+assess - v. set or determine the amount of (a payment such as a fine)
+assets - n. anything of material value or usefulness that is owned by a person or company
+asylum - n. a shelter from danger or hardship
+auburn - j. (of hair) colored a moderate reddish-brown
+august - j. profoundly honored
+aura - n. a distinctive but intangible quality surrounding a person or thing
+austere - j. of a stern or strict bearing or demeanor; forbidding in aspect
+authentic - j. not counterfeit or copied
+authenticity - n. undisputed credibility
+authoritarian - n. a person who behaves in a tyrannical manner
+autobiography - n. a biography of yourself
+autonomous - j. existing as an independent entity
+autonomy - n. immunity from arbitrary exercise of authority: political independence
+avid - j. marked by active interest and enthusiasm
+banal - j. repeated too often; over familiar through overuse
+barring - n. the act of excluding someone by a negative vote or veto
+bass - n. the lowest adult male singing voice
+batter - n. a liquid or semiliquid mixture, as of flour, eggs, and milk, used in cooking
+belle - n. a young woman who is the most charming and beautiful of several rivals
+beneficial - j. promoting or enhancing well-being
+benefit - n. something that aids or promotes well-being
+benign - j. not dangerous to health; not recurrent or progressive (especially of a tumor)
+bid - n. a formal proposal to buy at a specified price
+biography - n. an account of the series of events making up a person's life
+biology - n. the science that studies living organisms
+blaze - n. a strong flame that burns brightly
+bleak - j. unpleasantly cold and damp
+bogus - j. fraudulent; having a misleading appearance
+bolster - v. support and strengthen
+bomb - n. an explosive device fused to explode under specific conditions
+bore - n. a person who evokes boredom
+botanical - j. of or relating to plants or botany
+boycott - n. a group's refusal to have commercial dealings with some organization in protest against its policies
+brass - n. an alloy of copper and zinc
+breach - n. an opening (especially a gap in a dike or fortification)
+broadcast - n. message that is transmitted by radio or television
+brokerage - n. the business of a broker; charges a fee to arrange a contract between two parties
+buffet - n. a meal set out on a buffet at which guests help themselves
+bumper - n. a mechanical device consisting of bars at either end of a vehicle to absorb shock and prevent serious damage
+bureau - n. an administrative unit of government
+bureaucracy - n. non elected government officials
+butt - v. to strike, thrust or shove against
+cabinet - n. persons appointed by a head of state to head executive departments of government and act as official advisers
+caliber - n. a degree or grade of excellence or worth
+campaign - n. a series of actions advancing a principle or tending toward a particular end
+canon - n. a rule or especially body of rules or principles generally established as valid and fundamental in a field or art or philosophy
+cardinal - j. serving as an essential component
+caricature - n. a representation of a person that is exaggerated for comic effect
+casual - j. without or seeming to be without plan or method; offhand
+catastrophe - n. an event resulting in great loss and misfortune
+caucus - n. a closed political meeting
+causal - j. involving or constituting a cause; causing
+censure - n. harsh criticism or disapproval
+census - n. a periodic count of the population
+cereal - n. grass whose starchy grains are used as food: wheat; rice; rye; oats; maize; buckwheat; millet
+ceremonial - j. marked by pomp or ceremony or formality
+chaos - n. a state of extreme confusion and disorder
+characteristic - n. a distinguishing quality
+chronic - j. being long-lasting and recurrent or characterized by long suffering
+citadel - n. a stronghold into which people could go for shelter during a battle
+cite - v. refer to for illustration or proof
+clumsy - j. not elegant or graceful in expression
+coalition - n. an organization of people (or countries) involved in a pact or treaty
+coherent - j. marked by an orderly, logical, and aesthetically consistent relation of parts
+coincidence - n. the temporal property of two things happening at the same time
+collapse - v. break down, literally or metaphorically
+colleague - n. an associate that one works with
+collective - j. set up on the principle of collectivism or ownership and production by the workers involved usually under the supervision of a government
+collector - n. a person who collects things
+collision - n. an accident resulting from violent impact of a moving object
+commemorate - v. mark by some ceremony or observation
+commentary - n. a written explanation or criticism or illustration that is added to a book or other textual material
+commission - n. a special group delegated to consider some matter
+commitment - n. the act of binding yourself (intellectually or emotionally) to a course of action
+commodity - n. articles of commerce
+commute - n. a regular journey of some distance to and from your place of work
+comparable - j. able to be compared or worthy of comparison
+comparison - n. the act of examining resemblances
+compassionate - j. showing or having compassion
+compensate - v. make payment to; compensate
+competence - n. the quality of being adequately or well qualified physically and intellectually
+competent - j. properly or sufficiently qualified or capable or efficient
+competitive - j. involving competition or competitiveness
+competitor - n. the contestant you hope to defeat
+complex - j. complicated in structure; consisting of interconnected parts
+component - n. an artifact that is one of the individual parts of which a composite entity is made up; especially a part that can be separated from or attached to a system
+composer - n. someone who composes music as a profession
+comprehensive - j. broad in scope
+concede - v. admit (to a wrongdoing)
+conceive - v. have the idea for
+concession - n. a point conceded or yielded
+confederate - j. united in a group or league
+confidence - n. a state of confident hopefulness that events will be favorable
+confident - j. having or marked by confidence or assurance
+confront - v. oppose, as in hostility or a competition
+conscience - n. a feeling of shame when you do something immoral
+conscious - j. knowing and perceiving; having awareness of surroundings and sensations and thoughts
+consecutive - j. one after the other
+consensus - n. agreement in the judgment or opinion reached by a group as a whole
+conservatism - n. a political or theological orientation advocating the preservation of the best in society and opposing radical changes
+conservative - j. avoiding excess
+consistency - n. a harmonious uniformity or agreement among things or parts
+conspicuous - j. obvious to the eye or mind
+conspiracy - n. a plot to carry out some harmful or illegal act (especially a political plot)
+constituency - n. the body of voters who elect a representative for their area
+consume - v. use up (resources or materials)
+consumer - n. a person who uses goods or services
+consumption - n. the process of taking food into the body through the mouth
+contemplate - v. look at thoughtfully; observe deep in thought
+contemporary - j. belonging to the present time
+contender - n. the contestant you hope to defeat
+contentious - j. inclined or showing an inclination to dispute or disagree, even to engage in law suits
+contingent - j. possible but not certain to occur
+continuous - j. continuing in time or space without interruption
+contradiction - n. opposition between two conflicting forces or ideas
+contradictory - j. unable for both to be true at the same time
+contribution - n. a voluntary gift (as of money or service or ideas) made to some worthwhile cause
+contributor - n. someone who contributes (or promises to contribute) a sum of money
+convenience - n. the quality of being useful and convenient
+conversion - n. the act of changing from one use or function or purpose to another
+convertible - j. designed to be changed from one use or form to another
+conviction - n. an unshakable belief in something without need for proof or evidence
+corporate - j. of or belonging to a corporation
+corps - n. a body of people associated together
+corruption - n. destroying someone's (or some group's) honesty or loyalty; undermining moral integrity
+cosmetic - j. serving an esthetic rather than a useful purpose
+cosmopolitan - j. of worldwide scope or applicability
+counsel - n. something that provides direction or advice as to a decision or course of action
+counterpart - n. a person or thing having the same function or characteristics as another
+courageous - j. able to face and deal with danger or fear without flinching
+course - n. a connected series of events or actions or developments
+courtesy - n. a courteous or respectful or considerate act
+credible - j. appearing to merit belief or acceptance
+critique - n. a serious examination and judgment of something
+crusade - v. exert oneself continuously, vigorously, or obtrusively to gain an end or engage in a crusade for a certain cause or person; be an advocate for
+crush - v. to compress with violence, out of natural shape or condition
+curator - n. the custodian of a collection (as a museum or library)
+curriculum - n. an integrated course of academic studies
+cynical - j. believing the worst of human nature and motives; having a sneering disbelief in e.g. selflessness of others
+cynicism - n. a cynical feeling of distrust
+daring - n. the trait of being willing to undertake things that involve risk or danger
+debacle - n. a sudden and violent collapse
+debut - v. appear for the first time in public
+decay - n. the organic phenomenon of rotting
+decency - n. the quality of conforming to standards of propriety and morality
+decent - j. socially or conventionally correct; refined or virtuous
+decisive - j. characterized by decision and firmness
+decree - n. a legally binding command or decision entered on the court record (as if issued by a court or judge)
+dedication - n. complete and wholehearted fidelity
+default - n. loss due to not showing up
+defendant - n. a person or institution against whom an action is brought in a court of law; the person being sued or accused
+defensive - j. attempting to justify or defend in speech or writing
+defiance - n. a hostile challenge
+definite - j. known for certain
+delicacy - n. something considered choice to eat
+demise - v. transfer by a lease or by a will
+demonstrate - v. establish the validity of something, as by an example, explanation or experiment
+denominator - n. the divisor of a fraction
+deposition - n. (law) a pretrial interrogation of a witness; usually conducted in a lawyer's office
+depression - n. a long-term economic state characterized by unemployment and low prices and low levels of trade and investment
+depth - n. the attribute or quality of being deep, strong, or intense
+derive - v. come from
+descent - n. properties attributable to your ancestry
+desert - n. arid land with little or no vegetation
+designate - v. give an assignment to (a person) to a post, or assign a task to (a person)
+despair - n. a state in which all hope is lost or absent
+desperate - j. showing extreme urgency or intensity especially because of great need or desire
+detect - v. discover or determine the existence, presence, or fact of
+deter - v. try to prevent; show opposition to
+determination - n. the quality of being determined to do or achieve something; firmness of purpose
+deterrent - j. tending to deter
+diagnosis - n. identifying the nature or cause of some phenomenon
+dialogue - n. a discussion intended to produce an agreement
+difference - n. the quality of being unlike or dissimilar
+dignity - n. the quality of being worthy of esteem or respect
+dilemma - n. state of uncertainty or perplexity especially as requiring a choice between equally unfavorable options
+diplomacy - n. subtly skillful handling of a situation
+diplomat - n. a person who deals tactfully with others
+diplomatic - j. using or marked by tact in dealing with sensitive matters or people
+disagree - v. be of different opinions
+disappear - v. become invisible or unnoticeable
+discern - v. detect with the senses
+discipline - n. a system of rules of conduct or method of practice
+discomfort - n. the state of being tense and feeling pain
+discourse - n. extended verbal expression in speech or writing
+discover - v. see for the first time; make a discovery
+discriminate - v. treat differently on the basis of sex or race
+discussion - n. an exchange of views on some topic
+disdain - n. lack of respect accompanied by a feeling of intense dislike
+dishonest - j. deceptive or fraudulent; disposed to cheat or defraud or deceive
+dismal - j. causing dejection
+dismay - v. fill with apprehension or alarm; cause to be unpleasantly surprised
+dismissal - n. the termination of someone's employment (leaving them free to depart)
+disparity - n. inequality or difference in some respect
+disregard - n. willful lack of care and attention
+dissent - n. a difference of opinion
+distant - j. separated in space or coming from or going to a distance
+distinction - n. a distinguishing difference
+distress - n. extreme physical pain
+distrust - v. regard as untrustworthy; regard with suspicion; have no faith or confidence in
+diverse - j. many and different
+diversion - n. an activity that diverts or amuses or stimulates
+diversity - n. noticeable heterogeneity
+divert - v. turn aside; turn away from
+document - n. writing that provides information (especially information of an official nature)
+doe - n. mature female of mammals of which the male is called 'buck'
+domain - n. territory over which rule or control is exercised
+dominance - n. the state that exists when one person or group has power over another
+dominant - j. exercising influence or control
+dominate - v. be in control
+domination - n. social control by dominating
+donate - v. give to a charity or good cause
+donor - n. person who makes a gift of property
+drastic - j. forceful and extreme and rigorous
+drought - n. a shortage of rainfall
+dubious - j. open to doubt or suspicion
+dynamics - n. the branch of mechanics concerned with the forces that cause motions of bodies
+earnest - j. characterized by a firm and humorless belief in the validity of your opinions
+eccentric - n. a person with an unusual or odd personality
+eclectic - j. selecting what seems best of various styles or ideas
+editorial - n. an article giving opinions or perspectives
+effect - n. a phenomenon that follows and is caused by some previous phenomenon
+effective - j. works well as a means or remedy
+efficiency - n. skillfulness in avoiding wasted time and effort
+efficient - j. able to accomplish a purpose; functioning effectively
+elaborate - v. add details, as to an account or idea; clarify the meaning of and discourse in a learned way, usually in writing
+element - n. any of the more than 100 known substances (of which 92 occur naturally) that cannot be separated into simpler substances and that singly or in combination constitute all matter
+eligible - j. qualified for or allowed or worthy of being chosen
+eliminate - v. terminate, end, or take out
+embargo - n. a government order imposing a trade barrier
+emblem - n. a visible symbol representing an abstract idea
+embrace - n. the act of clasping another person in the arms (as in greeting or affection)
+emerge - v. come out into view, as from concealment
+emergence - n. the gradual beginning or coming forth
+eminent - j. of imposing height; especially standing out above others
+emphasis - n. intensity or forcefulness of expression
+emphasize - v. to stress, single out as important
+employee - n. a worker who is hired to perform a job
+employer - n. a person or firm that employs workers
+emulate - v. imitate the function of (another system), as by modifying the hardware or the software
+enact - v. order by virtue of superior authority; decree
+encourage - v. inspire with confidence; give hope or courage to
+encyclopedia - n. a reference work (often in several volumes) containing articles on various topics
+endorse - v. be behind; approve of
+enduring - j. patiently bearing continual wrongs or trouble
+energetic - j. possessing or exerting or displaying energy
+enhance - v. make better or more attractive
+enormous - j. extraordinarily large in size or extent or amount or power or degree
+enthusiastic - j. having or showing great excitement and interest
+entity - n. that which is perceived or known or inferred to have its own distinct existence (living or nonliving)
+epic - j. very imposing or impressive; surpassing the ordinary (especially in size or scale)
+epidemic - n. a widespread outbreak of an infectious disease; many people are infected at the same time
+episode - n. a brief section of a literary or dramatic work that forms part of a connected series
+equilibrium - n. a stable situation in which forces cancel one another
+equity - n. the difference between the market value of a property and the claims held against it
+equivalent - j. being essentially equal to something
+error - n. a wrong action attributable to bad judgment or ignorance or inattention
+esquire - n. a title of respect for a member of the English gentry ranking just below a knight; placed after the name
+essence - n. the central meaning or theme of a speech or literary work
+evangelical - j. relating to or being a Christian church believing in personal conversion and the inerrancy of the Bible especially the 4 Gospels
+evoke - v. call to mind
+evolution - n. a process in which something passes by degrees to a different stage (especially a more advanced or mature stage)
+exceed - v. be greater in scope or size than some standard
+excellent - j. very good; of the highest quality
+excerpt - n. a passage selected from a larger work
+excess - j. more than is needed, desired, or required
+exclude - v. prevent from being included or considered or accepted
+excursion - n. a journey taken for pleasure
+exempt - v. grant relief or an exemption from a rule or requirement to
+existence - n. everything that exists anywhere
+exit - v. move out of or depart from
+exotic - j. strikingly strange or unusual
+expand - v. become larger in size or volume or quantity
+expansion - n. the act of increasing (something) in size or volume or quantity or scope
+expect - v. regard something as probable or likely
+expectancy - n. something expected (as on the basis of a norm)
+expense - n. money spent to perform work and usually reimbursed by an employer
+expertise - n. skillfulness by virtue of possessing special knowledge
+explicit - j. precisely and clearly expressed or readily observable; leaving nothing to implication
+explode - v. drive from the stage by noisy disapproval
+exploit - v. use or manipulate to one's advantage
+explosion - n. the act of exploding or bursting
+explosive - n. a chemical substance that undergoes a rapid chemical change (with the production of gas) on being heated or struck
+exposure - n. vulnerability to the elements; to the action of heat or cold or wind or rain
+expressive - j. characterized by expression
+extension - n. an addition to the length of something
+extensive - j. large in spatial extent or range or scope or quantity
+exterior - n. the outer side or surface of something
+external - j. happening or arising or located outside or beyond some limits or especially surface
+extradition - n. the surrender of an accused or convicted person by one state or country to another (usually under the provisions of a statute or treaty)
+extraordinary - j. beyond what is ordinary or usual; highly unusual or exceptional or remarkable
+extravagant - j. unrestrained, especially with regard to feelings
+exuberant - j. joyously unrestrained
+fabulous - j. extremely pleasing
+facial - j. of or concerning the face
+facility - n. something designed and created to serve a particular function and to afford a particular convenience or service
+faction - n. a dissenting clique
+faulty - j. characterized by errors; not agreeing with a model or not following established rules
+feasible - j. capable of being done with means at hand and circumstances as they are
+felony - n. a serious crime (such as murder or arson)
+feminine - j. associated with women and not with men
+fervor - n. the state of being emotionally aroused and worked up
+fetus - n. an unborn or unhatched vertebrate in the later stages of development showing the main recognizable features of the mature animal
+feud - n. a bitter quarrel between two parties
+feudal - j. of or relating to or characteristic of feudalism
+fidelity - n. the quality of being faithful
+finale - n. the concluding part of any performance
+finite - j. bounded or limited in magnitude or spatial or temporal extent
+fiscal - j. involving financial matters
+flag - n. emblem usually consisting of a rectangular piece of cloth of distinctive design
+flamboyant - j. marked by ostentation but often tasteless
+fleet - n. a group of warships organized as a tactical unit
+flexible - j. able to flex; able to bend easily
+flop - n. a complete failure
+flourish - n. a showy gesture
+foil - n. anything that serves by contrast to call attention to another thing's good qualities
+ford - v. cross a river where it's shallow
+forecast - n. a prediction about how something (as the weather) will develop
+foreign - j. relating to or originating in or characteristic of another place or part of the world
+foresee - v. act in advance of; deal with ahead of time
+formation - n. an arrangement of people or things acting as a unit
+formidable - j. extremely impressive in strength or excellence
+formula - n. directions for making something
+forte - n. an asset of special worth or utility
+forth - a. forward in time or order or degree
+foster - v. promote the growth of
+fragile - j. easily broken or damaged or destroyed
+frantic - j. excessively agitated; distraught with fear or other violent emotion
+fray - v. wear away by rubbing
+frequency - n. the number of occurrences within a given time period
+fringe - n. a social group holding marginal or extreme views
+frivolous - j. not serious in content or attitude or behavior
+frontier - n. a wilderness at the edge of a settled area of a country
+fundamental - j. being or involving basic facts or principles
+further - v. promote the growth of
+futile - j. producing no result or effect
+galaxy - n. (astronomy) a collection of star systems; any of the billions of systems each having many stars and nebulae and dust
+gamble - v. take a risk in the hope of a favorable outcome
+gauge - n. a measuring instrument for measuring and indicating a quantity such as the thickness of wire or the amount of rain etc.
+generate - v. bring into existence
+generic - j. applicable to an entire class or group
+generosity - n. the trait of being willing to give your money or time
+genesis - n. the first book of the Old Testament: tells of Creation; Adam and Eve; Cain and Abel
+gesture - n. motion of hands or body to emphasize or help to express a thought or feeling
+gigantic - j. so exceedingly large or extensive as to suggest a giant or mammoth
+gist - n. the choicest or most essential or most vital part of some idea or experience
+glimpse - n. a brief or incomplete view
+glorious - j. having great beauty and splendor
+grandeur - n. the quality of being magnificent or splendid or grand
+grandiose - j. impressive because of unnecessary largeness or grandeur; used to show disapproval
+grave - j. of great gravity or crucial import; requiring serious thought
+gravity - n. a manner that is serious and solemn
+grief - n. something that causes great unhappiness
+grotesque - j. distorted and unnatural in shape or size; abnormal and hideous
+grove - n. a small growth of trees without underbrush
+guise - n. an artful or simulated semblance
+hack - n. a mediocre and disdained writer
+hale - j. exhibiting or restored to vigorous good health
+handwriting - n. something written by hand
+harbor - v. hold back a thought or feeling about
+hazard - n. a source of danger; a possibility of incurring loss or misfortune
+heir - n. a person who is entitled by law or by the terms of a will to inherit the estate of another
+heritage - n. practices that are handed down from the past by tradition
+hilarious - j. marked by or causing boisterous merriment or convulsive laughter
+hollow - j. not solid; having a space or gap or cavity
+homage - n. respectful deference
+hostility - n. violent action that is hostile and usually unprovoked
+humane - j. marked or motivated by concern with the alleviation of suffering
+humanitarian - n. someone devoted to the promotion of human welfare and to social reforms
+hush - v. become quiet or still; fall silent
+hybrid - n. (genetics) an organism that is the offspring of genetically dissimilar parents or stock; especially offspring produced by breeding plants or animals of different varieties or breeds or species
+hypocrisy - n. insincerity by virtue of pretending to have qualities or beliefs that you do not really have
+hypothesis - n. a tentative insight into the natural world; a concept that is not yet verified but that if true would explain certain facts or phenomena
+hysteria - n. excessive or uncontrollable fear
+icon - n. a conventional religious painting in oil on a small wooden panel; venerated in the Eastern Church
+ideology - n. an orientation that characterizes the thinking of a group or nation
+illusion - n. an erroneous mental representation
+imaginary - j. not based on fact; unreal
+imitation - n. something copied or derived from an original
+immense - j. unusually great in size or amount or degree or especially extent or scope
+immigrant - n. a person who comes to a country where they were not born in order to settle there
+imminent - j. close in time; about to occur
+immoral - j. not adhering to ethical or moral principles
+immune - j. (usually followed by 'to') not affected by a given influence
+impending - j. close in time; about to occur
+implausible - j. having a quality that provokes disbelief
+implicit - j. implied though not directly expressed; inherent in the nature of something
+imply - v. express or state indirectly
+impose - v. compel to behave in a certain way
+improper - j. not suitable or right or appropriate
+impulse - n. a sudden desire
+inadequate - j. not sufficient to meet a need
+incentive - n. a positive motivational influence
+incidence - n. the relative frequency of occurrence of something
+incident - n. a public disturbance
+incidentally - a. of a minor or subordinate nature
+inclined - j. at an angle to the horizontal or vertical position
+incompetence - n. lack of physical or intellectual ability or qualifications
+inconsistent - j. displaying a lack of consistency
+inconvenient - j. not suited to your comfort, purpose or needs
+indefinitely - a. to an indefinite extent; for an indefinite time
+indicator - n. a device for showing the operating condition of some system
+indifferent - j. showing no care or concern in attitude or action
+indigenous - j. originating where it is found
+indulge - v. enjoy to excess
+inefficient - j. not producing desired results; wasteful
+inept - j. generally incompetent and ineffectual
+inevitable - j. incapable of being avoided or prevented
+inexpensive - j. relatively low in price or charging low prices
+infamous - j. known widely and usually unfavorably
+infinite - j. having no limits or boundaries in time or space or extent or magnitude
+influence - n. a power to affect persons or events especially power based on prestige etc
+influential - j. having or exercising influence or power
+influx - n. the process of flowing in
+ingenious - j. showing inventiveness and skill
+inherent - j. in the nature of something though not readily apparent
+injunction - n. (law) a judicial remedy issued in order to prohibit a party from doing or continuing to do a certain activity
+inland - a. towards or into the interior of a region
+insight - n. the clear (and often sudden) understanding of a complex situation
+insistence - n. the state of demanding notice or attention
+inspector - n. a high ranking police officer
+instance - n. an occurrence of something
+instant - n. a very short time
+insufficient - j. of a quantity not able to fulfill a need or requirement
+integral - j. essential to completeness; lacking nothing
+integrity - n. moral soundness
+intellectual - j. appealing to or using the intellect
+intelligence - n. the ability to comprehend; to understand and profit from experience
+intensive - j. characterized by a high degree or intensity; often used as a combining form
+intention - n. an act of intending; a volition that you intend to carry out
+interact - v. act together or towards others or with others
+interim - n. the time between one event, process, or period and another
+intermediate - j. lying between two extremes in time or space or state
+intervene - v. get involved, so as to alter or hinder an action, or through force or threat of force
+intervention - n. the act of intervening (as to mediate a dispute, etc.)
+intimacy - n. close or warm friendship
+intricate - j. having many complexly arranged elements; elaborate
+invasion - n. any entry into an area not previously occupied
+inventive - j. (used of persons or artifacts) marked by independence and creativity in thought or action
+investigator - n. a police officer who investigates crimes
+investor - n. someone who commits capital in order to gain financial returns
+invincible - j. incapable of being overcome or subdued
+invoke - v. cite as an authority; resort to
+involuntary - j. not subject to the control of the will
+involve - v. engage as a participant
+irony - n. incongruity between what might be expected and what actually occurs
+irrational - j. not consistent with or using reason
+irrelevant - j. having no bearing on or connection with the subject at issue
+irresistible - j. impossible to resist; overpowering
+irresponsible - j. showing lack of care for consequences
+judgment - n. the capacity to assess situations or circumstances shrewdly and to draw sound conclusions
+judicial - j. belonging or appropriate to the office of a judge
+juicy - j. lucrative
+junction - n. something that joins or connects
+jurisdiction - n. (law) the right and power to interpret and apply the law
+juror - n. someone who serves (or waits to be called to serve) on a jury
+justification - n. something (such as a fact or circumstance) that shows an action to be reasonable or necessary
+juvenile - j. of or relating to or characteristic of or appropriate for children or young people
+ken - n. range of what one can know or understand
+knight - n. originally a person of noble birth trained to arms and chivalry; today in Great Britain a person honored by the sovereign for personal merit
+knit - n. needlework created by interlacing yarn in a series of connected loops using straight eyeless needles or by machine
+lament - v. regret strongly
+landmark - n. the position of a prominent or well-known object in a particular landscape
+landscape - n. an expanse of scenery that can be seen in a single view
+lapse - n. a break or intermission in the occurrence of something
+laureate - n. someone honored for great achievements; figuratively someone crowned with a laurel wreath
+lavish - j. very generous
+lax - j. lacking in rigor or strictness
+legacy - n. (law) a gift of personal property by will
+legislative - j. relating to a legislature or composed of members of a legislature
+legitimacy - n. lawfulness by virtue of being authorized or in accordance with law
+legitimate - j. in accordance with recognized or accepted standards or principles
+leisure - n. time available for ease and relaxation
+lenient - j. not strict
+levy - v. impose and collect
+liable - j. held legally responsible
+liberalism - n. a political orientation that favors social progress by reform and by changing laws rather than by revolution
+lifelong - j. continuing through life
+lifetime - n. the period during which something is functional (as between birth and death)
+likelihood - n. the probability of a specified outcome
+liking - n. a feeling of pleasure and enjoyment
+liquor - n. an alcoholic beverage that is distilled rather than fermented
+literacy - n. the ability to read and write
+literal - j. avoiding embellishment or exaggeration (used for emphasis)
+literature - n. creative writing of recognized artistic value
+logic - n. the principles that guide reasoning within a given field or situation
+logical - j. capable of thinking and expressing yourself in a clear and consistent manner
+lovable - j. having characteristics that attract love or affection
+lucrative - j. producing a sizeable profit
+ludicrous - j. broadly or extravagantly humorous; resembling farce
+lying - n. the deliberate act of deviating from the truth
+machinery - n. machines or machine systems collectively
+magnet - n. (physics) a device that attracts iron and produces a magnetic field
+magnificent - j. characterized by grandeur
+magnitude - n. the property of relative size or extent (whether large or small)
+maintain - v. state or assert
+maintenance - n. activity involved in maintaining something in good working order
+makeup - n. the way in which someone or something is composed
+mandate - n. an authorization to act given to a representative
+mandatory - j. required by rule
+maneuver - v. act in order to achieve a certain goal
+manifesto - n. a public declaration of intentions (as issued by a political party or government)
+marine - j. native to or inhabiting the sea
+maritime - j. relating to or involving ships or shipping or navigation or seamen
+martial - j. suggesting war or military life
+marvel - v. be amazed at
+massacre - n. the savage and excessive killing of many people
+massive - j. imposing in size or bulk or solidity
+masterpiece - n. the most outstanding work of a creative artist or craftsman
+material - j. concerned with worldly rather than spiritual interests
+maternal - j. relating to or derived from one's mother
+maze - n. complex system of paths or tunnels in which it is easy to get lost
+mechanics - n. the technical aspects of doing something
+medicine - n. something that treats or prevents or alleviates the symptoms of disease
+medieval - j. as if belonging to the Middle Ages; old-fashioned and unenlightened
+mediocre - j. moderate to inferior in quality
+meditation - n. continuous and profound contemplation or musing on a subject or series of subjects of a deep or abstruse nature
+melodrama - n. an extravagant comedy in which action is more salient than characterization
+memorable - j. worth remembering
+menace - v. act in a threatening manner
+mentality - n. a habitual or characteristic mental attitude that determines how you will interpret and respond to situations
+mentor - v. serve as a teacher or trusted counselor
+metal - n. any of several chemical elements that are usually shiny solids
+metaphor - n. a figure of speech in which an expression is used to refer to something that it does not literally denote in order to suggest a similarity
+metric - j. based on the meter as a standard of measurement
+metropolis - n. a large and densely populated urban area; may include several independent administrative districts
+metropolitan - j. relating to or characteristic of a densely populated urban area
+mileage - n. the ratio of the number of miles traveled to the number of gallons of gasoline burned; miles per gallon
+militant - j. disposed to warfare or hard-line policies
+militia - n. civilians trained as soldiers but not part of the regular army
+miniature - j. being on a very small scale
+minimize - v. make small or insignificant
+ministry - n. a government department under the direction of a minister
+minority - n. being or relating to the smaller in number of two parts
+minute - j. infinitely or immeasurably small
+misdemeanor - n. a crime less serious than a felony
+missile - n. a rocket carrying a warhead of conventional or nuclear explosives
+momentum - n. an impelling force or strength
+monarchy - n. an autocracy governed by a monarch who usually inherits the authority
+monastery - n. the residence of a religious community
+monetary - j. relating to or involving money
+monopoly - n. (economics) a market in which there are many buyers but only one seller
+morale - n. the spirit of a group that makes the members want the group to succeed
+morality - n. concern with the distinction between good and evil or right and wrong; right or good conduct
+motto - n. a favorite saying of a sect or political group
+mundane - j. concerned with the world or worldly matters; ordinary
+municipal - j. relating to city government
+muster - v. gather or bring together
+myriad - n. a large indefinite number
+myth - n. a traditional story accepted as history; serves to explain the world view of a people
+mythology - n. myths collectively; the body of stories associated with a culture or institution or person
+narrative - n. a message that tells the particulars of an act or occurrence or course of events; presented in writing or drama or cinema or as a radio or television program
+narrator - n. someone who tells a story
+naturally - a. according to nature; by natural means; without artificial help
+naval - j. connected with or belonging to or used in a navy
+necessary - j. absolutely essential
+necessity - n. anything indispensable
+network - n. an interconnected system of things or people
+neutral - j. having no personal preference
+nevertheless - a. despite anything to the contrary (usually following a concession)
+noisy - j. full of or characterized by loud and nonmusical sounds
+nomination - n. the condition of having been proposed as a suitable candidate for appointment or election
+nominee - n. a politician who is running for public office
+norm - n. a standard or model or pattern regarded as typical
+notorious - j. known widely and usually unfavorably
+nude - n. without clothing (especially in the phrase 'in the nude')
+obesity - n. more than average fatness
+objective - j. undistorted by emotion or personal bias; based on observable phenomena
+observatory - n. a building designed and equipped to observe astronomical phenomena
+obsolete - j. no longer in use
+obstruction - n. something that stands in the way and must be circumvented or surmounted
+obtain - v. come into possession of
+occasion - n. a vaguely specified social event
+odor - n. the sensation that results when olfactory receptors in the nose are stimulated by particular chemicals in gaseous form
+ominous - j. threatening or foreshadowing evil or tragic developments
+operate - v. handle and cause to function
+operator - n. an agent that operates some apparatus or machine
+opinion - n. a personal belief or judgment that is not founded on proof or certainty
+opponent - n. a contestant that you are matched against
+opportunity - n. a possibility due to a favorable combination of circumstances
+optimism - n. a general disposition to expect the best in all things
+option - n. one of a number of things from which only one can be chosen
+oral - j. of or relating to or affecting or for use in the mouth
+ordeal - n. a severe or trying experience
+ornate - j. marked by elaborate rhetoric and elaborated with decorative details
+orthodox - j. adhering to what is commonly accepted
+outbreak - n. a sudden violent spontaneous occurrence (usually of some undesirable condition)
+outcry - n. a loud utterance; often in protest or opposition
+outrage - n. a feeling of righteous anger
+outrageous - j. grossly offensive to decency or morality; causing horror
+outright - a. without reservation or concealment
+overhaul - v. make repairs, renovations, revisions or adjustments to
+oversee - v. watch and direct
+overthrow - n. the termination of a ruler or institution (especially by force)
+overweight - n. the property of excessive fatness
+pact - n. a written agreement between two states or sovereigns
+pageant - n. a rich and spectacular ceremony
+panic - n. an overwhelming feeling of fear and anxiety
+pantheon - n. all the gods of a religion
+paradox - n. (logic) a statement that contradicts itself
+parallel - j. being everywhere equidistant and not intersecting
+parish - n. a local church community
+parliament - n. a legislative assembly in certain countries
+parody - v. make a spoof of or make fun of
+participant - n. someone who takes part in an activity
+participate - v. become a participant; be involved in
+partisan - n. an ardent and enthusiastic supporter of some person or activity
+partition - v. divide into parts, pieces, or sections
+passive - j. lacking in energy or will
+patriotism - n. love of country and willingness to sacrifice for it
+patron - n. someone who supports or champions something
+pavilion - n. large and often sumptuous tent
+peaceful - j. not disturbed by strife or turmoil or war
+pedestrian - j. lacking wit or imagination
+penalty - n. a punishment for a crime or offense
+penchant - n. a strong liking
+pennant - n. a long flag; often tapering
+pension - n. a regular payment to a person that is intended to allow them to subsist without working
+pentagon - n. a five-sided polygon
+perceive - v. to become aware of or conscious of
+perception - n. becoming aware of something via the senses
+perennial - j. lasting an indefinitely long time; suggesting self-renewal
+perform - v. carry out or perform an action
+perjury - n. criminal offense of making false statements under oath
+permanent - j. continuing or enduring without marked change in status or condition or place
+perpetual - j. continuing forever or indefinitely
+persist - v. be persistent, refuse to stop
+personal - j. concerning or affecting a particular person or his or her private life and personality
+personality - n. the complex of all the attributes--behavioral, temperamental, emotional and mental--that characterize a unique individual
+personnel - n. persons collectively in the employ of a business
+perspective - n. the appearance of things relative to one another as determined by their distance from the viewer
+persuade - v. cause somebody to adopt a certain position, belief, or course of action; twist somebody's arm
+pervasive - j. spreading or spread throughout
+petty - j. contemptibly narrow in outlook
+phenomenal - j. exceedingly or unbelievably great
+phenomenon - n. any state or process known through the senses rather than by intuition or reasoning
+philharmonic - j. composing or characteristic of an orchestral group
+philosophy - n. any personal belief about how to live or how to deal with a situation
+physicist - n. a scientist trained in physics
+physics - n. the science of matter and energy and their interactions
+pinch - n. a squeeze with the fingers
+pine - n. straight-grained white to yellowish tree
+pioneer - v. open up and explore a new area
+pivotal - j. being of crucial importance
+plausible - j. apparently reasonable and valid, and truthful
+playful - j. full of fun and high spirits
+playwright - n. someone who writes plays
+plea - n. a humble request for help from someone in authority
+plead - v. appeal or request earnestly
+pleasant - j. affording pleasure; being in harmony with your taste or likings
+plunge - v. fall abruptly
+poetic - j. of or relating to poetry
+poignant - j. arousing emotions; touching
+poised - j. in full control of your faculties
+portfolio - n. a set of pieces of creative work collected to be shown to potential customers or employers
+positive - j. characterized by or displaying affirmation or acceptance or certainty etc.
+possess - v. have as an attribute, knowledge, or skill
+possession - n. the act of having and controlling property
+potent - j. having a strong physiological or chemical effect
+potential - j. existing in possibility
+precedent - n. an example that is used to justify similar occurrences at a later time
+precise - j. sharply exact or accurate or delimited
+precision - n. the quality of being reproducible in amount or performance
+predecessor - n. one who precedes you in time (as in holding a position or office)
+predict - v. make a prediction about; tell in advance
+prediction - n. a statement made about the future
+prefer - v. like better; value more highly
+preference - n. a strong liking
+prejudice - n. a partiality that prevents objective consideration of an issue or situation
+premature - j. too soon or too hasty
+premier - v. be performed for the first time
+premise - v. set forth beforehand, often as an explanation
+preparation - n. the activity of putting or setting in order in advance of some act or purpose
+preposterous - j. incongruous; inviting ridicule
+prescription - n. written instructions from a physician or dentist to a druggist concerning the form and dosage of a drug to be issued to a given patient
+preservation - n. the activity of protecting something from loss or danger
+pretentious - j. making claim to or creating an appearance of (often undeserved) importance or distinction
+prevalent - j. most frequent or common
+prevention - n. the act of preventing
+primer - n. an introductory textbook
+primitive - j. belonging to an early stage of technical development; characterized by simplicity and (often) crudeness
+principal - n. the educator who has executive authority for a school
+principle - n. a basic truth or law or assumption
+principled - j. based on or manifesting objectively defined standards of rightness or morality
+pristine - j. completely free from dirt or contamination
+privilege - n. a special advantage or immunity or benefit not enjoyed by all
+probation - n. (law) a way of dealing with offenders without imprisoning them; a defendant found guilty of a crime is released by the court without imprisonment subject to conditions imposed by the court
+probe - v. question or examine thoroughly and closely
+procedure - n. a process or series of acts especially of a practical or mechanical nature involved in a particular form of work
+proceed - v. move ahead; travel onward in time or space
+productive - j. producing or capable of producing (especially abundantly)
+profession - n. an occupation requiring special education (especially in the liberal arts or sciences)
+professor - n. someone who is a member of the faculty at a college or university
+profile - n. an outline of something (especially a human face as seen from one side)
+progressive - j. favoring or promoting progress
+prohibition - n. the action of prohibiting or inhibiting or forbidding (or an instance thereof)
+prolific - j. bearing in abundance especially offspring
+promenade - n. a public area set aside as a pedestrian walk
+prominence - n. relative importance
+prominent - j. having a quality that thrusts itself into attention
+promoter - n. someone who is an active supporter and advocate
+prone - j. having a tendency (to); often used in combination
+propaganda - n. information that is spread for the purpose of promoting some cause
+prophet - n. someone who speaks by divine inspiration; someone who is an interpreter of the will of God
+protagonist - n. the principal character in a work of fiction
+protection - n. the activity of protecting someone or something
+protective - j. intended or adapted to afford protection of some kind
+protestant - j. of or relating to Protestants or Protestantism
+provincial - j. characteristic of the provinces or their people
+provoke - v. evoke or provoke to appear or occur
+proxy - n. a person authorized to act for another
+prudence - n. knowing how to avoid embarrassment or distress
+psychic - j. outside the sphere of physical science
+pundit - n. someone who has been admitted to membership in a scholarly field
+quake - v. shake with fast, tremulous movements
+qualify - v. make fit or prepared
+quarterly - a. in three month intervals
+radical - j. markedly new or introducing extreme change
+rampant - j. unrestrained and violent
+rapid - j. characterized by speed; moving with or capable of moving with high speed
+rave - v. praise enthusiastically
+reaction - n. a response that reveals a person's feelings or attitude
+readily - a. without much difficulty
+realism - n. the attribute of accepting the facts of life and favoring practicality and literal truth
+recipient - n. a person who receives something
+reckless - j. characterized by careless unconcern
+recognize - v. detect with the senses
+reconcile - v. come to terms
+reconsider - v. consider again; give new consideration to; usually with a view to changing
+recover - v. get or find back; recover the use of
+recruit - v. cause to assemble or enlist in the military
+redemption - n. (theology) the act of delivering from sin or saving from evil
+refer - v. send or direct for treatment, information, or a decision
+reflection - n. the image of something as reflected by a mirror (or other reflective material)
+reform - v. make changes for improvement in order to remove abuse and injustices
+refuge - n. a shelter from danger or hardship
+refusal - n. the act of not accepting something that is offered
+regime - n. the government or governing authority of a political unit
+regional - j. related or limited to a particular region
+reign - v. have sovereign power
+relevant - j. having a bearing on or connection with the subject at issue
+reliant - j. depending on another for support
+reluctance - n. a certain degree of unwillingness
+reluctant - j. not eager
+reminiscent - j. serving to bring to mind
+renaissance - n. the period of European history at the close of the Middle Ages and the rise of the modern world; a cultural rebirth from the 14th through the middle of the 17th centuries
+render - v. give or supply
+renowned - j. widely known and esteemed
+repeal - n. cancel officially
+reproduction - n. the act of making copies
+requisite - n. anything indispensable
+resemblance - n. similarity in appearance or external or superficial details
+resent - v. feel bitter or indignant about
+resist - v. withstand the force of something
+resistance - n. the action of opposing something that you disapprove or disagree with
+resistant - j. impervious to being affected
+resort - v. have recourse to
+resource - n. a source of aid or support that may be drawn upon when needed
+restore - v. bring back into original existence, use, function, or position
+resurrection - n. (New Testament) the rising of Christ on the third day after the Crucifixion
+retrospect - n. contemplation of things past
+retrospective - j. concerned with or related to the past
+revelation - n. communication of knowledge to man by a divine or supernatural agency
+revive - v. be brought back to life, consciousness, or strength
+rhetoric - n. using language effectively to please or persuade
+ridiculous - j. incongruous; absurd; nonsensical
+rigorous - j. demanding strict attention to rules and procedures
+robust - j. sturdy and strong in form, constitution, or construction
+rue - n. sadness associated with some wrong done or some disappointment
+rural - j. living in or characteristic of farming or country life
+rustic - j. characteristic of the fields or country
+sacrifice - v. kill or destroy
+savage - v. criticize harshly or violently
+scholarly - j. characteristic of learning or studying
+scope - n. an area in which something acts or operates or has power or control
+script - n. a written version of a play or other dramatic composition; used in preparing for a performance
+secession - n. formal separation from an alliance or federation
+secondary - j. not of major importance
+secrecy - n. the trait of keeping things secret
+secular - j. not concerned with or devoted to religion
+seize - v. take hold of; grab
+selective - j. characterized by very careful or fastidious choices
+seminar - n. any meeting for an exchange of ideas
+sensation - n. a perception associated with stimulation of a sensory organ
+sensibility - n. refined sensitivity to pleasurable or painful impressions
+sensitive - j. responsive to physical stimuli
+sentence - n. the period of time a prisoner is imprisoned
+sentinel - n. a person employed to keep watch for some anticipated event
+sequel - n. a part added to a book or play that continues and extends it
+sequence - n. serial arrangement in which things follow in logical order or a recurrent pattern
+sergeant - n. any of several noncommissioned officer ranks in the Army or Air Force or Marines ranking above a corporal
+servitude - n. state of subjection to an owner or master or forced labor imposed as punishment
+severely - a. with sternness; in a severe manner
+shallow - j. lacking depth of intellect or knowledge; concerned only with what is obvious
+sheer - j. complete and without restriction or qualification
+shrewd - j. marked by practical hardheaded intelligence
+siege - n. the action of an armed force that surrounds a fortified place and isolates it while continuing to attack
+significance - n. the quality of being important in effect or meaning
+significant - j. important in effect or meaning
+similar - j. having close to the same characteristics
+sinister - j. stemming from evil characteristics or forces; wicked or dishonorable
+skepticism - n. the disbelief in any claims of ultimate knowledge
+slack - j. not tense or taut
+slight - n. a deliberate discourteous act (usually as an expression of anger or disapproval)
+sober - v. become more realistic
+socialism - n. a political theory advocating state ownership of industry
+socialist - j. advocating or following the socialist principles of state ownership
+sociology - n. the study and classification of human societies
+solar - j. relating to or derived from the sun or utilizing the energies of the sun
+soldier - n. an enlisted man or woman who serves in an army
+somber - j. grave or even gloomy in character
+sophisticated - j. having or appealing to those having worldly knowledge and refinement
+souvenir - n. a reminder of past events
+specialty - n. an asset of special worth or utility
+species - n. (biology) taxonomic group whose members can interbreed
+spectator - n. a close observer; someone who looks at something (such as an exhibition of some kind)
+specter - n. a ghostly appearing figure
+spectrum - n. a broad range of related objects or ideas or activities
+speculate - v. consider in an idle or casual way and with an element of doubt or without sufficient reason to reach a conclusion
+spontaneous - j. said or done without having been planned or written in advance
+static - j. showing little if any change
+stature - n. high level of respect gained by impressive development or achievement
+statute - n. an act passed by a legislative body
+stealth - n. avoiding detection by moving carefully
+stimulate - v. cause to be alert and energetic
+stringent - j. demanding strict attention to rules and procedures
+submission - n. something (manuscripts or architectural plans and models or estimates or works of art of all genres etc.) submitted for the judgment of others (as in a competition)
+subsequent - j. following in time or order
+subsidiary - j. functioning in a supporting capacity
+substantive - j. having a firm basis in reality and being therefore important, meaningful, or considerable
+subtle - j.  difficult to detect or grasp by the mind or analyze
+successor - n. a person who follows next in order
+summary - n. a brief statement that presents the main points in a concise form
+superb - j. of surpassing excellence
+superficial - j. concerned with or comprehending only what is apparent or obvious; not deep or penetrating emotionally or intellectually
+suppress - v. reduce the incidence or severity of or stop
+surround - v. extend on all sides of simultaneously; encircle
+suspense - n. excited anticipation of an approaching climax
+suspension - n. an interruption in the intensity or amount of something
+suspicious - j. openly distrustful and unwilling to confide
+sympathetic - j. expressing or feeling or resulting from sympathy or compassion or friendly fellow feelings; disposed toward
+symphony - n. a large orchestra; can perform symphonies
+systematic - j. characterized by order and planning
+tactics - n. the branch of military science dealing with detailed maneuvers to achieve objectives set by strategy
+tangible - j. perceptible by the senses especially the sense of touch
+taxation - n. the imposition of taxes; the practice of the government in levying taxes on the subjects of a state
+technique - n. skillfulness in the command of fundamentals deriving from practice and familiarity
+technology - n. the practical application of science to commerce or industry
+telescope - n. a magnifier of images of distant objects
+temporary - j. not permanent; not lasting
+tendency - n. a characteristic likelihood of or natural disposition toward a certain condition or character or effect
+tense - j. taut or rigid; stretched tight
+tentative - j. unsettled in mind or opinion
+tenure - v. give life-time employment to
+terminal - j. being or situated at an end
+territorial - j. displaying territoriality; defending an area from intruders
+testament - n. a profession of belief
+theological - j. of or relating to or concerning the study of religion
+theology - n. the rational and systematic study of religion and its influences and of the nature of religious truth
+theoretical - j. concerned with theories rather than their practical applications
+theorist - n. someone who theorizes (especially in science or art)
+thesis - n. a formal paper advancing a new point of view resulting from research; usually a requirement for an advanced academic degree
+titanic - j. of great force or power
+tolerance - n. willingness to recognize and respect the beliefs or practices of others
+tolerant - j. showing respect for the rights or opinions or practices of others
+tolerate - v. recognize and respect (rights and beliefs of others)
+transcript - n. something that has been transcribed; a written record (usually typewritten) of dictated or recorded speech
+transfer - v. move from one place to another
+transition - v. make or undergo a transition (from one state or system to another)
+translate - v. restate (words) from one language into another language
+transmission - n. the act of sending a message; causing a message to be transmitted
+transparent - j. transmitting light; able to be seen through with clarity
+transplant - n. the act of removing something from one location and introducing it in another location
+tremendous - j. extraordinarily large in size or extent or amount or power or degree
+tribune - n. a protector of the people
+trinity - n. the union of the Father and Son and Holy Ghost in one Godhead
+triple - v. increase threefold
+trivial - j. of little substance or significance
+truthful - j. expressing or given to expressing the truth
+turmoil - n. a violent disturbance
+typical - j. exhibiting the qualities or characteristics that identify a group or kind or category
+ubiquitous - j. being present everywhere at once
+ultimate - j. furthest or highest in degree or order; utmost or extreme
+unanimous - j. acting together as a single undiversified whole
+uncommon - j. not common or ordinarily encountered; unusually great in amount or remarkable in character or kind
+unconscious - j. not conscious; lacking awareness and the capacity for sensory perception as if asleep or dead
+undermine - v. destroy property or hinder normal operations
+unique - j. the single one of its kind
+unlimited - j. having no limits in range or scope
+unprecedented - j. having no previous example; novel
+urban - j. located in or characteristic of a city or city life
+urgency - n. an urgent situation calling for prompt action
+usage - n. the act of using
+utility - n. the quality of being of practical use
+vacuum - n. a region that is devoid of matter
+valid - j. well grounded in logic or truth or having legal force
+variation - n. an artifact that deviates from a norm or standard
+vegetarian - n. eater of fruits and grains and nuts; someone who eats no meat or fish or (often) any animal products
+vegetation - n. all the plant life in a particular region or period
+venerable - j. impressive by reason of age
+verify - v. confirm the truth of
+version - n. something a little different from others of the same type
+vertical - j. at right angles to the plane of the horizon or a base line
+veto - n. the power or right to prohibit or reject a proposed or intended act (especially the power of a chief executive to reject a bill passed by the legislature)
+vigorous - j. strong and active physically or mentally
+violation - n. an act that disregards an agreement or a right
+vista - n. the visual percept of a region
+visual - j. relating to or using sight
+vitality - n. an energetic style
+vogue - n. the popular taste at a given time
+volatile - j. liable to lead to sudden change or violence
+vulnerable - j. capable of being wounded or hurt
+warrant - v. stand behind and guarantee the quality, accuracy, or condition of
+wherever - a. where in the world
+wholly - a. to a complete degree or to the full or entire extent ('whole' is often used informally for 'wholly')
+woo - v. seek someone's favor
+zeal - n. excessive fervor to do something or accomplish some end
diff --git a/samples/SearchableDictionary/res/values/strings.xml b/samples/SearchableDictionary/res/values/strings.xml
new file mode 100644
index 0000000..a39ba75
--- /dev/null
+++ b/samples/SearchableDictionary/res/values/strings.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+    <!-- The name of the application. -->
+    <string name="app_name">Searchable Dictionary</string>
+
+    <!-- The label for the search results for this app (see searchable.xml for more details). -->
+    <string name="search_label">Dictionary</string>
+
+    <!-- The menu entry that invokes search. -->
+    <string name="menu_search">Search</string>
+
+    <!-- The description that will show up in the search settings for this source.  -->
+    <string name="settings_description">Definitions of words</string>
+
+    <!-- General instructions in the main activity. -->
+    <string name="search_instructions">Press the search key to look up a word</string>
+
+    <!-- Shown above search results when we receive a search request. -->
+    <string name="search_results">Search results for \'<xliff:g id="string">%s</xliff:g>\': </string>
+</resources>
diff --git a/samples/SearchableDictionary/res/xml/searchable.xml b/samples/SearchableDictionary/res/xml/searchable.xml
new file mode 100644
index 0000000..1edb57c
--- /dev/null
+++ b/samples/SearchableDictionary/res/xml/searchable.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- The attributes below configure how the search results will work:
+ - the 'label' points to a short description used when searching within the application if
+   'badge mode' is used as specified with android:searchMode="useLabelAsBadge" (which it is not for
+    this application).
+ - the 'searchSettingsDescription' points to a string that will be displayed underneath the
+   name of this application in the search settings to describe what content will be searched.
+ - 'includeInGlobalSearch' will include this app's search suggestions in Quick Search Box.
+ - 'searchSuggestAuthority' specifies the authority matching the authority of the
+   "DictionaryProvider" specified in the manifest.  This means the DictionaryProvider will be
+   queried for search suggestions.
+ - 'searchSuggestIntentAction' the default intent action used in the intent that is launched based
+   on a user cilcking on a search suggestion.  This saves us from manually having to fill in the
+   SUGGEST_COLUMN_INTENT_ACTION column for each suggestion returned by the provider.
+ -->
+<searchable xmlns:android="http://schemas.android.com/apk/res/android"
+        android:label="@string/search_label"
+        android:searchSettingsDescription="@string/settings_description"
+        android:includeInGlobalSearch="true"
+        android:searchSuggestAuthority="dictionary"
+        android:searchSuggestIntentAction="android.intent.action.VIEW">
+</searchable>
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/Dictionary.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/Dictionary.java
new file mode 100644
index 0000000..59e735b
--- /dev/null
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/Dictionary.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.searchabledict;
+
+import android.content.res.Resources;
+import android.text.TextUtils;
+import android.util.Log;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Contains logic to load the word of words and definitions and find a list of matching words
+ * given a query.  Everything is held in memory; this is not a robust way to serve lots of
+ * words and is only for demo purposes.
+ *
+ * You may want to consider using an SQLite database. In practice, you'll want to make sure your
+ * suggestion provider is as efficient as possible, as the system will be taxed while performing
+ * searches across many sources for each keystroke the user enters into Quick Search Box.
+ */
+public class Dictionary {
+
+    public static class Word {
+        public final String word;
+        public final String definition;
+
+        public Word(String word, String definition) {
+            this.word = word;
+            this.definition = definition;
+        }
+    }
+
+    private static final Dictionary sInstance = new Dictionary();
+
+    public static Dictionary getInstance() {
+        return sInstance;
+    }
+
+    private final Map<String, List<Word>> mDict = new ConcurrentHashMap<String, List<Word>>();
+
+    private Dictionary() {
+    }
+
+    private boolean mLoaded = false;
+
+    /**
+     * Loads the words and definitions if they haven't been loaded already.
+     *
+     * @param resources Used to load the file containing the words and definitions.
+     */
+    public synchronized void ensureLoaded(final Resources resources) {
+        if (mLoaded) return;
+
+        new Thread(new Runnable() {
+            public void run() {
+                try {
+                    loadWords(resources);
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }).start();
+    }
+
+    private synchronized void loadWords(Resources resources) throws IOException {
+        if (mLoaded) return;
+
+        Log.d("dict", "loading words");
+        InputStream inputStream = resources.openRawResource(R.raw.definitions);
+        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+
+        try {
+            String line;
+            while((line = reader.readLine()) != null) {
+                String[] strings = TextUtils.split(line, "-");
+                if (strings.length < 2) continue;
+                addWord(strings[0].trim(), strings[1].trim());
+            }
+        } finally {
+            reader.close();
+        }
+        mLoaded = true;
+    }
+
+
+    public List<Word> getMatches(String query) {
+        List<Word> list = mDict.get(query);
+        return list == null ? Collections.EMPTY_LIST : list;
+    }
+
+    private void addWord(String word, String definition) {
+        final Word theWord = new Word(word, definition);
+
+        final int len = word.length();
+        for (int i = 0; i < len; i++) {
+            final String prefix = word.substring(0, len - i);
+            addMatch(prefix, theWord);
+        }
+    }
+
+    private void addMatch(String query, Word word) {
+        List<Word> matches = mDict.get(query);
+        if (matches == null) {
+            matches = new ArrayList<Word>();
+            mDict.put(query, matches);
+        }
+        matches.add(word);
+    }
+}
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/DictionaryProvider.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/DictionaryProvider.java
new file mode 100644
index 0000000..db626e8
--- /dev/null
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/DictionaryProvider.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.searchabledict;
+
+import android.app.SearchManager;
+import android.content.ContentProvider;
+import android.content.ContentValues;
+import android.content.UriMatcher;
+import android.content.res.Resources;
+import android.database.Cursor;
+import android.database.MatrixCursor;
+import android.net.Uri;
+import android.text.TextUtils;
+
+import java.util.List;
+
+/**
+ * Provides search suggestions for a list of words and their definitions.
+ */
+public class DictionaryProvider extends ContentProvider {
+
+    public static String AUTHORITY = "dictionary";
+
+    private static final int SEARCH_SUGGEST = 0;
+    private static final int SHORTCUT_REFRESH = 1;
+    private static final UriMatcher sURIMatcher = buildUriMatcher();
+
+    /**
+     * The columns we'll include in our search suggestions.  There are others that could be used
+     * to further customize the suggestions, see the docs in {@link SearchManager} for the details
+     * on additional columns that are supported.
+     */
+    private static final String[] COLUMNS = {
+            "_id",  // must include this column
+            SearchManager.SUGGEST_COLUMN_TEXT_1,
+            SearchManager.SUGGEST_COLUMN_TEXT_2,
+            SearchManager.SUGGEST_COLUMN_INTENT_DATA,
+            };
+
+
+    /**
+     * Sets up a uri matcher for search suggestion and shortcut refresh queries.
+     */
+    private static UriMatcher buildUriMatcher() {
+        UriMatcher matcher =  new UriMatcher(UriMatcher.NO_MATCH);
+        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY, SEARCH_SUGGEST);
+        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY + "/*", SEARCH_SUGGEST);
+        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_SHORTCUT, SHORTCUT_REFRESH);
+        matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_SHORTCUT + "/*", SHORTCUT_REFRESH);
+        return matcher;
+    }
+
+    @Override
+    public boolean onCreate() {
+        Resources resources = getContext().getResources();
+        Dictionary.getInstance().ensureLoaded(resources);
+        return true;
+    }
+
+    @Override
+    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
+            String sortOrder) {
+        if (!TextUtils.isEmpty(selection)) {
+            throw new IllegalArgumentException("selection not allowed for " + uri);
+        }
+        if (selectionArgs != null && selectionArgs.length != 0) {
+            throw new IllegalArgumentException("selectionArgs not allowed for " + uri);
+        }
+        if (!TextUtils.isEmpty(sortOrder)) {
+            throw new IllegalArgumentException("sortOrder not allowed for " + uri);
+        }
+        switch (sURIMatcher.match(uri)) {
+            case SEARCH_SUGGEST:
+                String query = null;
+                if (uri.getPathSegments().size() > 1) {
+                    query = uri.getLastPathSegment().toLowerCase();
+                }
+                return getSuggestions(query, projection);
+            case SHORTCUT_REFRESH:
+                String shortcutId = null;
+                if (uri.getPathSegments().size() > 1) {
+                    shortcutId = uri.getLastPathSegment();
+                }
+                return refreshShortcut(shortcutId, projection);
+            default:
+                throw new IllegalArgumentException("Unknown URL " + uri);
+        }
+    }
+
+    private Cursor getSuggestions(String query, String[] projection) {
+        String processedQuery = query == null ? "" : query.toLowerCase();
+        List<Dictionary.Word> words = Dictionary.getInstance().getMatches(processedQuery);
+
+        MatrixCursor cursor = new MatrixCursor(COLUMNS);
+        for (Dictionary.Word word : words) {
+            cursor.addRow(columnValuesOfWord(word));
+        }
+
+        return cursor;
+    }
+
+    private Object[] columnValuesOfWord(Dictionary.Word word) {
+        return new String[] {
+                word.word,           // _id
+                word.word,           // text1
+                word.definition,     // text2
+                word.word,           // intent_data (included when clicking on item)
+        };
+    }
+
+    /**
+     * Note: this is unused as is, but if we included
+     * {@link SearchManager#SUGGEST_COLUMN_SHORTCUT_ID} as a column in our results, we
+     * could expect to receive refresh queries on this uri for the id provided, in which case we
+     * would return a cursor with a single item representing the refreshed suggestion data.
+     */
+    private Cursor refreshShortcut(String shortcutId, String[] projection) {
+        return null;
+    }
+
+    /**
+     * All queries for this provider are for the search suggestion and shortcut refresh mime type.
+     */
+    public String getType(Uri uri) {
+        switch (sURIMatcher.match(uri)) {
+            case SEARCH_SUGGEST:
+                return SearchManager.SUGGEST_MIME_TYPE;
+            case SHORTCUT_REFRESH:
+                return SearchManager.SHORTCUT_MIME_TYPE;
+            default:
+                throw new IllegalArgumentException("Unknown URL " + uri);
+        }
+    }
+
+    public Uri insert(Uri uri, ContentValues values) {
+        throw new UnsupportedOperationException();
+    }
+
+    public int delete(Uri uri, String selection, String[] selectionArgs) {
+        throw new UnsupportedOperationException();
+    }
+
+    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
+        throw new UnsupportedOperationException();
+    }
+}
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java
new file mode 100644
index 0000000..4d27470
--- /dev/null
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/SearchableDictionary.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.searchabledict;
+
+import android.app.Activity;
+import android.app.SearchManager;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.AdapterView;
+import android.widget.BaseAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.TwoLineListItem;
+
+import java.util.List;
+
+/**
+ * The main activity for the dictionary.  Also displays search results triggered by the search
+ * dialog.
+ */
+public class SearchableDictionary extends Activity {
+
+    private static final int MENU_SEARCH = 1;
+
+    private TextView mTextView;
+    private ListView mList;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        Intent intent = getIntent();
+
+        setContentView(R.layout.main);
+        mTextView = (TextView) findViewById(R.id.textField);
+        mList = (ListView) findViewById(R.id.list);
+
+        if (Intent.ACTION_VIEW.equals(intent.getAction())) {
+            // from click on search results
+            Dictionary.getInstance().ensureLoaded(getResources());
+            String word = intent.getDataString();
+            Dictionary.Word theWord = Dictionary.getInstance().getMatches(word).get(0);
+            launchWord(theWord);
+            finish();
+        } else if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
+            String query = intent.getStringExtra(SearchManager.QUERY);
+            mTextView.setText(getString(R.string.search_results, query));
+            WordAdapter wordAdapter = new WordAdapter(Dictionary.getInstance().getMatches(query));
+            mList.setAdapter(wordAdapter);
+            mList.setOnItemClickListener(wordAdapter);
+        }
+
+        Log.d("dict", intent.toString());
+        if (intent.getExtras() != null) {
+            Log.d("dict", intent.getExtras().keySet().toString());
+        }
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        menu.add(0, MENU_SEARCH, 0, R.string.menu_search)
+                .setIcon(android.R.drawable.ic_search_category_default)
+                .setAlphabeticShortcut(SearchManager.MENU_KEY);
+
+        return super.onCreateOptionsMenu(menu);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case MENU_SEARCH:
+                onSearchRequested();
+                return true;
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void launchWord(Dictionary.Word theWord) {
+        Intent next = new Intent();
+        next.setClass(this, WordActivity.class);
+        next.putExtra("word", theWord.word);
+        next.putExtra("definition", theWord.definition);
+        startActivity(next);
+    }
+
+    class WordAdapter extends BaseAdapter implements AdapterView.OnItemClickListener {
+
+        private final List<Dictionary.Word> mWords;
+        private final LayoutInflater mInflater;
+
+        public WordAdapter(List<Dictionary.Word> words) {
+            mWords = words;
+            mInflater = (LayoutInflater) SearchableDictionary.this.getSystemService(
+                    Context.LAYOUT_INFLATER_SERVICE);
+        }
+
+        public int getCount() {
+            return mWords.size();
+        }
+
+        public Object getItem(int position) {
+            return position;
+        }
+
+        public long getItemId(int position) {
+            return position;
+        }
+
+        public View getView(int position, View convertView, ViewGroup parent) {
+            TwoLineListItem view = (convertView != null) ? (TwoLineListItem) convertView :
+                    createView(parent);
+            bindView(view, mWords.get(position));
+            return view;
+        }
+
+        private TwoLineListItem createView(ViewGroup parent) {
+            TwoLineListItem item = (TwoLineListItem) mInflater.inflate(
+                    android.R.layout.simple_list_item_2, parent, false);
+            item.getText2().setSingleLine();
+            item.getText2().setEllipsize(TextUtils.TruncateAt.END);
+            return item;
+        }
+
+        private void bindView(TwoLineListItem view, Dictionary.Word word) {
+            view.getText1().setText(word.word);
+            view.getText2().setText(word.definition);
+        }
+
+        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+            launchWord(mWords.get(position));
+        }
+    }
+}
diff --git a/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java b/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java
new file mode 100644
index 0000000..1c4b8b4
--- /dev/null
+++ b/samples/SearchableDictionary/src/com/example/android/searchabledict/WordActivity.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.searchabledict;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.TextView;
+import android.content.Intent;
+
+/**
+ * Displays a word and its definition.
+ */
+public class WordActivity extends Activity {
+
+    private TextView mWord;
+    private TextView mDefinition;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.word);
+
+        mWord = (TextView) findViewById(R.id.word);
+        mDefinition = (TextView) findViewById(R.id.definition);
+
+        Intent intent = getIntent();
+
+        String word = intent.getStringExtra("word");
+        String definition = intent.getStringExtra("definition");
+
+        mWord.setText(word);
+        mDefinition.setText(definition);
+    }
+}
diff --git a/tools/scripts/build.template b/tools/scripts/build.template
index 7939e6c..1ed3853 100644
--- a/tools/scripts/build.template
+++ b/tools/scripts/build.template
@@ -49,13 +49,18 @@
         classpathref="android.antlibs"/>
 
     <!-- Execute the Android Setup task that will setup some properties specific to the target,
-         and import the rules files.
-         To customize the rules, copy/paste them below the task, and disable import by setting
-         the import attribute to false:
-            <setup import="false" />
+         and import the build rules files.
+
+         The rules file is imported from
+            <SDK>/platforms/<target_platform>/templates/android_rules.xml
+
+         To customize some build steps for your project:
+         - copy the content of the main node <project> from android_rules.xml
+         - paste it in this build.xml below the <setup /> task.
+         - disable the import by changing the setup task below to <setup import="false" />
          
          This will ensure that the properties are setup correctly but that your customized
-         targets are used.
+         build steps are used.
     -->
     <setup />
 </project>
diff --git a/tools/scripts/java_tests_file.template b/tools/scripts/java_tests_file.template
index 7781a33..c6fa873 100644
--- a/tools/scripts/java_tests_file.template
+++ b/tools/scripts/java_tests_file.template
@@ -1,6 +1,6 @@
 package PACKAGE;
 
-import android.test.ActivityInstrumentationTestCase;
+import android.test.ActivityInstrumentationTestCase2;
 
 /**
  * This is a simple framework for a test of an Application.  See
@@ -12,7 +12,7 @@
  * -e class PACKAGE.ACTIVITY_NAMETest \
  * PACKAGE.tests/android.test.InstrumentationTestRunner
  */
-public class ACTIVITY_NAMETest extends ActivityInstrumentationTestCase<ACTIVITY_NAME> {
+public class ACTIVITY_NAMETest extends ActivityInstrumentationTestCase2<ACTIVITY_NAME> {
 
     public ACTIVITY_NAMETest() {
         super("PACKAGE", ACTIVITY_NAME.class);
diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java
index 86d650b..e308a0f 100755
--- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java
+++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java
@@ -112,7 +112,31 @@
     /** Returns a short description for an {@link IDescription}. */

     @Override

     public String getShortDescription() {

-        return String.format("Extra %1$s package, revision %2$d", getPath(), getRevision());

+        String name = getPath();

+        if (name != null) {

+            // Uniformize all spaces in the name and upper case words.

+

+            name = name.replaceAll("[ _\t\f-]+", " ");     //$NON-NLS-1$ //$NON-NLS-2$

+

+            // Look at all lower case characters in range [1..n-1] and replace them by an upper

+            // case if they are preceded by a space. Also upper cases the first character of the

+            // string.

+            boolean changed = false;

+            char[] chars = name.toCharArray();

+            for (int n = chars.length - 1, i = 0; i < n; i++) {

+                if (Character.isLowerCase(chars[i]) && (i == 0 || chars[i - 1] == ' ')) {

+                    chars[i] = Character.toUpperCase(chars[i]);

+                    changed = true;

+                }

+            }

+            if (changed) {

+                name = new String(chars);

+            }

+        }

+

+        return String.format("%1$s package, revision %2$d",

+                name,

+                getRevision());

     }

 

     /** Returns a long description for an {@link IDescription}. */

diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/RepoSource.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/RepoSource.java
index cd2bacb..1d76655 100755
--- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/RepoSource.java
+++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/RepoSource.java
@@ -56,6 +56,9 @@
 

     /**

      * Constructs a new source for the given repository URL.

+     * @param url The source URL. Cannot be null. If the URL ends with a /, the default

+     *            repository.xml filename will be appended automatically.

+     * @param userSource True if this a user source (add-ons & packages only.)

      */

     public RepoSource(String url, boolean userSource) {

 

@@ -72,6 +75,23 @@
         setDefaultDescription();

     }

 

+    /**

+     * Two repo source are equal if they have the same userSource flag and the same URL.

+     */

+    @Override

+    public boolean equals(Object obj) {

+        if (obj instanceof RepoSource) {

+            RepoSource rs = (RepoSource) obj;

+            return  rs.isUserSource() == this.isUserSource() && rs.getUrl().equals(this.getUrl());

+        }

+        return false;

+    }

+

+    @Override

+    public int hashCode() {

+        return mUrl.hashCode() ^ Boolean.valueOf(mUserSource).hashCode();

+    }

+

     /** Returns true if this is a user source. We only load addon and extra packages

      * from a user source and ignore the rest. */

     public boolean isUserSource() {

@@ -176,7 +196,7 @@
                 }

             }

 

-            monitor.setResult("Failed to fetch URL %1$s, reason:", url, reason);

+            monitor.setResult("Failed to fetch URL %1$s, reason: %2$s", url, reason);

         }

 

         monitor.incProgress(1);

@@ -185,7 +205,7 @@
             monitor.setDescription("Parse XML");

             monitor.incProgress(1);

             parsePackages(xml, monitor);

-            if (mPackages.length == 0) {

+            if (mPackages == null || mPackages.length == 0) {

                 mDescription += "\nNo packages found.";

             } else if (mPackages.length == 1) {

                 mDescription += "\nOne package found.";

@@ -370,10 +390,10 @@
             }

 

         } catch (ParserConfigurationException e) {

-            monitor.setResult("Failed to create XML document builder for %1$s");

+            monitor.setResult("Failed to create XML document builder");

 

         } catch (SAXException e) {

-            monitor.setResult("Failed to parse XML document %1$s");

+            monitor.setResult("Failed to parse XML document");

 

         } catch (IOException e) {

             monitor.setResult("Failed to read XML document");

diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/RepoSources.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/RepoSources.java
index 7af6657..e0452b8 100755
--- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/RepoSources.java
+++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/RepoSources.java
@@ -95,7 +95,10 @@
                 for (int i = 0; i < count; i++) {

                     String url = props.getProperty(String.format("%s%02d", KEY_SRC, i));  //$NON-NLS-1$

                     if (url != null) {

-                        mSources.add(new RepoSource(url, true /*userSource*/));

+                        RepoSource s = new RepoSource(url, true /*userSource*/);

+                        if (!hasSource(s)) {

+                            mSources.add(s);

+                        }

                     }

                 }

             }

@@ -120,6 +123,20 @@
     }

 

     /**

+     * Returns true if there's already a similar source in the sources list.

+     * <p/>

+     * The search is O(N), which should be acceptable on the expectedly small source list.

+     */

+    public boolean hasSource(RepoSource source) {

+        for (RepoSource s : mSources) {

+            if (s.equals(source)) {

+                return true;

+            }

+        }

+        return false;

+    }

+

+    /**

      * Saves all the user sources.

      * @param log

      */

diff --git a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterWindowImpl.java b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterWindowImpl.java
index 20f1abb..b9cf0a4 100755
--- a/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterWindowImpl.java
+++ b/tools/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterWindowImpl.java
@@ -335,17 +335,40 @@
         RepoSources sources = mUpdaterData.getSources();

         sources.add(new RepoSource(SdkRepository.URL_GOOGLE_SDK_REPO_SITE, false /*userSource*/));

 

-        String str = System.getenv("TEMP_SDK_URL"); // TODO STOPSHIP temporary remove before shipping

+        // SDK_UPDATER_URLS is a semicolon-separated list of URLs that can be used to

+        // seed the SDK Updater list for full repositories.

+        String str = System.getenv("SDK_UPDATER_URLS");

         if (str != null) {

             String[] urls = str.split(";");

             for (String url : urls) {

-                sources.add(new RepoSource(url, false /*userSource*/));

+                if (url != null && url.length() > 0) {

+                    RepoSource s = new RepoSource(url, false /*userSource*/);

+                    if (!sources.hasSource(s)) {

+                        sources.add(s);

+                    }

+                }

             }

         }

 

         // Load user sources

         sources.loadUserSources(mUpdaterData.getSdkLog());

 

+        // SDK_UPDATER_USER_URLS is a semicolon-separated list of URLs that can be used to

+        // seed the SDK Updater list for user-only repositories. User sources can only provide

+        // add-ons and extra packages.

+        str = System.getenv("SDK_UPDATER_USER_URLS");

+        if (str != null) {

+            String[] urls = str.split(";");

+            for (String url : urls) {

+                if (url != null && url.length() > 0) {

+                    RepoSource s = new RepoSource(url, true /*userSource*/);

+                    if (!sources.hasSource(s)) {

+                        sources.add(s);

+                    }

+                }

+            }

+        }

+

         mRemotePackagesPage.onSdkChange();

     }