Skip to main content

Posts

Showing posts with the label system service

What does Android Gingerbread mean?

Android Gingerbread is the codename given to version 2.3 of the Android platform. Some of the improvements in this version include a refined user interface, faster text input, support for near field communication (NFC) and system enhancements for game development.

Open wifi settings in android

final Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_LAUNCHER); final ComponentName cn = new ComponentName("com.android.settings","com.android.settings.wifi.WifiSettings"); intent.setComponent(cn); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity( intent); 

Programatically enable or disable WIFI in android

simple code snippet to enable WI-FI in android programatically in android. public boolean enableWIFI() { WifiManager wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE); if(wifiManager.isWifiEnabled()) { if(wifiManager.setWifiEnabled(false)) return true; } else { if(wifiManager.setWifiEnabled(true)) return true; } return false; } Make sure that you add the permissions: <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE">