Sha256: f866f9998af6aedd6d1273c021c495d98e13cdc10b07b77d034b8a2d0952ec58

Contents?: true

Size: 1.64 KB

Versions: 14

Compression:

Stored size: 1.64 KB

Contents

package com.rho.rhoelements.plugins;

public class NetworkConnectionStatus
{
	public static final int		NETWORK_CONNECTED				= 1;
	private static final String	NETWORK_CONNECTED_STRING			= "Connected";
	public static final int		NETWORK_DISCONNECTED				= 0;
	private static final String	NETWORK_DISCONNECTED_STRING			= "Disconnected";
	public static final int		NETWORK_ERROR					= -1;
	private static final String	NETWORK_ERROR_STRING				= "ERROR"; //TODO Check alignment here, not sure if windows has this.

	public static final String	NETWORK_CHECK_RUNNING_STRING		= "true";
	public static final String	NETWORK_CHECK_NOT_RUNNING_STRING	= "false";

	public static int		Network_Connection_Available		= ~NETWORK_DISCONNECTED;
	public static boolean		Network_Checker_Running			= false;
	
	
	public static String isNetworkAvailable()
	{
		String strNetworkStatus;

		switch (Network_Connection_Available)
		{
			case NETWORK_CONNECTED:
				strNetworkStatus = NETWORK_CONNECTED_STRING;
				break;
			case NETWORK_DISCONNECTED:
				strNetworkStatus = NETWORK_DISCONNECTED_STRING;
				break;
			case NETWORK_ERROR:
				// fall through on purpose
			default:
				strNetworkStatus = NETWORK_ERROR_STRING;
				break;
		}

		return (strNetworkStatus);
	}

	public static String isNetworkCheckerRunning()
	{
		String strNetworkStatus;

		if (Network_Checker_Running)
		{
			strNetworkStatus = NETWORK_CHECK_RUNNING_STRING;
		}
		else
		{
			strNetworkStatus = NETWORK_CHECK_NOT_RUNNING_STRING;
		}

		return (strNetworkStatus);
	}

	public static void resetStatus()
	{
		// reset back to defaults
		Network_Checker_Running = false;
		Network_Connection_Available = NETWORK_DISCONNECTED;
	}
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rhodes-7.6.0 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-7.5.1 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-7.4.1 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-7.1.17 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-6.2.0 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-6.0.11 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-5.5.18 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-5.5.17 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-5.5.15 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-5.5.0.22 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-5.5.2 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-5.5.0.7 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-5.5.0.3 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java
rhodes-5.5.0 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/plugins/NetworkConnectionStatus.java