How to check the Internet Connectivity status of My Android App

How to check the Internet Connectivity status of My Android App in phonegap ?

I have read through the phonegap documentation but I dont understand it.

Please I will greatly appreciate if Someone can provide me with a Sample script of how to do this.

Thanks

You can just check navigator.onLine