imported version form http://code.google.com/p/wlandroid/