Added new code to be integrated with PhoneGap Build.