Updated for PhoneGap 3.0