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; }
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.