|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.net.NetworkInfo
public class NetworkInfo
Describes the status of a network interface of a given type (currently either Mobile or Wifi).
| Nested Class Summary | |
|---|---|
static class |
NetworkInfo.DetailedState
The fine-grained state of a network connection. |
static class |
NetworkInfo.State
Coarse-grained network state. |
| Nested classes/interfaces inherited from interface android.os.Parcelable |
|---|
Parcelable.Creator<T> |
| Field Summary | |
|---|---|
static Parcelable.Creator<NetworkInfo> |
CREATOR
Implement the Parcelable interface |
| Fields inherited from interface android.os.Parcelable |
|---|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE |
| Constructor Summary | |
|---|---|
NetworkInfo(int type)
|
|
| Method Summary | |
|---|---|
int |
describeContents()
Implement the Parcelable interface |
NetworkInfo.DetailedState |
getDetailedState()
Reports the current fine-grained state of the network. |
String |
getExtraInfo()
Report the extra information about the network state, if any was provided by the lower networking layers., if one is available. |
String |
getReason()
Report the reason an attempt to establish connectivity failed, if one is available. |
NetworkInfo.State |
getState()
Reports the current coarse-grained state of the network. |
int |
getType()
Reports the type of network (currently mobile or Wi-Fi) to which the info in this object pertains. |
String |
getTypeName()
|
boolean |
isAvailable()
Indicates whether network connectivity is possible. |
boolean |
isConnected()
Indicates whether network connectivity exists and it is possible to establish connections and pass data. |
boolean |
isConnectedOrConnecting()
Indicates whether network connectivity exists or is in the process of being established. |
boolean |
isFailover()
Indicates whether the current attempt to connect to the network resulted from the ConnectivityManager trying to fail over to this network following a disconnect from another network. |
(package private) void |
setDetailedState(NetworkInfo.DetailedState detailedState,
String reason,
String extraInfo)
Sets the fine-grained state of the network. |
void |
setFailover(boolean isFailover)
|
void |
setIsAvailable(boolean isAvailable)
Sets if the network is available, ie, if the connectivity is possible. |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
void |
writeToParcel(Parcel dest,
int flags)
Implement the Parcelable interface |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Parcelable.Creator<NetworkInfo> CREATOR
| Constructor Detail |
|---|
public NetworkInfo(int type)
| Method Detail |
|---|
public int getType()
public boolean isConnectedOrConnecting()
isConnected() instead, which guarantees
that the network is fully usable.
true if network connectivity exists or is in the process
of being established, false otherwise.public boolean isConnected()
true if network connectivity exists, false otherwise.public boolean isAvailable()
true if the network is available, false otherwisepublic void setIsAvailable(boolean isAvailable)
isAvailable - the new availability value.
public boolean isFailover()
true if this is a failover attempt, false
otherwise.public void setFailover(boolean isFailover)
public NetworkInfo.State getState()
public NetworkInfo.DetailedState getDetailedState()
void setDetailedState(NetworkInfo.DetailedState detailedState,
String reason,
String extraInfo)
detailedState - the NetworkInfo.DetailedState.reason - a String indicating the reason for the state change,
if one was supplied. May be null.extraInfo - an optional String providing addditional network state
information passed up from the lower networking layers.
public String getReason()
public String getExtraInfo()
public String toString()
Object
toString in class Objectpublic String getTypeName()
public int describeContents()
describeContents in interface Parcelable
public void writeToParcel(Parcel dest,
int flags)
writeToParcel in interface Parcelabledest - The Parcel in which the object should be written.flags - Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||