android-wifi

Extracting SSID password from supplicant config file in Android

谁都会走 提交于 2019-12-03 20:19:59
I'm trying to write an Android SYSTEM app that extracts the Wifi password from the supplicant configuration file (/data/misc/wifi/wpa_supplicant.conf). Using adb with root permissions, I can read the file without any problem and see the password in plain text. However, when I try to open the file programatically I get EACCES (Permission denied) error. That happens even though my app is running as 'system' user (I define android:sharedUserId="android.uid.system" in the manifest), the app is signed with the system private key and pushed into /system/app. I know for a fact that it can be done

Connecting to specific wifi sometimes fails on android

久未见 提交于 2019-12-03 17:44:10
问题 I am creating an app, which can list out all the available wifi's in a ListView. If I select one of the wifi's in the list, which was cached before in List<WifiConfiguration> list = wifiManager.getConfiguredNetworks(); then it should connect to it. If the WifiConfiguration list doesn't contain the selected wifi, then nothing happens. My problem is, that sometimes I select a wifi from the list (which I know for sure is in the WifiConfiguration list), but it doesn't connects to it. Instead it

Get WiFi Signal Strength of Connected Network

坚强是说给别人听的谎言 提交于 2019-12-03 17:25:06
I'm trying to display the signal strength of the connected WiFi network in my Android app. I've tried the following: //Receiver for information on the network info private BroadcastReceiver mNetworkReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Log.d("INFO", "onReceive()"); List<ScanResult> scanResult = mWifi.getScanResults(); for(ScanResult scan : scanResult) { Log.d("INFO","Network strength: " + String.valueOf(scan.level) + " dBm " + scan.SSID); } } }; And then I do the registering/unregistering of my receiver on the onResume()/onPause(

Broadcast intents for bluetooth, wifi and ringer mode

允我心安 提交于 2019-12-03 16:03:48
What are the intents that are broadcasted in the following events, Wifi state change Bluetooth state change Ringer mode change For Wifi state changes: WifiManager.WIFI_STATE_CHANGED_ACTION ("android.net.wifi.WIFI_STATE_CHANGED") Broadcast intent action indicating that Wi-Fi has been enabled, disabled, enabling, disabling, or unknown. One extra provides this state as an int. Another extra provides the previous state, if available. WifiManager.NETWORK_STATE_CHANGED_ACTION ("android.net.wifi.STATE_CHANGE") Broadcast intent action indicating that the state of Wi-Fi connectivity has changed. One

Unable to access Internet via WiFi from a Background service

依然范特西╮ 提交于 2019-12-03 15:29:22
I'll get straight onto some facts/figures I discovered pls help me if you've faced/solved a similar problem. I send back data every 5 minutes to a server unless the user manually toggles it Off with the help of a wakeful broadcast receiver through a intent service . Plus I get wifi locks before doing (I've tried this already without locks; doesnt work either) Now on devices sending back data from regular data networks (2G/3G/4G) this works fine but on those connected to a wifi network somehow gets me a getActiveNetworkInfo() as null (Even directly hitting the web URL gives a hostname not found

Forgetting old WiFi Direct connections

我只是一个虾纸丫 提交于 2019-12-03 15:25:10
Is there a way to forget old WiFi Direct connections(in code)? I need this so as to change who becomes Group owner. I am setting groupOwnerIntent = 15 and yet not becoming Group owner. If you want just to discinnect from existant WiFiP2p connection, than just call WiFiP2pManager#removeGroup . Doesnt matter is device GO or peer. If you are talking about forgeting persistant groups - u can also remove it. But it can only be achieved via reflection. And also no matter is device GO or peer. manager.removeGroup(channel, new WifiP2pManager.ActionListener() { @Override public void onSuccess() { Log.d

How to get WiFi security (NONE, WEP, WPA, WPA2) from Android WifiConfiguration entry?

牧云@^-^@ 提交于 2019-12-03 14:29:40
I need to get security type from WifiConfiguration entry. Is it possible? String getSecurityType(WifiConfiguration conf) { } returning values "NONE", "WEP", "WPA", "WPA2" For those who think it's a duplicate question: I want to get information from WiFiConfiguration object and not from ScanResult object. It's not the same! I can do it, simply: import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiConfiguration.AuthAlgorithm; import android.net.wifi.WifiConfiguration.KeyMgmt; public static final int SECURITY_NONE = 0; public static final int SECURITY_WEP = 1; public static

Android/Java WiFi direct peer list

走远了吗. 提交于 2019-12-03 14:22:05
Yo, I'm trying to get an Android device (it's a Nexus 7 although I can't imagine that matters too much) to communicate with a Raspberry Pi throught the wonders of WiFi Direct. Supposedly it's possible, and it seemed six hours ago like a better solution than going down the server-client route, but I'm running into issues The Android developer website is nice in that it has two guides: http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html http://developer.android.com/guide/topics/connectivity/wifip2p.html Which is lovely, because I don't have masses of experience in

How to Stream Media(Audio/Video) Across Multiple Android device over Wifi or Wifi Hotspot?

非 Y 不嫁゛ 提交于 2019-12-03 13:55:37
问题 I am currently working on a project when you play song. it's play in your another device which is automatically play in another android device connected through WiFi or WiFi-mobile hotspot . How to stream audio android device to vlc player. I got Some Help from [Here's a link!] I go through many link bt none of help me. I want build functionality like [ Sound Seeder soundseeder]. Someone have any solution then please help me. It's mine for me. Thanks..!! 回答1: For Video Streaming Using Wi-Fi

Simulate Slow Internet Connection on a REAL device? [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-03 12:14:55
This question already has answers here : Simulate low bandwidth in android (11 answers) I need to test my application in conditions where even 2G Internet connectivity isn't at its full coverage (i.e. 2 bars instead of 4, 2G). I prefer conducting these tests over WiFi. Is there a way (programmatically or otherwise) to tell the Android OS on the real device to slow down or throttle Internet connection 56 Kbit/s? Note: I know how to do this on the emulator . I'm looking for a way to do this on a real device . Is this possible? In one of your comments you mentioned that you have a DD-WRT router,