Chapter 1. The Recipes
1.1. Determining Whether the Device Is Ready
You want to execute a PhoneGap API call, but you are unsure whether the device is ready and the application will not function if the API attempts to access the device prematurely.
There are two solutions for checking whether the device is ready. For iOS, Android, and BlackBerry (version 5.0 and higher), a custom event type that you can attach to the DOM is available, and PhoneGap will trigger this event when the device is ready.