Toast.makeText(getApplicationContext(), "Hello, world!", Toast.LENGTH_SHORT).show();
private boolean isWifiConn; private boolean isMobilConn; public boolean checkForNetwork() { ConnectivityManager connMan = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo wifiConn = connMan.getNetworkInfo(ConnectivityManager.TYPE_WIFI); NetworkInfo mobileConn = connMan.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); isWifiConn = (wifiConn != null) && (wifiConn.isConnected()); isMobilConn = (mobileConn != null) && (mobileConn.isConnected()); return isWifiConn || isMobilConn; }