wifi

Checking Wi-Fi enabled or not on Android

家住魔仙堡 提交于 2019-11-28 21:00:56
What would the code be for checking whether the Wi-Fi is enabled or not? Rasel WifiManager wifi = (WifiManager)getSystemService(Context.WIFI_SERVICE); if (wifi.isWifiEnabled()){ //wifi is enabled } For details check here The above answers work fineو but don't forget to add the right permissions in the Manifest: <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" > </uses-permission> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" > </uses-permission> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" > </uses-permission> Hope it helps

Android Check if there is WiFi but no internet

对着背影说爱祢 提交于 2019-11-28 20:39:37
问题 I am writing a program where I need to check three states: 1. If I have no WiFi, 2. if I have WiFi but no internet connection (like if I turn on my router but unplug the Ethernet cable), and 3. if I have WiFi and internet connection. I would then change color of a icon in my app to represent one of these states (red, yellow, or green). Currently condition 2 does not work, anytime I unplug the cable on my router for testing, the icon color changes from green to red. public static void doPing

Captive portal on android device

吃可爱长大的小学妹 提交于 2019-11-28 20:32:15
问题 I am using my android device as a mobile web server. I want to direct every user that connects through my portable Android hotspot to a specific wellcome page. Does anybody know how to implement this technique in my device (I believe this is called the captive portal technique)? 回答1: I answer my own question until someone shares some useful information on how to implement the captive portal in a non-rooted device. At the moment I am not aware of such working solution. Captive portal works by

Can WIFI direct and WIFI station work simultaneously?

别等时光非礼了梦想. 提交于 2019-11-28 19:34:42
As far as I know, essentially WIFI direct is enabled by a soft AP. My question: can the underlying WIFI module work as a WIFI station and as a WIFI direct endpoint simultaneously? That means, we hope that the WIFI module can communicate with a mobile phone using WIFI direct, and at the same time connect to a router as a WIFI station. Is it possible? and how widely and strongly is this case supported in technology? Halim Qarroum You can if your wifi driver supports multi-role . This feature, available in some wifi chip (e.g TI's wl1271 ), allows you to use one wifi chip for different roles. We

iOS API detect wireless networks

瘦欲@ 提交于 2019-11-28 19:25:19
Is there an API in CocoaTouch/iOS for detecting wireless networks? I want to write an app that saves a list of networks the phone can see at a given moment. Ali As far as I know you can get the information about the current connected Wi-Fi using CNCopySupportedInterfaces and CNCopyCurrentNetworkInfo of CaptiveNetwork . You can refer to: How do I use CaptiveNetwork to get the current WiFi Hotspot Name for more information . According to iPhone get a list of all SSIDs without private library : Without the use of private library (Apple80211) you can only get the SSID of the network your device is

iOS detect WiFi hotspots or Bluetooth Devices

浪子不回头ぞ 提交于 2019-11-28 19:01:41
I know that without users permission trying to switch on WiFi or Bluetooth is not possible (rather comes under private API). I dont want to go there. Assuming WiFi is switched on or assuming bluetooth is switched on. Is it possible to detect all Wifi hotspots around my device (iPhone or iPad)? Same for Bluetooth? I want to do this in Xcode Version 4.x with iOS SDK 4.3 Update Apple has deprecated a large part of the GameKit peering methods in iOS7. Added updated information for iOS8. iOS7 and earlier - GameKit/Wi-Fi; The GameKit documentation contains all the information required to set up a

Parsing WiFi Packets (libpcap)

允我心安 提交于 2019-11-28 18:53:42
I've been working on a way to have an OpenWRT router log WiFi probe requests to a MySQL db (it stores MAC address and RSSI info for each probe request packet along with other, router-specific data). After researching libpcap quite a bit, I've been able to cobble together a basic little program that simply sniffs packets on a monitor interface (mon0) using a filter expression ('wlan subtype probe-req') and then prints out the raw packets in hex. With the info that's available online on libpcap this part was fairly straightforward. Now here's where I'm stuck: How do I parse the WiFi packet to

Send notification to all the devices connected to a Wi-Fi network

柔情痞子 提交于 2019-11-28 18:47:53
Is there any way to send a notification to the devices which are connected to a particular Wi-Fi network? Say, I have a Wi-Fi network named "My Wi-Fi", which is not secured, that is any one can connect. A public network. There may be N-number of users connected to "My Wi-Fi". These users can perform any kind of transaction, say online payment. Now if I want to turn off or shut down "My Wi-Fi" router or access point, these transactions may fail. So before shutting down, I want to send a text notification to all the users connected to "My Wi-Fi" network. (User does not have any kind of app in

how to use the libnl library to trigger nl80211 commands?

孤人 提交于 2019-11-28 18:30:05
Please can someone give an simple example on how to use libnl to use nl80211. I tried to go through iw source code but it is very confusing. Can any one give a simple program on how to trigger nl80211 commands such as NL80211_CMD_GET_WIPHY using the libnl. Here is a very basic program sending a NL80211_CMD_GET_INTERFACE , and parsing out the interface type returned in the NL80211_CMD_GET_INTERFACE attribute. Beware, there is very little error checking here, you should not use any of this program as is! Almost all these functions can fail. #include "netlink/netlink.h" #include "netlink/genl

wait until wifi connected on android

瘦欲@ 提交于 2019-11-28 18:24:04
I have a small program that trying to connect to a wifi network. It enables the wifi on the device then if it's the first time that is connect to the certain networkss It loads the device wifi in order to select and add the password for connection. Until I add the password in order to connect the program should not be finished. How can I add something to wait until I get from the wifi manager that is connected? I try sleep but it freeze the application and am not getting the wifi pop up menu to connect? are there any other ways? R4j I have found the solution for your problem a month ago, just