android-wifi

How to turn on the Wi-Fi on android emulator device?

佐手、 提交于 2019-12-18 07:44:57
问题 Today, I want to measure the Wi-Fi signal quality. So I download the Wi-Fi Analyzer app, and I install it on the emulator,but it showed that the Wi-Fi has not been turned on. Thus I turn it on, but it still shows errors. I tried several times but it is still not working. Any ideas? 回答1: From Documentation. the Emulator Limitations are: Emulator Limitations In this release, the limitations of the emulator include: No support for placing or receiving actual phone calls. You can simulate phone

How to force the HTTP connection over Wi-Fi instead of cellular in Android?

和自甴很熟 提交于 2019-12-18 06:59:07
问题 My application has to detect that the device connected to the Wi-Fi network is the required one and then fire a HTTP request over that Wi-Fi network programmatically. I have searched, but I didn't find any method or class which will help me to do this. I thought of disabling the cellular network so that the HTTP request will go through the Wi-Fi network but even in this I didn't have success. And also, can I enable and disable the cellular and Wi-Fi networks programatically? 回答1: There is no

How to forget a wireless network in android programmatically?

纵然是瞬间 提交于 2019-12-17 22:16:42
问题 I am working on an app which wifi , where user will be asked to enter password for the scanned network he selects, if user enters a correct password, it connects and works well. But when user enters wrong password, a new network is added with that name, and will be failing to authenticate cos of wrong password, and it will be having authentication problem status. Now if user tries to again scan and select the same network, and enters correct password, it fails to connect even though password

Android WifiManager.addNetwork() returns -1

不问归期 提交于 2019-12-17 19:32:41
问题 I am writing an android app which will connect to a specific WPA access point, when connected, it will issue a http call. It will not save the network config. I have read almost every post on stack overflow on connecting to wifi network but can't find the answer which works for me. Here is the code I am using to connect.. WifiConfiguration wc = new WifiConfiguration(); wc.allowedAuthAlgorithms.clear(); wc.allowedGroupCiphers.clear(); wc.allowedPairwiseCiphers.clear(); wc.allowedProtocols

Can I turn on WiFi-Direct from code? on Android API-14 (ICS)

天大地大妈咪最大 提交于 2019-12-17 18:36:30
问题 I'm using the new Wi-Fi Direct API from google on Android 4.0 and in Sample code they send the User to Settings, to activate WiFi -Direct Mode. Is there a way to Start it by code??? all they offer is to listen to WIFI_P2P_STATE_CHANGED_ACTION intent, and then use this code String action = intent.getAction(); if (WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION.equals(action)) { // UI update to indicate wifi p2p status. int state = intent.getIntExtra(WifiP2pManager.EXTRA_WIFI_STATE, -1); if (state

How to connect to WiFi programmatically

你离开我真会死。 提交于 2019-12-17 16:53:34
问题 I am trying to connect to a new wifi network using an app and not android wifi settings with following code, but it seems that relevant android sdk classes only let you connect to network already stored in android and not to any new network. Am i being correct in thinking that? Here's my code Manifest XML: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="unitedspark.testapp" > <uses-permission android:name="android.permission

Android turn On/Off WiFi HotSpot programmatically

南楼画角 提交于 2019-12-17 02:07:28
问题 Is there an API to turn On/Off the WiFi HotSpot on Android programmatically? What methods should I call to turn it On/Off? UPDATE: There's this option to have the HotSpot enabled, and just turn On/Off the WiFi, but this is not a good solution for me. 回答1: Use the class below to change/check the Wifi hotspot setting: import android.content.*; import android.net.wifi.*; import java.lang.reflect.*; public class ApManager { //check whether wifi hotspot on or off public static boolean isApOn

How can I get Android Wifi Scan Results into a list?

六月ゝ 毕业季﹏ 提交于 2019-12-17 00:49:10
问题 I know how to get a <List> of Android Wifi Scans but I can not figure out the best way to make a list adapter out of them. I would like to just bind SSID and BSSID from a <List> of scans to text1 and text2. Samples of what I have been doing wifi.startScan(); // get list of the results in object format ( like an array ) List<ScanResult> results = wifi.getScanResults();` // loop that goes through list for (ScanResult result : results) { Toast.makeText(this, result.SSID + " " + result.level,

How can I get Android Wifi Scan Results into a list?

别来无恙 提交于 2019-12-17 00:48:50
问题 I know how to get a <List> of Android Wifi Scans but I can not figure out the best way to make a list adapter out of them. I would like to just bind SSID and BSSID from a <List> of scans to text1 and text2. Samples of what I have been doing wifi.startScan(); // get list of the results in object format ( like an array ) List<ScanResult> results = wifi.getScanResults();` // loop that goes through list for (ScanResult result : results) { Toast.makeText(this, result.SSID + " " + result.level,

How can I get Android Wifi Scan Results into a list?

北慕城南 提交于 2019-12-17 00:48:28
问题 I know how to get a <List> of Android Wifi Scans but I can not figure out the best way to make a list adapter out of them. I would like to just bind SSID and BSSID from a <List> of scans to text1 and text2. Samples of what I have been doing wifi.startScan(); // get list of the results in object format ( like an array ) List<ScanResult> results = wifi.getScanResults();` // loop that goes through list for (ScanResult result : results) { Toast.makeText(this, result.SSID + " " + result.level,