android-wifi

How to get BSSID of all wifi access points?

一个人想着一个人 提交于 2019-11-30 08:41:00
I need to get BSSID(MAC) of all AP's. Please find below code block. List<WifiConfiguration> test = wifiManager.getConfiguredNetworks(); for(int k=0;k<test.size();k++){ Log.d("acheck", "test BSSID = "+test.get(k).BSSID); Log.d("acheck", "test BSSID = "+test.get(k).BSSID); } But above code block returns SSID properly but null for BSSID. I want to connect to strongest access point with user defined SSID. Is there any API method available to get best signal strength's AP with user defined SSID.(In my case there are many SSID's with single SSID with multiple AP's available.) Adapted the answer by

Getting the MAC address of the device- when wifi is off

試著忘記壹切 提交于 2019-11-30 07:26:40
I am finding the MAC address of the Android Device using the following code: WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = manager.getConnectionInfo(); String address = info.getMacAddress()); But in this case I am unable to get the MAC address when the Wifi is off. How can I get the MAC address of the Android Device even when WIFI is off. Thanks Siddharth Lele Why not enable the Wifi momentarily until you get the MAC address and then disable it once you are done getting the MAC address? Of course, doing this is if getting the MAC address is

Multiplexed hotspot in Android

删除回忆录丶 提交于 2019-11-30 07:26:18
Is it possible to write an app in Android using the wifi API which will act like a hotspot (so granting network access to wifi clients) while still allowing the local wifi device to connect to another wifi network ? The one I've tested are disabling local Wifi connection in order to create a hotspot. I post here after a few months so people that would like to implement this on an Android device might be helped. There is a way to have one wireless chip working in hybrid mode, with both station mode (STA) and access point mode (AP) enabled. To do this, I replaced the wireless driver of my chip

How to start a local network connection programmatically via Wi-Fi hotspot on Android?

北城余情 提交于 2019-11-30 06:52:25
I want to start a local network connection using the built-in Wi-Fi hotspot on Android devices. Is there a way to accomplish it? And how to communicate between two devices? EDIT: I want to do it programmatically. Then I can transfer my own data between devices. brianestey I haven't done this before, so my answer is all theoretical. I think what you need to do is declare one device the server and start its hotspot manually with a known name. Start / stop built-in Wi-Fi / USB tethering from code? (According to this question, you can't start hotspot programatically). Once you have the hotspot set

“android.os.NetworkOnMainThreadException” when trying to connect over WiFi using Calimero Java Library

坚强是说给别人听的谎言 提交于 2019-11-30 05:41:12
问题 I am using an Android app using a open source java library (Calimero). My code throws an erro when I try to connect over WiFi to a KNXnet/IP router. Here the problem code: private static KNXNetworkLinkIP connect(InetSocketAddress isaLocalEP, InetSocketAddress isaRemoteEP) { KNXNetworkLinkIP netLinkIp = null; int serviceMode = KNXNetworkLinkIP.TUNNEL; // tunnel to IP router boolean useNAT = true; // NAT not used for PC true or false , but needed for emulator = true KNXMediumSettings tpSettings

Changing Android hotspot settings

心已入冬 提交于 2019-11-30 05:28:33
With the release of API level 26, my app's core functionality broke, this being, changing the users' hotspot setting within the application. To get and set this configuration I am using the following functions from the WifiManager hidden api: getWifiApConfiguration and setWifiApConfiguration . Method getWifiApConfiguration = wifiManager.getClass().getMethod("getWifiApConfiguration"); getWifiApConfiguration.invoke(wifiManager); This is working with devices prior to Android O, but in this version I get the following error: App not allowed to read or update stored WiFi Ap config (uid = 10168) The

Data transfer between two Wifi devices

跟風遠走 提交于 2019-11-30 05:25:36
I have searched in Google. In Android 2.2 and sdk 8 how can I use SSID in a List in Android ? By using SSID should get specific wifi enabled device properties by programmatically. With that help, should transfer the data between two Wifi enabled devices in Android. To send data in a meaningful manner between two Android devices you would use a TCP connection. To do that you need the ip address and the port on which the other device is listening. Examples are taken from here . For the server side (listening side) you need a server socket: try { Boolean end = false; ServerSocket ss = new

Connect two android phones with wi-fi (without laptop or access point) and send file

↘锁芯ラ 提交于 2019-11-29 22:52:52
Is it possible to connect two android phones by wi-fi, without using a bluetooth/GSM/CDMA/IR? Also, there is no any laptop or wi-fi access points or wi-fi routers. I think, that it is possible to create some SSID on both phones, do a static configure of IP addresses. Will android connect to another's android wi-fi? If they will be connected, how can I send a file from one phone to second? Is there a ftp-client and server? or Can I ssh to other phone? Or telnel/netcat? Maybe http ? Peter Knego This is called ad hoc network and has been asked before: Can Android do peer-to-peer ad-hoc networking

WiFi getScanResults returns an empty list if GPS is off. (Android 6.0.1)

僤鯓⒐⒋嵵緔 提交于 2019-11-29 21:56:31
问题 i tried to explain the problem in this gif basically, this test app receives an "RSSI_CHANGED" intent and displays the scan results on the screen. scan results are always empty unless GPS is enabled. I guess my question is why? To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, your app must now have the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions I have "ACCESS_COARSE_LOCATION" granted 回答1: You must declare ACCESS_COARSE_LOCATION or

android 6.0.1 force wifi connection with no internet access

℡╲_俬逩灬. 提交于 2019-11-29 17:23:30
问题 this has many similar questions (google for: "no internet access detected. won't automatically reconnect." or: android force wifi connection programmatically). i thought i had a answer here, but it stopped working after installing 6.0.1 updates (i have may 1 security patches). seems like this is a behaviour change. i have some 2013 nexus 7's with 6.0.1 that run a kiosk type app and want to connect programmatically to a specific wireless network that has no internet connection. each tablet has