android-wifi

Share Wifi credentials via NFC tag without special apps

大憨熊 提交于 2019-12-02 15:11:37
I am looking for a way to create a NFC-tag that shares the wifi credentials of my network without my guests having to have any special NFC apps on their phone (other than whats coming with the phone). I have been looking at apps and services like NFC Tag Writer, WifiTap, NFC Task Launcher and NFCLabels.com, but it seems to me like it I would need to have the apps on the guest mobile as well to be able to use it, but I am not able to test it as I only have one NFC-enabled phone available. (Yes, I know, twisting my brains for nothing, but heck, weird behaviour is nothing new...) My closest clue

Wifi Scanner which scans 20 times

半城伤御伤魂 提交于 2019-12-02 14:58:34
问题 I am trying to make wifi scanner for my project which does 20 scan when I hit the scan button. When I run the code its scans but I dont know it scans for 20 times or not and the RSSI value/wifi level keeps changing. In log it also says that you need to unregisterReciever. My MainActivity.java package com.example.scanner; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.text

32 - How to overcome the Wi-Fi Direct 32 limit on credentials in Android?

浪子不回头ぞ 提交于 2019-12-02 14:03:28
问题 See-> https://android.googlesource.com/platform/frameworks/base/+/b267554/wifi/java/android/net/wifi/p2p/WifiP2pGroupList.java#34 private static final int CREDENTIAL_MAX_NUM = 32; Which is essentially limiting the number of devices I can have connected in a single Wi-Fi Direct 'cloud' per se. This Question spawns from the answer and comments at https://stackoverflow.com/a/26242221/1815624 This Question is not a question of "How to" connect multiple device such as found at WiFi Direct for

Can't connect to WiFi network

走远了吗. 提交于 2019-12-02 13:03:20
问题 I am new to android development and was trying to connect to WiFi network using the Android SDK. The code for disconnect works fine but re-connection fails. Here's the code that i have try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; // Please note the quotes. String should contain SSID in quotes conf.wepKeys[0] = password; //WEP password is in hex, we do not need to surround it with quotes. conf.wepTxKeyIndex = 0; conf.allowedKeyManagement.set

wakeLock does not wait for network connectivity

喜欢而已 提交于 2019-12-02 10:12:55
问题 I am using a wakelock for a alarm to update the app state regularly. The wifi takes a while to connect on Samsung phones. Also the "keep awake" option on Wifi does not work on Samsung phones (nor are they interested in fixing the issue). So when the wakelock does happen, it should wait for wifi to connect. Do I need to create a listener for the wifi connectivity for this to work, or should wakelock, kinda block for that wifi to connect ? mWakeLock = ((PowerManager) getSystemService(POWER

wifi getLinkSpeed() return a value always

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 10:12:27
I am developing an application that displays internet speed. like: https://play.google.com/store/apps/details?id=netspeed.pt https://play.google.com/store/apps/details?id=com.internet.speed.meter.lite&hl=en I have to gain WiFi speed at any moment, I used the runnable: WifiManager wm = (WifiManager)getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInfo = wm.getConnectionInfo(); .... runnable = new Runnable() { @Override public void run() { int linkSpeed = wifiInfo.getLinkSpeed(); chatHead.setText( "Speed : " + linkSpeed); handler.postDelayed(runnable,100); } }; handler.postDelayed(runnable

WifiManager.getConfiguredNetworks always returns empty list

戏子无情 提交于 2019-12-02 08:12:18
问题 I am trying to connect to an open wifi network. When I open my app it should turn on wifi and connect to the network defined as below. The problem is that WifiManager.getConfiguredNetworks always returns me an empty list. I have tried using locks too without success. WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; conf.status = WifiConfiguration.Status.ENABLED; conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); conf.priority = Integer.MAX

Peer to peer data sharing using Wi-Fi direct

﹥>﹥吖頭↗ 提交于 2019-12-02 08:07:45
I am developing an Android multiplayer game using Wi-Fi direct . Using Wi-Fi direct, I am able to establish connection between peer devices. Also the code is able to send the data from client device to server device. (According to Android documentation, the Wi-Fi direct uses client-server model) Problem : I am not able to share the data from server device to client device using Wi-Fi direct. I have following questions: Is there any other way to transfer data (bi-directional) between two Android devices which are connected through Wi-Fi Direct? During my online research I understood that to

Is it possible to programatically enable wifi on Android 10 devices?

蓝咒 提交于 2019-12-02 07:53:20
Since setWifiEnabled is deprecated on Android 10, how does one programatically enable wifi on Android 10 devices? Is it not possible to programatically enable wifi at all on Android 10+ (SDK 29) ? No, This is not possible to enable or disable Wi-Fi programmatically from Android-10 API level 29 [ Until google provides an alternative solution ]. For applications targeting Build.VERSION_CODES.Q or above, this API will always return false and will have no effect. If apps are targeting an older SDK ( Build.VERSION_CODES.P or below), they can continue to use this API. There is an issue 128554616

WifiManager.getConfiguredNetworks always returns empty list

故事扮演 提交于 2019-12-02 07:21:41
I am trying to connect to an open wifi network. When I open my app it should turn on wifi and connect to the network defined as below. The problem is that WifiManager.getConfiguredNetworks always returns me an empty list. I have tried using locks too without success. WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; conf.status = WifiConfiguration.Status.ENABLED; conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); conf.priority = Integer.MAX_VALUE; WifiManager wifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE); wifiManager