connectivity

unfortunately app is getting stopped while checking for network

独自空忆成欢 提交于 2019-12-17 08:53:25
问题 I am using the following code to check for the internet connection through out my app. public class ConnectionChangeReceiver extends BroadcastReceiver { @Override public void onReceive( Context context, Intent intent ) { ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService( Context.CONNECTIVITY_SERVICE ); NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo(); NetworkInfo mobNetInfo = connectivityManager.getNetworkInfo(ConnectivityManager

Detecting network connectivity on Android?

谁说胖子不能爱 提交于 2019-12-13 04:26:10
问题 OS: Android Given: User has stated that they wish to remain connected to app's server to receive updates, etc. Goal: To ensure that users are connected to app's server even when app is in background state. Question: One problem has been occasional disconnects from the network. If a user loses data network connectivity (loss of 2G, 3G, WiFi) and then later regains connectivity, our app is left without a connection. I am currently trying to make use of PhoneStateListener's in order to detect

Android connectivity/network configuration

戏子无情 提交于 2019-12-13 02:33:29
问题 I have a WebService running in a remote VM inside my company's network. I can see the JSON response using Chrome on my laptop by typing the url in the address bar ( http://VMaddress/servicename/ ). However, I cannot do this using the Android emulator. My company uses a proxy and I have already defined it in both the emulator launch window and inside the Android application itself. I can connect to Google and stuff, but I still cannot connect to the remote VM. So my question is: How is

how to detect internet connection in android studio

自作多情 提交于 2019-12-12 03:34:15
问题 I have following code to detect if there is internet connection available or not. But if I have no internet connection only the data connection is "ON" it still works. what I should do? ConnectivityManager cManager = (ConnectivityManager) getSystemService(this.CONNECTIVITY_SERVICE); NetworkInfo ninfo = cManager.getActiveNetworkInfo(); if(ninfo!=null && ninfo.isConnected()) { Toast.makeText(this, "Available",Toast.LENGTH_LONG).show(); } else { Toast.makeText(this, "Not Available",Toast.LENGTH

Boost-ASIO simple echo client-server cannot establish connection?

吃可爱长大的小学妹 提交于 2019-12-12 01:29:48
问题 I'm using BOOST-ASIO for a simple echo client-server (there is a separate link for the client and server). When I try to run the server I use this async_tcp_echo_server 4000 . For the client I use blocking_tcp_echo_client #.#.#.# 4000 (with #.#.#.# as the ip address). I'm on XP-SP3 with my computer connected to my wireless dsl modem using a usb card. After a few seconds on the client side I get this error: Exception: connect: A connection attempt failed because the connected party did not

Flutter IOS reading wifi name using the connectivity or wifi plugin

人盡茶涼 提交于 2019-12-11 16:55:23
问题 This question is similar this question, but slightly different. I am trying to retrieve the name of my currently connected wifi network using the Connectivity Plugin. This answer works perfectly fine in android, and while it sounds like it should work for iOS, I am getting an exception: PlatformException(UNAVAILABLE, wifi name unavailable, null) Simple ex. of the code causing the exception (with the assumption I am connected to wifi, also not using an emulator): Connectivity connectivity =

Device connectivity(online/offline)status with the Auzure iot hub

此生再无相见时 提交于 2019-12-11 16:13:44
问题 I connected my mobile device to the IOT hub. I would like to display the connectivity (online/offline) status of the device on IOT hub service app installed on another device. How to achieve this? Is there any automatic trigger/event that fires when there is change in connectivity status? Also is there any API in service SDK to check the connectivity status of the device. 回答1: Yes, we publish device connection state on Event Grid, which can be used for trigger: https://docs.microsoft.com/en

Android network reachability (offline mode)?

99封情书 提交于 2019-12-11 10:38:47
问题 So I am calling few different web services in my app but I want to check if the device is able to connect to internet before service is called. First I created a static Flag. public static bool IsOfflineMode = false; And before each service is called, I add the following: if(IsOfflineMode) { return; } This is how I am checking if the device is online or not. public bool isConnected() { ConnectivityManager connectManager = (ConnectivityManager)GetSystemService (Context.ConnectivityService);

How to check for internet connection availability if device is connected to a router?

♀尐吖头ヾ 提交于 2019-12-11 07:15:12
问题 How do you check if an Android device is connected to an internet connection? Currently, I am using the code below: ConnectivityManager connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); boolean isConnectedToNetwork = (networkInfo != null && networkInfo.isConnected()); However, the problem with the code above is that it only checks if the device is connected to a network. It does not check if an

Cannot connect to SQL Server remotely or locally after reboot

夙愿已清 提交于 2019-12-10 21:01:44
问题 After some network maintenance last weekend, we had some trouble with our development server which led to us restart it. Some updates were installed during the restart, which may or may not have been a factor. Since then, we have been unable to connect to SQL Server 2005, even locally via Management Studio. Depending on the protocol used for the connection attempt, we get one of the following two errors: When you try to connect to the instance by using the named pipes protocol or the shared