android-wifi

SUPPLICANT_CONNECTION_CHANGE_ACTION never received

允我心安 提交于 2019-12-10 14:09:51
问题 I am looking to be notified when the device switches networks but for some oddball reason, in spite of the documentation and various examples on SO, this particular action never gets sent to my receiver. Here's my code RECEIVER: BroadcastReceiver connectedToLocalWifiReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); Log.d(TAG, "ACTION='" + action +"'"); //<-- WifiManager.SUPPLICANT_CONNECTION_CHANGE

I want to get time from GSM network

∥☆過路亽.° 提交于 2019-12-10 09:32:07
问题 I am using this code but it gives time by wifi..when i turn off wifi,it is not giving me the time... I want to get the time from my GSM service provider... The code which I am using.. LocationManager locMan = (LocationManager) arg0.getSystemService(Context.LOCATION_SERVICE); long networkTS = locMan.getLastKnownLocation(LocationManager.NETWORK_PROVIDER).getTime(); Toast.makeText(arg0,""+networkTS,Toast.LENGTH_LONG ).show(); Date date = new Date(networkTS); SimpleDateFormat format = new

Android Find the device's ip address when it's hosting a hotspot

跟風遠走 提交于 2019-12-10 02:39:51
问题 I need to find the device's ip address when it's hosting a hotspot. I've used this code so far : //if is using Hotspot for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); if (intf.getName().contains("wlan")) { for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { InetAddress inetAddress = enumIpAddr.nextElement(); if (!inetAddress.isLoopbackAddress() &

AIR for Android SocketServer over WiFi

牧云@^-^@ 提交于 2019-12-09 23:25:35
问题 Developing a multiplayer game for Android and using the AIR SocketServer class to communicate between server and client AIR applications. On Windows 8 I am using Virtual Router Plus to set up my PC laptop(where the server app is running) as a wifi hotspot. I run ipconfig in cmd after my wifi is running to grab the ipv4 IP address under 'Wireless LAN adapter Local Area Connection' This is the IP I bind to in the server app and connect to in the client app. If I launch both server and client on

ScanResult capabilities interpretation

喜夏-厌秋 提交于 2019-12-09 15:37:42
问题 I want to analyze the capabilities string of a ScanResult. However, the names ther are grouped in up to four square brackets e.g. [WPA-PSK-TKIP+CCMP][WPA2-PSK-TKIP-CCMP][WPS][ESS] Is there some kind of documentation describing which bracket relates to what, considering that some names may apear in various brackets. It would be great if there was a list of all possible capabilities somewhere as well. 回答1: Last year there was a topic about this issue. You can find some help in this

Forgetting old WiFi Direct connections

♀尐吖头ヾ 提交于 2019-12-09 12:46:36
问题 Is there a way to forget old WiFi Direct connections(in code)? I need this so as to change who becomes Group owner. I am setting groupOwnerIntent = 15 and yet not becoming Group owner. 回答1: If you want just to discinnect from existant WiFiP2p connection, than just call WiFiP2pManager#removeGroup . Doesnt matter is device GO or peer. If you are talking about forgeting persistant groups - u can also remove it. But it can only be achieved via reflection. And also no matter is device GO or peer.

Android/Java WiFi direct peer list

房东的猫 提交于 2019-12-09 12:33:35
问题 Yo, I'm trying to get an Android device (it's a Nexus 7 although I can't imagine that matters too much) to communicate with a Raspberry Pi throught the wonders of WiFi Direct. Supposedly it's possible, and it seemed six hours ago like a better solution than going down the server-client route, but I'm running into issues The Android developer website is nice in that it has two guides: http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html http://developer.android.com

How to get WiFi security (NONE, WEP, WPA, WPA2) from Android WifiConfiguration entry?

你离开我真会死。 提交于 2019-12-09 12:02:47
问题 I need to get security type from WifiConfiguration entry. Is it possible? String getSecurityType(WifiConfiguration conf) { } returning values "NONE", "WEP", "WPA", "WPA2" For those who think it's a duplicate question: I want to get information from WiFiConfiguration object and not from ScanResult object. It's not the same! 回答1: I can do it, simply: import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiConfiguration.AuthAlgorithm; import android.net.wifi.WifiConfiguration

how to get Distance between wifi access point and Mobile Device

眉间皱痕 提交于 2019-12-09 07:18:43
问题 i am developing an android application which have module to search all nearest / detected wifi hotspot. i can get all detail from searched wifi hotspot like, SSID, BSSID, capabilities, frequency, level and timestamp with these information, i also need Distance of wifi ( The distance between wifi accesspoint and Mobile Device ) i am using below lines to get Distance. double exp = (27.55 - (20 * Math.log10(freqInMHz)) + Math.abs(levelInDb)) / 20.0; double distanceM = Math.pow(10.0, exp); this

Oreo Wifi Connectivity

半城伤御伤魂 提交于 2019-12-09 05:47:36
问题 I am working on an IoT app in which there is an on boarding process where the user connects to an access point, which has not internet connectivity, configure the device and then connects to his home Wifi network. Android 8 devices have been causing some problems, disconnecting from the access point and reconnecting to a previously configured network. I am assuming this is related to the connectivity update which was introduced in Android 8, from section Seamless Connectivity in this link: On