So I just finished writing my little app with some help from three pineapples code.
This app is just a button that you press and it will fill your user dictionary with the 10,000 words found in those word lists I posted above, sorted by frequency. It takes a couple of minutes to run and there is no indication that it's doing anything but just give it a bit and when it turns gray again you can check your user dictionary to make sure it worked and then uninstall/delete the app as it serves no other purpose.
To use it just unzip / extract the .apk, then plug in your phone to the computer via USB, copy the file to your sdcard, and install it. It requests some access to your phone or whatever but there's nothing in the code as you can plainly see:
I'll try to add a counter / progress bar and a delete function if you want to clear your user dictionary at some point, but no guarantees.
Anyone can feel free to steal this code / fix it up / put it up on the market for free
Thanks,
greves
package com.greves.userdictionarywordlist;
import android.app.Activity;
import android.os.Bundle;
import android.provider.UserDictionary;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class UserDictionaryWordlist extends Activity implements OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Button button = new Button(this);
button.setText("Click me");
button.setOnClickListener(this);
setContentView(button);
}
public void onClick(View v) {
try {
BufferedReader wordlist = new BufferedReader(new InputStreamReader(getAssets().open("wordlist.txt")));
String word = null;
// start with the most common words freq = 255
int freq = 255;
int freqCount = 0;
// go down 1 level of frequency every 40 words = 10,000 words in the list
int freqDivision = 40;
while ((word = wordlist.readLine()) != null) {
UserDictionary.Words.addWord(this, word, freq, UserDictionary.Words.LOCALE_TYPE_CURRENT);
freqCount++;
if (freqCount == freqDivision) {
freq--;
freqCount = 0;
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}