Please see this topic for an answer on how to detect if the app is online or not.
TLDR: The only way to practically know if the app has a working internet connection is to try and do something that requires an internet connection and then seeing if it succeeds or not. The before mentioned post suggests a fairly neat way of doing just that