swype beta: how to update manually, and how to export/import your personal dictionary

[posted: ]  [4 comments]

swype for android is pretty kewl. ;) since the swype forums are currently offline, i decided to cross-post two of their articles, which i personally find very helpful, here in my blog:

License Expired – How to update Swype?

If you’re receiving a message that Swype’s license has expired, you MUST uninstall your existing version of Swype and reinstall using the SwypeInstaller to get the latest version of Swype, which includes a renewed license. When launching SwypeInstaller you may be prompted to update. This WILL NOT update Swype itself. It is only for updating the SwypeInstaller application. Please follow the steps below:

  • From your device’s home screen, press the MENU button.
  • Choose Settings
  • Choose Applications
  • Choose Manage Applications
  • Choose Swype (NOT SwypeInstaller)
  • Choose Uninstall
  • Launch SwypeInstaller from your application list
  • If prompted, select Update to get the latest version of SwypeInstaller
    Log-in using the email address and password you used when registering for the beta. If you have forgotten your password you can reset it here: https://beta.swype.com/android/user/lostpassword/
  • Choose the language package you want to download.
  • Enjoy Swype!


Backing up and restoring your user dictionary (root users only)

If you have ROOT ACCESS on your device, you can use the following steps to upgrade Swype and maintain your custom dictionary. *WARNING* You MUST follow these directions EXACTLY as described below! Doing these steps out of order will result in PERMISSION PROBLEMS, leading to your UDB being unwritable and you won’t be able to modify ANY words in your dictionary!

In the following instructions, any commands that start with a ‘#’ are run from an elevated (root) terminal on your Android device. If you do not have perma-root, and get a ‘$’ when starting your terminal (either with a terminal emulator, or ‘adb shell’ from your desktop) you will need to use the command ‘su’ to elevate your terminal permissions to root

Backup your existing UDB
First thing’s first: we need to make a backup of your current user dictionary (UDB). This file is located at /data/data/com.swype.android.inputmethod/swypedata/udb/UserData.udb

You can copy the file to your SDcard…

cp /data/data/com.swype.android.inputmethod/swypedata/udb/UserData.udb /sdcard/UserData.udb

…or you can pull the file from your phone to your computer, using ADB…

C:\Users\neatchee\Desktop> adb pull /data/data/com.swype.android.inputmethod/swypedata/udb/UserData.udb .\UserData.udb

Uninstall Swype, update SwypeInstaller, and install the new version of Swype
Now you need to get the latest version of Swype. Uninstall your current version of Swype however you prefer (via Settings -> Applications on your phone, or via ‘adb uninstall’ from a terminal), run SwypeInstaller and update when prompted (or get the latest installer directly from http://beta.swype.com/android/get), and complete the ENTIRE installation process. You’re not done until you press the “FINISH” button on the last page.

Before continuing, you MUST load and use Swype to enter at least a couple of words.

This is important, as it makes sure that all of Swype’s configuration files are generated properly before restoring your UDB backup.

Determine file ownership, restore your backup, and restore file ownership
Now comes the fun part. We need to figure out the user ID assigned to the Swype application by Android. From an ANDROID SHELL (either a terminal emulator on the device, or using ‘adb shell’ from your computer) enter the following command…

stat /data/data/com.swype.android.inputmethod/swypedata/udb/UserData.udb

You’re going to look at the GID and UID values (they should be exactly the same). Your output will look something like this…
File: "/data/data/com.swype.android.inputmethod/swypedata/udb/UserData.udb"
Size: 120048 Blocks: 235 IO Block: 4096 regular file
Device: 1f06h/7942d Inode: 3493 Links: 1
Access: (0666/-rw-rw-rw-) Uid: (10076/ app_76) Gid: (10076/ app_76)
Access: 2011-06-13 16:32:01.000000000
Modify: 2011-06-13 16:32:01.000000000
Change: 2011-06-13 16:32:01.000000000

WRITE DOWN THE 5 DIGIT NUMBER FOR UID AND GID. In my case this is 10076 but yours may (and probably will be) different.

Now we need to kill all running instances of Swype and SwypeInstaller. To do this, you need to deselect Swype as your active input method (long-press a text field, select Input Method, and choose anything other than Swype), and DISABLE Swype in Settings -> Language & Keyboard by unchecking the entry for Swype.

You will also need to MANUALLY KILL THE RUNNING PROCESSES that will likely still be running. To do this, you need to find the process_ID and kill it from a terminal. We’ll use the terminal command ‘ps | grep swype’ to find the running processes, and the command ‘kill
PID’ to kill it. When you run ‘ps | grep swype’ you’ll want to look at the second column. That’s the PID.
ps | grep swype
app_60 3278 134 97812 23412 ffffffff afd0c5bc S com.swype.android.installer
app_60 3286 134 100424 24220 ffffffff afd0c5bc S com.swype.android.installer:remote
app_76 3337 134 103744 27404 ffffffff afd0c5bc S com.swype.android.inputmethod
kill 3337
kill 3286
kill 3278

Now that the processes are all dead, you can restore your backed up UDB file…
For those who copied to the SDcard:
cp /sdcard/UserData.udb /data/data/com.swype.android.inputmethod/swypedata/udb/UserData.udb

For those who copied to their computer via ADB:
C:\Users\neatchee\Desktop> adb push .\UserData.udb /data/data/com.swype.android.inputmethod/swypedata/udb/UserData.udb

The last step is to restore file ownership. Remember that 5-digit UID/GID we copied down earlier? You’ll use the command ‘chown PID:GID FILENAME’ to change ownership of the file we just restored back to the Swype application. Here’s how the command looks using my UID/GID (10076). And remember you must use your own UID/GID that you copied down earlier! Don’t just copy/paste the command below!
chown 10076:10076 /data/data/com.swype.android.inputmethod/swypedata/udb/UserData.udb

    personal experience: to be sure, also add the following line. it solved the problems that came up on my phone.
    chmod 666 /data/data/com.swype.android.inputmethod/swypedata/udb/UserData.udb

That’s it! You should now be able to re-enable Swype from Settings -> Language & Keyboard, re-select Swype as your default input method (via long-press of a text-field and selecting Input Method, then Swype) and start Swyping using your old UDB.

Hope this helps some of you root users out there. Happy Swyping!


[category: android] [tags: , , ]

4 comments on “swype beta: how to update manually, and how to export/import your personal dictionary

  1. nice, thanks! worked pretty good and since the swype OTA upgrade wasn't working correctly and thus I was going this way :) Thanks a lot!
  2. thank you!!!!! Ill try it out
  3. I have used your described method few times without any issues. But recently, I have upgraded my galaxy s2 to the official JellyBeans ROM which comes with Nuance Swype 1.3.6 preinstalled which features the auto syncing of user dictionary. However, I want to add the words from the previous version of swype to Nuance's Swype but I could locate the UDB folder or UserData.udb file in \data\data\com.nuance.swype.input or in \data\user\com.nuance.swype.input. Can you help me in updating the database in this new version from previous versions?
  4. hi bilal, unfortunately, support for this method (inside the beta programme) was stopped one or two versions back. not sure if it ever worked from beta to a preinstalled version, but i assume it stopped working when they also changed the beta dict storage.

Leave a Reply