android-wifi

Android WifiManager getScanResult complains Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission although declared permission

荒凉一梦 提交于 2019-12-07 04:14:19
问题 I am developing an App to check Wifi points. I am getting error "java.lang.SecurityException: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results" at wifiManager.getScanResults() even though I already declared those permissions. main activity public class MainActivity extends AppCompatActivity { WifiManager wifiManager; String[] wifis; WifiReceiver wifiReceiver; ListView wifiListView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

Flag Wifi as mobile hotspot based on its name from code

橙三吉。 提交于 2019-12-07 03:04:27
Situation I have an android tablet connecting to an onboard unit (OBU) an a car via WiFi. The OBU has SIM card providing access to internet. The apps on the tablet communicate with server via the internet provided by the OBU. So, basically the OBU serves as mobile hotspot for the tablet. Problem The tablet performs updates that consume lot of data because it thinks it on Wifi This leads to depleting of the data limit available to the SIM card This leads to failure of the whole solution ... or extra costs for each additional MB (over the limit) of transferred data Facts I can prevent automatic

How to use adb tcpip without USB debugging enabled?

断了今生、忘了曾经 提交于 2019-12-06 20:53:39
问题 I've read quite a few posts already on adb and tcpip mode and I can create a wireless adb connection, but only when USB debugging is on. The way I'm using it is like so: USB debugging is enabled call adb tcpip on the computer (switches from usb to tcpip mode with default port 5555) call adb connect PHONE_IP and a connection is made The above works with or without the usb cable being connected, but only when the USB debugging option is ticked in Developer Options on the Android device. As soon

Constantly check for wireless network change [duplicate]

南笙酒味 提交于 2019-12-06 14:47:37
问题 This question already has an answer here : How can I monitor the network connection status in Android? (1 answer) Closed 6 years ago . I would like to constantly check whether the phone is connected to a specific wireless network. I thought of a service and the SSID of the network of course, but how? 回答1: You'll want <intent-filter> <action android:name="android.net.wifi.WIFI_STATE_CHANGED"/> <action android:name="android.net.wifi.STATE_CHANGE"/> </intent-filter> In your receiver tag. Or if

find internet ip address in android mobile programmatically , no need device ip address

蹲街弑〆低调 提交于 2019-12-06 14:16:15
i am trying to get the Internet Ip Address in my mobile. no need for device ip address. that device is connected with wifi or 3g or 2g or anyway. that mobile is having internet facility means, i need that internet IP Address. Note : already i tried some coding. that code will work to get the device ip address only. my prev code : try { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses();enumIpAddr.hasMoreElements();) { InetAddress

Connecting to a WiFi through an Android application

为君一笑 提交于 2019-12-06 12:54:35
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 overview of how should I connect to them. Can anyone help me with this ? I searched all available answers, and

Listen to probe requests from wi-fi devices

*爱你&永不变心* 提交于 2019-12-06 12:39:54
问题 I have an android device which is configured as a wireless hotspot. I want to find out how I can listen to "Probe Requests" from devices using Android APIs. I know this can be done by using various tools but only when you have root access. I believe we should also be able to listen to Probe Requests without the root access. This is because, when we set the phone in hotspot mode it is able to connect to other devices without being in root mode. In order to make a connection, the hotspot device

ADB over Wi-Fi is extremely slow on one PC, great on another

送分小仙女□ 提交于 2019-12-06 06:16:14
问题 I'm trying to learn how to develop for Android, and I'd like to be able to test on my device instead of an emulator. The USB port on my phone is getting pretty loose, and I'd rather not mess it up with the scores of hours I'll be using it to test. I enabled ADB over Wi-Fi on my desktop, and it worked flawlessly. This desktop runs Windows 7 and on my home network. I then installed Android Studio and enabled ADB over Wi-Fi on my laptop, which runs Windows 10 and on my work network (which has no

connect wpa2 enterprise wifi connection programmatically in android

吃可爱长大的小学妹 提交于 2019-12-06 05:20:59
问题 I just tried few codes for wpa2 enterprise connection in android but nothing is connecting i want a right code to connect the right network. right now i have used this answer but i need few clarification because this answer is very old one. here i am attaching some screenshot about connection clarification. In this you can see identity and password WifiConfiguration wifiConfiguration = new WifiConfiguration(); wifiConfiguration.SSID = "\"" + networkSSID + "\""; wifiConfiguration.BSSID = Bssid

Application (WiFi connections) doesn't work anymore on Android 6.0 Marshmallow

余生长醉 提交于 2019-12-06 05:00:42
问题 My application stopped working once I upgraded to Marshmallow, it was supposed to be able to change the WiFi connection, but now it doesn't do anything at all. I've spent some time reading about the new permission model of the Android 6.0. Well awesome, but old apps should continue working... Anyway, I started trying to implement the granting of permission, but realized that this is a normal permission and there should be done no permission request for it if it's defined in android manifest: