iOS Detect 3G or WiFi

Using the code that Apple has provided here Reachability *reachability = [Reachability reachabilityForInternetConnection]; [reachability startNotifier]; NetworkStatus status = [reachability currentReachabilityStatus]; if(status == NotReachable) { //No internet } else if (status == ReachableViaWiFi) { //WiFi } else if (status == ReachableViaWWAN) { //3G }

How to programmatically create and read WEP/EAP WiFi configurations in Android?

Part 1: Creating a WEP WiFi configuration programmatically This is pretty much straightforward, WifiConfiguration exposes the interface to create the same. Here is the sample code: void saveWepConfig() { WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiConfiguration wc = new WifiConfiguration(); wc.SSID = “\”SSID_NAME\””; //IMP! This should be in Quotes!! wc.hiddenSSID = true; wc.status = WifiConfiguration.Status.DISABLED; wc.priority … Read more

Android: How to Enable/Disable Wifi or Internet Connection Programmatically

I know of enabling or disabling wifi: WifiManager wifiManager = (WifiManager)this.context.getSystemService(Context.WIFI_SERVICE); wifiManager.setWifiEnabled(status); where status may be true or false as per requirement. Edit: You also need the following permissions in your manifest file: <uses-permission android:name=”android.permission.ACCESS_WIFI_STATE”/> <uses-permission android:name=”android.permission.CHANGE_WIFI_STATE”/>