android-wifi

Connecting to a WiFi through an Android application

怎甘沉沦 提交于 2019-12-22 18:35:04
问题 I wish to create an application, that detects the available wifi connections in the vicinity, and then connects to them. What I have done till now, is that I created a ListView that lists the available wifi connections, and then I created a LongItemClick dialog box, that shows the SSID and the BSSID of the network, and asks for the password. Now, I wish to connect to one of the networks, independent of what kind of network it is, it might be WEP, WPA or Open too. I am unable to get an

Android Wifi Settings within app(Kiosk-sh app)

五迷三道 提交于 2019-12-22 13:56:14
问题 So I am writing a app that runs on Android 4.4.2. I need to make my app be the only thing that is capable of running(Like what many call kiosk mode). The device manufacturer is removing the top menu bar and navigation bar so the user can't access anything but our app that is assigned to be the home screen. The only issue is I need the user to be able to setup wifi networks, but do now want them to have access to any other settings of any kind. Ideally I just want a wifi settings popup that

Android - Get Notified when a new access point is detected?

一个人想着一个人 提交于 2019-12-22 10:51:39
问题 Does Android provide a notification of being in vicinity of a new Wifi Network? Whether the device is configured to connect to that wifi network depends on whether the device has the wifi configuration set for that particular wifi network, but is it possible to get notification whenever entering any new wifi network? I saw the WifiManager class but the states inside the class do not seem to achieve what I am trying to do. Any ideas? 回答1: Use a BroadcastReceiver registered to receive intents

How to detect whether device has 5Ghz Wi-Fi or not

北战南征 提交于 2019-12-22 08:45:08
问题 I spent much time by seaching for solution but without result. So my question is, is there any way how to detect whether device has 5Ghz Wifi or not? It would be nice if it's possible to achieve that. I already analysed WifiManager but didn't find proper method or property. Thanks in advance. 回答1: As of Android API Level 21, WifiManager has a method called is5GHzBandSupported() that returns true if the adapter supports 5 GHz band. 回答2: Our approach is to look for the results of a wifi scan

Android network printers discovery: NullPointerException

限于喜欢 提交于 2019-12-22 08:23:08
问题 This question does sound strange, but I never experienced this before. I'm working on network printer application and use NsdManager to discover printers in the WiFi network. It had been working fine for last two weeks, discovering and resolving printers in the same WiFi network. But all of a sudden I started getting the following exception every time I initiate discovery: 06-03 15:38:07.351: ERROR/AndroidRuntime(16849): FATAL EXCEPTION: NsdManager java.lang.NullPointerException at android

Is it possible to add a network configuration on Android Q?

女生的网名这么多〃 提交于 2019-12-22 05:52:07
问题 Background I've noticed that in WifiManager class there is a function called addNetwork, that might be useful if I want to restore or save networks information (network name AKA SSID, together with the password and the type), so that I could also connect to it. The problem I can't find much information about how to do such a thing. I've seen various examples on StackOverflow, and if I target Android API 28 (or below), I indeed succeed to make it add a network and even connect to it. When

Setting wifi ssid with a space in it

别等时光非礼了梦想. 提交于 2019-12-22 05:50:11
问题 I am trying to setup the wifi on my android things raspberry pi following the documentation. My Ssid contains a space in the name let's say "my ssid". I tried to put quotes around it like this: $ adb shell am startservice \ -n com.google.wifisetup/.WifiSetupService \ -a WifiSetupService.Connect \ -e ssid "my ssid" \ -e passphrase secretpassword When looking at the logcat for the wifi connection I see: WifiNetworkHistory: saving network history: "my"NONE gw: null Network Selection-status:

Why does having Wifi on but not connected help Network location, when using LocationManager?

99封情书 提交于 2019-12-22 05:04:47
问题 This is possibly off-topic for SO, if so I apologise (and gladly accept the flag for closure), but I'm having issues figuring out why when WIFI is on, but not connected to any access point (on my android device), it vastly improves the accuracy of network provider when using LocationManager . Without it on, the general network location result is about 1 mile away from my current position. Also, most of the time the lat/lng values returned are different, so it's not even that it requested once

Broadcast receiver not working background on some devices

别来无恙 提交于 2019-12-22 00:49:23
问题 I am trying to get WiFi connection changing event using Broadcast Receiver class. I have tested this on Samsung S7 edge and HTC 626Q and it works well (even when the app is closed), but this is not working on Huawei GR5 2017 if the app is closed. It works only when the app is running on screen. Both S7 and GR5 devices have Android 7 (Nougat) OS. Broadcast Receiver public class NetworkChangeReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) {

How do I connect to a WiFi Network with an unknown encryption algorithm in Android?

走远了吗. 提交于 2019-12-21 23:01:23
问题 I have researched this question on StackOverflow , but all answers specify how to connect to a network with a known encryption algorithm (mostly WEP). In my application, I retrieve a list of available wifi networks, and display them in a ListView (using WifiManager ). When the user clicks one of the items in the list, I want to connect to the network. My current implementation attempts to get the WifiConfiguration data from a ScanResult 's capabilities String. For example, these are all