I am making application which uses connection with server through internet.

In my application i want to check if internet is available or not when application starts and during application as well. when there is no internet access then it has to show some alert to tell user.
Thanks for any suggestion in advance.