android Programming Glossary: context.wifi_service
How to configue static IP, netmask ,gateway programmatically on Android 3.x or 4.x http://stackoverflow.com/questions/10278461/how-to-configue-static-ip-netmask-gateway-programmatically-on-android-3-x-or-4 null WifiManager wifiManager WifiManager getSystemService Context.WIFI_SERVICE WifiInfo connectionInfo wifiManager.getConnectionInfo List WifiConfiguration..
Android: How to monitor WiFi signal strength http://stackoverflow.com/questions/1206891/android-how-to-monitor-wifi-signal-strength initializeWiFiListener String connectivity_context Context.WIFI_SERVICE final WifiManager wifi WifiManager getSystemService connectivity_context..
Android : Reconnect to Wi-Fi after entering coverage area while screen turned off http://stackoverflow.com/questions/19148765/android-reconnect-to-wi-fi-after-entering-coverage-area-while-screen-turned-of _wifiLock null WifiManager wm WifiManager getSystemService Context.WIFI_SERVICE boolean failedToConnect true if wm null wm.isWifiEnabled Don't.. WifiManager _wifiManager WifiManager getSystemService Context.WIFI_SERVICE final int wifiState _wifiManager.getWifiState if _wifiManager.isWifiEnabled..
How can I discover zeroconf (Bonjour) services on Android? I'm having trouble with jmDNS http://stackoverflow.com/questions/2474143/how-can-i-discover-zeroconf-bonjour-services-on-android-im-having-trouble-wi Networking code WifiManager wifi getSystemService Context.WIFI_SERVICE MulticastLock lock wifi.createMulticastLock fliing_lock lock.setReferenceCounted..
How to use 3G Connection in Android Application instead of Wi-fi? http://stackoverflow.com/questions/2513713/how-to-use-3g-connection-in-android-application-instead-of-wi-fi wifiManager WifiManager this.getSystemService Context.WIFI_SERVICE if wifiManager.isWifiEnabled wifiManager.setWifiEnabled false..
Android 2.2 wifi hotspot API http://stackoverflow.com/questions/3023226/android-2-2-wifi-hotspot-api can be WifiManager wifi WifiManager getSystemService Context.WIFI_SERVICE Method wmMethods wifi.getClass .getDeclaredMethods for Method..
How to get name of wifi-network out of android using android API? http://stackoverflow.com/questions/3531940/how-to-get-name-of-wifi-network-out-of-android-using-android-api wifiMgr WifiManager getActivity .getSystemService Context.WIFI_SERVICE WifiInfo wifiInfo wifiMgr.getConnectionInfo String name wifiInfo.getSSID..
Multicast on Android 2.2 http://stackoverflow.com/questions/3623143/multicast-on-android-2-2 lock WifiManager wifi WifiManager getSystemService Context.WIFI_SERVICE if wifi null MulticastLock mcLock wifi.createMulticastLock mylock..
Android: How to Enable/Disable Wifi or Internet Connection Programmatically http://stackoverflow.com/questions/3930990/android-how-to-enable-disable-wifi-or-internet-connection-programmatically wifiManager WifiManager this.context.getSystemService Context.WIFI_SERVICE wifiManager.setWifiEnabled status where status may be true or..
How to programatically create and read WEP/EAP WiFi configurations in Android? http://stackoverflow.com/questions/4374862/how-to-programatically-create-and-read-wep-eap-wifi-configurations-in-android WifiManager wifi WifiManager getSystemService Context.WIFI_SERVICE WifiConfiguration wc new WifiConfiguration wc.SSID SSID_NAME.. WifiManager wifi WifiManager getSystemService Context.WIFI_SERVICE List WifiConfiguration item wifi.getConfiguredNetworks int i..
Wifi sleeps, even with Lock http://stackoverflow.com/questions/5147203/wifi-sleeps-even-with-lock WifiManager wifiManager WifiManager getSystemService Context.WIFI_SERVICE if wifiManager null _wifiLock wifiManager.createWifiLock 0 Backup..
How to get gateway and subnet mask details in Android? programmatically http://stackoverflow.com/questions/5387036/how-to-get-gateway-and-subnet-mask-details-in-android-programmatically R.layout.main wifii WifiManager getSystemService Context.WIFI_SERVICE d wifii.getDhcpInfo s_dns1 DNS 1 String.valueOf d.dns1 s_dns2..
How can I get Android Wifi Scan Results into a list? http://stackoverflow.com/questions/5452940/how-can-i-get-android-wifi-scan-results-into-a-list findViewById R.id.list wifi WifiManager getSystemService Context.WIFI_SERVICE if wifi.isWifiEnabled false Toast.makeText getApplicationContext..
Wifi Connect-Disconnect Listener http://stackoverflow.com/questions/6362314/wifi-connect-disconnect-listener as simple as WifiManager wifi WifiManager getSystemService Context.WIFI_SERVICE if wifi.isWifiEnabled true tv.setText You are connected else..
Android 2.3 wifi hotspot API http://stackoverflow.com/questions/7048922/android-2-3-wifi-hotspot-api wifi WifiManager getSystemService Context.WIFI_SERVICE @Override public void onResume super.onResume updateStatusDisplay..
Check the bandwidth rate in Android http://stackoverflow.com/questions/8225791/check-the-bandwidth-rate-in-android WIFI Only WifiManager wifiManager Context.getSystemService Context.WIFI_SERVICE WifiInfo wifiInfo wifiManager.getConnectionInfo if wifiInfo..
How to connect to a specific wifi network in Android programmatically? http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically wifiManager WifiManager context.getSystemService Context.WIFI_SERVICE wifiManager.addNetwork conf And finally you might need to enable..
How to programmatically turn off WiFi on Android device? [duplicate] http://stackoverflow.com/questions/8863509/how-to-programmatically-turn-off-wifi-on-android-device class wifiManager WifiManager this.getSystemService Context.WIFI_SERVICE wifiManager.setWifiEnabled true wifiManager.setWifiEnabled false..
How to configue static IP, netmask ,gateway programmatically on Android 3.x or 4.x http://stackoverflow.com/questions/10278461/how-to-configue-static-ip-netmask-gateway-programmatically-on-android-3-x-or-4 using SSID WifiConfiguration WifiConfiguration wifiConf null WifiManager wifiManager WifiManager getSystemService Context.WIFI_SERVICE WifiInfo connectionInfo wifiManager.getConnectionInfo List WifiConfiguration configuredNetworks wifiManager.getConfiguredNetworks..
Android: How to monitor WiFi signal strength http://stackoverflow.com/questions/1206891/android-how-to-monitor-wifi-signal-strength onCreate private void initializeWiFiListener Log.i TAG executing initializeWiFiListener String connectivity_context Context.WIFI_SERVICE final WifiManager wifi WifiManager getSystemService connectivity_context if wifi.isWifiEnabled if wifi.getWifiState WifiManager.WIFI_STATE_ENABLING..
Android : Reconnect to Wi-Fi after entering coverage area while screen turned off http://stackoverflow.com/questions/19148765/android-reconnect-to-wi-fi-after-entering-coverage-area-while-screen-turned-of protected void doWakefulWork Intent intent WifiLock _wifiLock null WifiManager wm WifiManager getSystemService Context.WIFI_SERVICE boolean failedToConnect true if wm null wm.isWifiEnabled Don't want to enable it myself _wifiLock wm.createWifiLock WifiManager.WIFI_MODE_FULL_HIGH_PERF.. .getNetworkInfo ConnectivityManager.TYPE_WIFI WifiManager _wifiManager WifiManager getSystemService Context.WIFI_SERVICE final int wifiState _wifiManager.getWifiState if _wifiManager.isWifiEnabled wifiState WifiManager.WIFI_STATE_DISABLED ..
How can I discover zeroconf (Bonjour) services on Android? I'm having trouble with jmDNS http://stackoverflow.com/questions/2474143/how-can-i-discover-zeroconf-bonjour-services-on-android-im-having-trouble-wi android name android.permission.CHANGE_WIFI_MULTICAST_STATE Networking code WifiManager wifi getSystemService Context.WIFI_SERVICE MulticastLock lock wifi.createMulticastLock fliing_lock lock.setReferenceCounted true lock.acquire Just make sure to call..
How to use 3G Connection in Android Application instead of Wi-fi? http://stackoverflow.com/questions/2513713/how-to-use-3g-connection-in-android-application-instead-of-wi-fi @Override public void onCreate Bundle icicle .................... wifiManager WifiManager this.getSystemService Context.WIFI_SERVICE if wifiManager.isWifiEnabled wifiManager.setWifiEnabled false else wifiManager.setWifiEnabled true If you do not want..
Android 2.2 wifi hotspot API http://stackoverflow.com/questions/3023226/android-2-2-wifi-hotspot-api the AIDL for the WifiManager so their are accessible An example can be WifiManager wifi WifiManager getSystemService Context.WIFI_SERVICE Method wmMethods wifi.getClass .getDeclaredMethods for Method method wmMethods if method.getName .equals setWifiApEnabled..
How to get name of wifi-network out of android using android API? http://stackoverflow.com/questions/3531940/how-to-get-name-of-wifi-network-out-of-android-using-android-api to connect. Please help.. EDIT acording to Loxley answer WifiManager wifiMgr WifiManager getActivity .getSystemService Context.WIFI_SERVICE WifiInfo wifiInfo wifiMgr.getConnectionInfo String name wifiInfo.getSSID android wifi android wifi share improve this..
Multicast on Android 2.2 http://stackoverflow.com/questions/3623143/multicast-on-android-2-2 name android.permission.ACCESS_WIFI_STATE I acquire the multicast lock WifiManager wifi WifiManager getSystemService Context.WIFI_SERVICE if wifi null MulticastLock mcLock wifi.createMulticastLock mylock mcLock.acquire ... And then try to start jmDNS to look..
Android: How to Enable/Disable Wifi or Internet Connection Programmatically http://stackoverflow.com/questions/3930990/android-how-to-enable-disable-wifi-or-internet-connection-programmatically
How to programatically create and read WEP/EAP WiFi configurations in Android? http://stackoverflow.com/questions/4374862/how-to-programatically-create-and-read-wep-eap-wifi-configurations-in-android 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.. Straighforward again. Here is the sample code void readWepConfig WifiManager wifi WifiManager getSystemService Context.WIFI_SERVICE List WifiConfiguration item wifi.getConfiguredNetworks int i item.size Log.d WifiPreference NO OF CONFIG i Iterator WifiConfiguration..
Wifi sleeps, even with Lock http://stackoverflow.com/questions/5147203/wifi-sleeps-even-with-lock 0 Backup power lock _wakeLock.acquire WifiManager wifiManager WifiManager getSystemService Context.WIFI_SERVICE if wifiManager null _wifiLock wifiManager.createWifiLock 0 Backup wifi lock _wifiLock.acquire private void _keepOnStop..
How to get gateway and subnet mask details in Android? programmatically http://stackoverflow.com/questions/5387036/how-to-get-gateway-and-subnet-mask-details-in-android-programmatically savedInstanceState super.onCreate savedInstanceState setContentView R.layout.main wifii WifiManager getSystemService Context.WIFI_SERVICE d wifii.getDhcpInfo s_dns1 DNS 1 String.valueOf d.dns1 s_dns2 DNS 2 String.valueOf d.dns2 s_gateway Default Gateway String.valueOf..
How can I get Android Wifi Scan Results into a list? http://stackoverflow.com/questions/5452940/how-can-i-get-android-wifi-scan-results-into-a-list buttonScan.setOnClickListener this lv ListView findViewById R.id.list wifi WifiManager getSystemService Context.WIFI_SERVICE if wifi.isWifiEnabled false Toast.makeText getApplicationContext wifi is disabled..making it enabled Toast.LENGTH_LONG..
Wifi Connect-Disconnect Listener http://stackoverflow.com/questions/6362314/wifi-connect-disconnect-listener result. Please help. Thanx in advance. My current code is as simple as WifiManager wifi WifiManager getSystemService Context.WIFI_SERVICE if wifi.isWifiEnabled true tv.setText You are connected else tv.setText You are NOT connected android wifi android wifi..
Android 2.3 wifi hotspot API http://stackoverflow.com/questions/7048922/android-2-3-wifi-hotspot-api WindowManager.LayoutParams.FLAG_DIM_BEHIND wifi WifiManager getSystemService Context.WIFI_SERVICE @Override public void onResume super.onResume updateStatusDisplay public void toggleWifi View v boolean wifiApIsOn getWifiAPState..
Check the bandwidth rate in Android http://stackoverflow.com/questions/8225791/check-the-bandwidth-rate-in-android current link speed in LINK_SPEED_UNITS. but this work for WIFI Only WifiManager wifiManager Context.getSystemService Context.WIFI_SERVICE WifiInfo wifiInfo wifiManager.getConnectionInfo if wifiInfo null Integer linkSpeed wifiInfo.getLinkSpeed measured using..
How to connect to a specific wifi network in Android programmatically? http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically Then you need to add it to Android wifi manager settings WifiManager wifiManager WifiManager context.getSystemService Context.WIFI_SERVICE wifiManager.addNetwork conf And finally you might need to enable it so Android conntects to it List WifiConfiguration list..
How to programmatically turn off WiFi on Android device? [duplicate] http://stackoverflow.com/questions/8863509/how-to-programmatically-turn-off-wifi-on-android-device uses permission Then you can use the following in your activity class wifiManager WifiManager this.getSystemService Context.WIFI_SERVICE wifiManager.setWifiEnabled true wifiManager.setWifiEnabled false Use the following to check if it's enabled or not boolean..
|