I have found good tutorial to for Handling Screen OFF and Screen ON Intents: http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/
but i want that after screen is off every 5 minutes wifi is checked if is connected
ConnectivityManager connManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
wifi.isConnected()
i want to use alarm manager
http://developer.android.com/reference/android/app/AlarmManager.html but i don't know how to check every 5 minutes if is connected or not.