Refriend for phonegap