com.octo.android.robospice.networkstate
Class DefaultNetworkStateChecker

java.lang.Object
  extended by com.octo.android.robospice.networkstate.DefaultNetworkStateChecker
All Implemented Interfaces:
NetworkStateChecker

public class DefaultNetworkStateChecker
extends Object
implements NetworkStateChecker

Consider network to be available when one network connection is up, whatever it is. This class will also ensure that both android.permission.ACCESS_NETWORK_STATE and android.permission.ACCESS_NETWORK are granted.

Author:
sni

Constructor Summary
DefaultNetworkStateChecker()
           
 
Method Summary
 void checkPermissions(android.content.Context context)
          Check if all permissions necessary to determine network state and use network are granted to a given context.
 boolean isNetworkAvailable(android.content.Context context)
          Determine whether network is available or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNetworkStateChecker

public DefaultNetworkStateChecker()
Method Detail

isNetworkAvailable

public boolean isNetworkAvailable(android.content.Context context)
Description copied from interface: NetworkStateChecker
Determine whether network is available or not.

Specified by:
isNetworkAvailable in interface NetworkStateChecker
Parameters:
context - the context from which network state is accessed.
Returns:
a boolean indicating if network is considered to be available or not.

checkPermissions

public void checkPermissions(android.content.Context context)
Description copied from interface: NetworkStateChecker
Check if all permissions necessary to determine network state and use network are granted to a given context.

Specified by:
checkPermissions in interface NetworkStateChecker
Parameters:
context - the context that will be checked to see if it has all required permissions.


Copyright © 2012-2014. All Rights Reserved.