network-connection

How to check network provider name in iOS programming?

回眸只為那壹抹淺笑 提交于 2019-12-04 20:29:44
I need to check whether device has been connected properly to "My-Wifi" network or not. If it is connected then I will send some data to server otherwise not. Right now I am just checking with the Internet connection, using Reachability class. So how to check that? You can make use of CNCopySupportedInterfaces() call. CFArrayRef interfaces = CNCopySupportedInterfaces(); CFIndex count = CFArrayGetCount(interfaces); for (int i = 0; i < count; i++) { CFStringRef interface = CFArrayGetValueAtIndex(interfaces, i); CFDictionaryRef netinfo = CNCopyCurrentNetworkInfo(interface); if (netinfo &&

How to check the internet connection availability in windows phone 8 application

北城余情 提交于 2019-12-04 18:31:51
问题 I'm developing Windows Phone 8 application . In this application, I have to connect to the server to get the data. So Before connecting to the server, I want to check whether the internet connection available or not to the device. If the internet connection is available, then only I'll get the data from the server, Otherwise I'll show an error message. Please tell me how to do this in Windows Phone 8. 回答1: NetworkInterface.GetIsNetworkAvailable() returns the status of the NICs. Depending on

API call in Android 9 configuration devices and emulator shows connection error

▼魔方 西西 提交于 2019-12-02 21:44:22
问题 I am using Android 9 emulator, it has internet connection from system and I have added internet permission in manifest. When I try to call api it shows error message as : connection error . 回答1: As piyush commented in my question the answer is to add android:usesCleartextTraffic="true" in manifest file with in application tag <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com

HttpConnection connect with Mobile Network or 3G

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 09:09:34
问题 When I run this application on a device using the WiFi it's working fine. But when I am using a mobile network or 3g it's giving an error. It's not working on the mobile network. I am using this code: connection = (HttpConnection) Connector.open(APIURL+ updateConnectionSuffix()); And my ConnectionTools class code: public String updateConnectionSuffix() { String connSuffix; if (DeviceInfo.isSimulator()) { connSuffix = ";deviceside=true"; } else if ((WLANInfo.getWLANState() == WLANInfo.WLAN

HttpConnection connect with Mobile Network or 3G

一曲冷凌霜 提交于 2019-12-02 04:41:52
When I run this application on a device using the WiFi it's working fine. But when I am using a mobile network or 3g it's giving an error. It's not working on the mobile network. I am using this code: connection = (HttpConnection) Connector.open(APIURL+ updateConnectionSuffix()); And my ConnectionTools class code: public String updateConnectionSuffix() { String connSuffix; if (DeviceInfo.isSimulator()) { connSuffix = ";deviceside=true"; } else if ((WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) && RadioInfo.areWAFsSupported(RadioInfo.WAF_WLAN)) { connSuffix = ";interface=wifi"; }

How to test iOS app on supporting IPv6? Apple rejected app as it is not IPv6 compatible

家住魔仙堡 提交于 2019-11-30 04:57:20
have apps, built 2015 and 2014. How can I test them for IPv6? If my apps doesn't support IPv6, what should I do? My apps are using AFNetworking and Alamofire. I'm connecting mostly to domains ( Ex. api.example.com/v1/...). Only 1 app use IP: (ex: 12.12.12.12:3000/api/v1/...). This solution only works if you have an ethernet connection. For creating an iPV6 NAT64 wifi network, follow these steps Step 1 : Open system preferences Step 2 : Open Sharing Step 3 : Click on internet sharing Step 4 : Click Wifi in the ports while pressing option(ALT) key. A Create NAT64 Network checkbox will be

How to use NetworkReachabilityManager in Alamofire

被刻印的时光 ゝ 提交于 2019-11-27 04:02:55
问题 I want functionality similar to AFNetworking in Objective-C with Alamofire NetworkReachabilityManager in Swift: //Reachability detection [[AFNetworkReachabilityManager sharedManager] startMonitoring]; [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { switch (status) { case AFNetworkReachabilityStatusReachableViaWWAN: { [self LoadNoInternetView:NO]; break; } case AFNetworkReachabilityStatusReachableViaWiFi: { [self

How to tell if &#39;Mobile Network Data&#39; is enabled or disabled (even when connected by WiFi)?

佐手、 提交于 2019-11-26 15:50:29
I have an app that I want to be able to use to get a connection status report from a remote query. I want to know if WiFi is connected, and if data access is enabled over mobile network. If the WiFi goes out of range I want to know if I can rely on the mobile network. The problem is that data enabled is always returned as true when I am connected by WiFi, and I can only properly query the mobile network when not connected by WiFi. all the answers I have seen suggest polling to see what the current connection is, but I want to know if mobile network is available should I need it, even though I

Check for internet connection availability in Swift

喜欢而已 提交于 2019-11-26 12:00:30
Is there a way to check if the internet connection is available using Swift? I know there are many third party libraries to do this but they are all written in Objective-C. I'm looking for a Swift alternative. Isuru As mentioned in the comments, although its possible to use Objective-C libraries in Swift, I wanted a more pure Swift solution. The existing Apple Reachability class and other third party libraries seemed to be too complicated for me to translate to Swift. I Googled some more and I came across this article which shows a simple method to check for network availability. I set out to

How to tell if &#39;Mobile Network Data&#39; is enabled or disabled (even when connected by WiFi)?

情到浓时终转凉″ 提交于 2019-11-26 04:38:24
问题 I have an app that I want to be able to use to get a connection status report from a remote query. I want to know if WiFi is connected, and if data access is enabled over mobile network. If the WiFi goes out of range I want to know if I can rely on the mobile network. The problem is that data enabled is always returned as true when I am connected by WiFi, and I can only properly query the mobile network when not connected by WiFi. all the answers I have seen suggest polling to see what the