title: Add Words to Android's UserDictionary
body: <p>I want to add an entire medical dictionary to my android phone (Moto Droid). I would like to be able to send text messages and have the medical words be in the predictable text.</p>
  
  <p>I've been trying to write a small app that would accomplish this, but everything I try the app crashes on startup. I've never written an app for a mobile platform so that is a first for me. Here is what is not working properly.</p>
  
  <pre><code>public class WordAdd extends Activity {
  /** Called when the activity is first created. */
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
  
      UserDictionary.Words.addWord( this , "newMedicalWord", 1, UserDictionary.Words.LOCALE_TYPE_CURRENT);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>It seems so simple to do, yet I am so stuck. Thanks for any help you can provide.</p>
  
  <p><strong>EDIT:</strong> I should mention that I am getting this error for Android 2.1 in the AVD (virtual device).</p>
  
  <p><strong>EDIT 2:</strong> <a href="http://developer.android.com/reference/android/provider/UserDictionary.html" rel="noreferrer">User Dictionary</a> is found in the Android API. <a href="http://developer.android.com/reference/android/provider/UserDictionary.Words.html" rel="noreferrer">addWord</a> is a static method. I don't declare UserDictionary because I just use the one static method. It's been ages since I developed anything in Java and this is my first attempt at any mobile development, so I don't know if I am doing something wrong.</p>