connectivity

check if the server is available?

只愿长相守 提交于 2019-12-23 06:14:07
问题 I developing an application which connects to the server. Therefore i want use the bellow function to check if the server is available , But I don't know how I can use it in a thread and how call it each time when I need check if the server is available in activity or fragment : static public boolean isURLReachable(Context context) { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getActiveNetworkInfo(); if (netInfo !=

Android - public method setMobileDataEnabled in ConnectivityManager not available in SDK

不羁的心 提交于 2019-12-23 05:22:41
问题 i'm trying to use the method setMobileDataEnabled of the ConnectivityManager class, using SDK 2.2. According to http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2.1_r1/android/net/ConnectivityManager.java/?v=source this method is declared public but with @hide is not available in the SDK and in Eclipse. In order to bypass the hiding I wrote the following function to toggle the mobile data connection on/off. public void setMobileData(boolean toBeEnabled){

Multipeer Connectivity with personal Hotspot not working

大憨熊 提交于 2019-12-23 02:51:05
问题 I am working with Multipeer connectivity. It works fine when all devices are connected to same wifi. I have 1 master and 5 slaves devices . I want to do connectivity with personal hotspot but everytime the connection will declined. This is my code : class SessionManager: NSObject, MCSessionDelegate, MCBrowserViewControllerDelegate, MCNearbyServiceAdvertiserDelegate, MCNearbyServiceBrowserDelegate { func browser(_ browser: MCNearbyServiceBrowser, foundPeer peerID: MCPeerID, withDiscoveryInfo

How to set the Usb connection mode?

被刻印的时光 ゝ 提交于 2019-12-22 08:28:30
问题 I'm writing an application which is supposed to dump data on the SD card and then another application on a pc which should read the data when the device is connected to the pc (in disc drive mode). On my HTC Legend there is a dialog to choose between: Charge only, HTC Sync, Disk drive.. Is there a possibility to set the mode with which the device is connecting to the pc or at least an intent to ask the user to switch the mode? 回答1: I haven't found a way of setting the mode programmatically,

ConnectivityManager getActiveNetworkInfo() is always null even with data traffic active

巧了我就是萌 提交于 2019-12-22 04:29:18
问题 i'm working on a android project and i had the need to check for internet connection. i searched the web and i found a solution here on stackoverflow. However, i'm having problems on checking the internet state. I already searched everywhere but i can't find any solution for my problem. Here is the manifest: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name=

Azure SQL Database Connectivity Issues - Too many connections?

。_饼干妹妹 提交于 2019-12-21 03:31:36
问题 I have a site which is a white label (Multiple versions of the same site) which I've launched recently. There isn't a great deal of traffic yet - mainly bots but probably 800 users per day. It is hosted on Azure with an Azure database in addition to an admin panel located on a non-azure server. Both sites connect to the same Azure database. There are also some worker roles running to process data - 99% of the time they aren't doing anything, but they check regularly. I have always experienced

ConnectivityManager.CONNECTIVITY_ACTION get network disconected from in API >= 14?

我与影子孤独终老i 提交于 2019-12-20 11:12:01
问题 I need to get the network from which device was disconnected. Now I use: NetworkInfo ni =intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO); And check: ni.isConnected() if this returns false ni - is the network from which the device was disconnected. But ConnectivityManager.EXTRA_NETWORK_INFO is deprecated in API 14. Google says use getActiveNetworkInfo() to get network information. But getActiveNetworkInfo() always returns network with which the device is connected now (

ConnectivityManager.CONNECTIVITY_ACTION get network disconected from in API >= 14?

时光怂恿深爱的人放手 提交于 2019-12-20 11:11:12
问题 I need to get the network from which device was disconnected. Now I use: NetworkInfo ni =intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO); And check: ni.isConnected() if this returns false ni - is the network from which the device was disconnected. But ConnectivityManager.EXTRA_NETWORK_INFO is deprecated in API 14. Google says use getActiveNetworkInfo() to get network information. But getActiveNetworkInfo() always returns network with which the device is connected now (

How to verify network connectivity in objective-c

旧时模样 提交于 2019-12-20 09:32:36
问题 I was looking over the Reachability sample project on developer.apple.com and found that it was a large project just to verify you had network connectivity. First part of the question is "What is the minimum code required to find out if the device can reach a 3G or wifi network?" And next should this be done inside the appDelegate (on start) or inside the first View Controller that is launched? Thank you in advance 回答1: It's not large, it really does what you want. If it is too big for you,

wso2 emm - unable to connect via external IP

半腔热情 提交于 2019-12-20 04:54:17
问题 I have EMM 1.1.0 installed on server with internal IP 10.100.0.1:9443. Port forwarded by router to external IP 90.90.0.1:23333 Im able to log in locally to https://localhost:9443/emm without a problem. Cases: 1) After modifying all localhosts in sso-idp-config.xml to internal 10.100.0.1:9443 From internal LAN to //10.100.0.1:9443/emm - able to log in From external to //90.90.0.1:23333/emm redirected to //10.100.0.1:9443/samlsso - failed 2) After modifying all localhosts in sso-idp-config.xml