Phonegap version of TF