wifimanager

How can I set ProxySettings and ProxyProperties on Android Wi-Fi connection using Java?

。_饼干妹妹 提交于 2019-12-17 08:54:10
问题 How can I set ProxySettings and ProxyProperties on an Android Wi-Fi connection using Java (programatically)? As ipAssignment, linkProperties, ProxySettings and ProxyProperties are hidden fields within WifiConfiguration on Android 3.1 and up, I need to be able to enum the class and use the fields. Following the code sample using the link below, I can set a static IP address, gateway and DNS for a particular Wi-Fi connection, but I also need to set Wificonfiguration.ProxySettings.STATIC and

How to use SUPPLICANT_STATE_CHANGED_ACTION WiFi BroadcastReceiver - android

房东的猫 提交于 2019-12-14 03:49:43
问题 I want to show the connection process on the screen when my device is connecting to the wifi network. SUPPLICANT_STATE_CHANGED_ACTION is provided by WifiManager but i don't know how to use it. Can anyone help me please? 回答1: I don't know of a callback method that lets you know when the wifi status has changed. I polled the information using a Handler running in the background. Add the handler to your class. private WifiStatusHandler wifiStatusHandler = new WifiStatusHandler(); Start it by

SecurityException when getting Wifi Scan Results

我是研究僧i 提交于 2019-12-13 14:28:14
问题 I'm working with Android Studio on an app that, when I push a button, gives me the results of wifi scan! If I test the code alone (only the part "wifi scan") it works... But when I put it in the complete app, the app crashs! Why? I post my code: //MAIN package com.example.pc1.tesiprova; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget

How to Troubleshoot Asynctask?

不羁岁月 提交于 2019-12-13 05:31:21
问题 My App shows a NetworkOnMainThreadException in the Log Cat. So I found the Asynctask Method to offload network operations to a background thread. After adding the AsyncTask.It shows ViewRootImpl$CalledFromWrongThreadException .So i have to use onPostExecute . I learnt the Asyntack Docs & tried.Now i got Stuck it is not Returning the correct output.I don't know whether i declared it under the respective Method's. I want to display the processed Text in the Textview tv So Help me in the Right

Calling WifiManager.startLocalOnlyHotspot() throws SecurityException even after granting all required permissions on some devices

允我心安 提交于 2019-12-13 03:14:04
问题 I am working on a file sharing app. I need to turn on local only hotspot of a device programmatically by calling WifiManager.startLocalOnlyHotspot(). According to the android docs on this page - https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%2520android.os.Handler), Applications need to have the following permissions to start LocalOnlyHotspot: Manifest.permission.CHANGE_WIFI_STATE and ACCESS

wifiManager.startScan not returning any results (need some guidance please)

只谈情不闲聊 提交于 2019-12-12 12:15:27
问题 At this moment in time I am trying to build an Android application that will be able to locate a wifi enabled device indoors. So I have broken it down into various steps in order and 1 of the steps is to scan for available wireless networks and return the signal strength etc associated with each access point that it discovers (it doesn't have to connect to the access points but just has to ping them for information). Below shows the snippet of code that I have created and when the code is

Android How to scan for hidden access points

大憨熊 提交于 2019-12-11 18:15:28
问题 how can i do programmatically scan for hidden Wireless Access Points, in android ? getScanResults give me only visible Access Points , but i need to discover hidden too. When programmatically scanning Wi-Fi networks (using WifiManager.startScan() and WifiManager.getScanResults() ), when the SSID broadcast is disabled on an access point and the access point has never been connected to the device, the ScanResult element for this access point does not appear in the list of access points returned

Network Status is Missing

為{幸葍}努か 提交于 2019-12-11 11:45:04
问题 I'm able to add network using following code but not able to get status if its added or authentication failed after Enable Network and reconnect . Please help!!! mWifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE); removeNetwork(); Boolean isWifiConnected = false; WifiConfiguration mWifiConf = new WifiConfiguration(); mWifiConf.SSID = "\"" + networkList.get(item_pos).SSID + "\""; mWifiConf.hiddenSSID = true; mWifiConf.status = WifiConfiguration.Status.ENABLED; mWifiConf

Android WifiManager getConnectionInfo requires CHANGE_WIFI_STATE?

扶醉桌前 提交于 2019-12-11 06:28:55
问题 I'm getting a user report on an error about missing the CHANGE_WIFI_STATE permission: Error: java.lang.SecurityException: WifiService: Neither user 10137 nor current process has android.permission.CHANGE_WIFI_STATE. at android.net.wifi.WifiManager.getConnectionInfo(WifiManager.java:642) This is the code block: WifiManager wifiMan = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); if (wifiMan != null) { WifiInfo wifiInfo = wifiMan.getConnectionInfo(); I thought this only required

Android Customize Wifi Scan

不打扰是莪最后的温柔 提交于 2019-12-10 18:13:01
问题 I am interested in scanning only a particular set of frequencies for a particular time interval (this is different from scanning interval in android api). Is there any high level api or user to kernel space communication interfaces, mechanisms (sysfs,iotctl,mmap etc.) (in a rooted device) that can allow me to specify the set of frequencies to be scanned for a particular interval of time. If I understand correctly the device supplicant carries this information? Would very much appreciate if