wifi

How do I force an iOS app to use 3G instead of WiFi?

爱⌒轻易说出口 提交于 2019-11-30 10:06:33
I want to use a messaging protocol that works fine over 3G, but not over some corporate firewalls. How can my app force the use of the cellular network when it fails to connect over WiFi even in the case that the WiFi network is reachable? EDIT: After reading through the implementation of the Reachability class I remain unsure whether the two are indeed mutually exclusive. It could well be possible to discover both interfaces via gethostbyname() , which I might try just to see what comes out. Use getifaddrs to enumerate the network interfaces. Look for ifa_name that starts with "pdp." This

Android - Cant Remove Wifi Network Programatically- The method removeNetwork(int) in the type WifiManager is not applicable for the arguments (String)

眉间皱痕 提交于 2019-11-30 09:14:30
I'm attempting to remove my wifi network programatically - however I cannot seem to get it to remove/forget the currently connected wifi connection. This should be a pretty simple task - so I'm not sure exactly what I'm doing wrong. I'm using the following StackOverflow post as an example: How to forget a wireless network in android programmatically? public class KillTimer extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.killtimer); WifiManager wifiManager = (WifiManager) getApplicationContext()

How to get BSSID of all wifi access points?

一个人想着一个人 提交于 2019-11-30 08:41:00
I need to get BSSID(MAC) of all AP's. Please find below code block. List<WifiConfiguration> test = wifiManager.getConfiguredNetworks(); for(int k=0;k<test.size();k++){ Log.d("acheck", "test BSSID = "+test.get(k).BSSID); Log.d("acheck", "test BSSID = "+test.get(k).BSSID); } But above code block returns SSID properly but null for BSSID. I want to connect to strongest access point with user defined SSID. Is there any API method available to get best signal strength's AP with user defined SSID.(In my case there are many SSID's with single SSID with multiple AP's available.) Adapted the answer by

AVPlayer cannot resume upon Wifi drops in iOS 8

半城伤御伤魂 提交于 2019-11-30 08:34:46
问题 I'm using AVPlayer to play streaming video. When Wifi drops and later enables, I see that AVPlayer cannot resume, no matter how many times I call AVPlayer play , and its currentItem 's duration is NaN, seekableTimeRanges is empty. This is not the case for iOS 7, it resumes and plays well. The workaround I can think of is to restart the player. How to deal with this? 来源: https://stackoverflow.com/questions/28059019/avplayer-cannot-resume-upon-wifi-drops-in-ios-8

Scan and connect to Wifi networks using Java

我的梦境 提交于 2019-11-30 08:18:39
问题 Need to write a client, which can scan the available WIFI networks and connects to best known using Java. This might be desktop client which does this job. Any pointers would be helpful and appreciate your response. 回答1: You'll have to rely on a JNI library since you can't access a wireless device directly in Java. jWlanScan for Windows. 回答2: I suggest you to act upon your operating system. And for each of the supporting operating system try to analyse the results of the command lines needed

How to know ip address of the router from code in android?

*爱你&永不变心* 提交于 2019-11-30 07:50:35
How can you find the IP address of the router (gateway address) from code? WifiInfo.getIpAddress() - returns IP address of device. In a shell command "ipconfig" does not return any value. Here is my solution, but please let me know if there is a better way to do this: WifiManager manager = (WifiManager)getSystemService(WIFI_SERVICE); DhcpInfo info = manager.getDhcpInfo(); info.gateway; Hey this might help you: DHCPInfo final WifiManager manager = (WifiManager) super.getSystemService(WIFI_SERVICE); final DhcpInfo dhcp = manager.getDhcpInfo(); final String address = Formatter.formatIpAddress

how to enumerate all available Wifi networks at range?

空扰寡人 提交于 2019-11-30 07:42:35
问题 I read on google that this is not possible, and that on OS 2.0, it was some undocumented Api to accomplish that, but then your app will got rejected .... we are almosto on OS 4.0....any news regarding this? 回答1: There are pre-2.0 solutions to be found on the Internet. One of them seems to be as follows: void *libHandle; void *airportHandle; int (*open)(void *); int (*bind)(void *, NSString *); int (*close)(void *); libHandle = dlopen("/System/Library/Frameworks/Preferences.framework

Multiplexed hotspot in Android

删除回忆录丶 提交于 2019-11-30 07:26:18
Is it possible to write an app in Android using the wifi API which will act like a hotspot (so granting network access to wifi clients) while still allowing the local wifi device to connect to another wifi network ? The one I've tested are disabling local Wifi connection in order to create a hotspot. I post here after a few months so people that would like to implement this on an Android device might be helped. There is a way to have one wireless chip working in hybrid mode, with both station mode (STA) and access point mode (AP) enabled. To do this, I replaced the wireless driver of my chip

Wifi Authentication Error in Android

最后都变了- 提交于 2019-11-30 07:17:17
I am developing an application using Wifi in Android. Whenever I enter wrong password while connecting to wifi, I dont get any notification for invalid authentication. It just keeps on retrying to connect. Same behavior is found in wifi wireless setting. Is there any way to find that Wifi Authentication has failed?? WifiManager.EXTRA_SUPPLICANT_ERROR -- I never get this.. This code works: IntentFilter mIntentFilter = new IntentFilter(); mIntentFilter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION); registerReceiver(receiverWifi, mIntentFilter); class WifiReceiver extends

Can't connect to Android via ADB over wifi - Do I need root access?

爷,独闯天下 提交于 2019-11-30 06:59:21
I'm basically trying to do this: How can I connect to Android with ADB over TCP? with the Droid X2. I have USB Debugging on, and my phone is plugged in via USB. The IP Address is 10.0.78.33 (I have verified that I can do TCP communication to the phone on that IP, and I can ping it). I go to the command line and do the following: >>adb tcpip 5555 restarting in TCP mode port: 5555 >>adb connect 10.0.78.33:5555 unable to connect to 10.0.78.33:5555 Any thoughts on why this doesn't work? Do I need root access in order to do this? I'm trying to avoid rooting the phone. Thanks! Step 1 . Go to