android-wifi

duplicate SSID in scanning wifi result

十年热恋 提交于 2019-12-04 15:00:38
i'm trying to make an app that can create a list of available wifi access point. here's part of the code i used: x = new BroadcastReceiver() { @Override public void onReceive(Context c, Intent intent) { results = wifi.getScanResults(); size = results.size(); if (results != null) { for (int i=0; i<size; i++){ ScanResult scanresult = wifi.getScanResults().get(i); String ssid = scanresult.SSID; int rssi = scanresult.level; String rssiString = String.valueOf(rssi); textStatus.append(ssid + "," + rssiString); textStatus.append("\n"); } unregisterReceiver(x); //stops the continuous scan textState

How to connect to a wireless network in android?

こ雲淡風輕ζ 提交于 2019-12-04 14:13:23
I have managed to scan for wireless networks and obtain scan results in my application. but is there a way i could possibly connect to them using my app itself? I was wondering whether I would have to specify the encryption type for the network i'm trying to connect? and my requirement would be to connect to any wireless network irrespective of it's encryption type? Any ideas? Thanks TO connect to WiFi AP needed to implement followed steps: Scan WiFi To be sure that you have appropriate AP. Bear in mind that you must provide password to secured AP. Suppose you know witch AP you prefer and now

How to auto connect a WiFi with specified SSID?

此生再无相见时 提交于 2019-12-04 13:46:24
问题 Can some body help me to solve this issue? Here is my code, and at mWifi.enableNetwork(netID, true) it's cannot enable network and cannot auto connect to specified network. So I want to know where I had made a mistake? public class WifiConnActivity extends Activity { /** Called when the activity is first created. */ final String tag = "WifiConn:..."; EditText txt; WifiManager mWifi; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView

Get IP from wifi hotspot in android

一世执手 提交于 2019-12-04 13:16:32
问题 I want to get IP of wifi hotspot (from another computer) that android device connect via wifi, not IP local of android . I run application in real device . I can scan all wifi and get name of them. public class WifiConnectorActivity extends Activity { TextView mainText; WifiManager mainWifi; WifiReceiver receiverWifi; List<ScanResult> wifiList; StringBuilder sb = new StringBuilder(); /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {

How to programmatically install a CA Certificate (for EAP WiFi configuration) in Android?

你。 提交于 2019-12-04 11:45:31
问题 My objective: Create an EAP WiFi configuration - including the CA Certificate - in Android programmitcally. Problem: How do I install a CA Certificate programmatically (and then reference that certificate in the EAP WiFi configuration)? I found a very useful link already that allows me to create and save EAP WiFi configurations here: How to programmatically create and read WEP/EAP WiFi configurations in Android? However this assumes that you have already installed the CA Certificate on the

connect wpa2 enterprise wifi connection programmatically in android

你。 提交于 2019-12-04 11:23:12
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; wifiConfiguration.hiddenSSID = true; wifiConfiguration.status = WifiConfiguration.Status.DISABLED;

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

落爺英雄遲暮 提交于 2019-12-04 11:22:27
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: <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> The permission has always been

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

烈酒焚心 提交于 2019-12-04 09:42:06
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 secondary login and is much faster). It works, but it's EXTREMELY slow. When I hit the "run" button in

WifiConfiguration enable network in Lollipop

时间秒杀一切 提交于 2019-12-04 08:41:31
问题 I was working on Wifi project, there is a module that enable user to join wifi programatically. In kitkat and below it's working successfully, but in Lollipop it's not working. Here is the code : WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiConfiguration wifiConfiguration = new WifiConfiguration(); wifiConfiguration.SSID = "\"testSSID\""; wifiConfiguration.hiddenSSID = true; wifiConfiguration.status = WifiConfiguration.Status.ENABLED; wifiConfiguration

Scan Network For A Specific MAC Address - Android

假如想象 提交于 2019-12-04 07:59:29
问题 I'm designing an Application to control multi zone audio amplifiers. To do so I have to create a socket connection, So far that works fine. What I would like to do is instead of the user having to manually type in the ip address I would like my app to automatically scan the network, check all MAC address Match it to the NIC database, if it matches the corp of my amp, then save the ip address. Is that possible if yes how? Or is there an easier way to do it? 回答1: I made it for my app "Network