This is a copy from Lamberta for phonegap testing