android.net
public
abstract
class
android.net.NetworkStateTracker
Each subclass of this class keeps track of the state of connectivity
of a network interface. All state information for a network should
be kept in a Tracker class. This superclass manages the
network-type-independent aspects of network state.
Known Direct Subclasses
Summary
Constants
Fields
Public Constructors
Public Methods
Protected Methods
dispatchMessage,
dump,
getLooper,
handleMessage,
hasMessages,
hasMessages,
obtainMessage,
obtainMessage,
obtainMessage,
obtainMessage,
obtainMessage,
post,
postAtFrontOfQueue,
postAtTime,
postAtTime,
postDelayed,
removeCallbacks,
removeCallbacks,
removeCallbacksAndMessages,
removeMessages,
removeMessages,
sendEmptyMessage,
sendEmptyMessageAtTime,
sendEmptyMessageDelayed,
sendMessage,
sendMessageAtFrontOfQueue,
sendMessageAtTime,
sendMessageDelayed,
toString
|
|
|
|
|
void |
dispatchMessage(Message msg) |
|
|
final |
|
|
void |
dump(Printer pw, String prefix) |
|
|
final |
|
|
Looper |
getLooper() |
|
|
|
|
|
void |
handleMessage(Message msg) |
|
|
final |
|
|
boolean |
hasMessages(int what) |
|
|
final |
|
|
boolean |
hasMessages(int what, Object object) |
|
|
final |
|
|
Message |
obtainMessage(int what, Object obj) |
|
|
final |
|
|
Message |
obtainMessage(int what, int arg1, int arg2, Object obj) |
|
|
final |
|
|
Message |
obtainMessage(int what, int arg1, int arg2) |
|
|
final |
|
|
Message |
obtainMessage() |
|
|
final |
|
|
Message |
obtainMessage(int what) |
|
|
final |
|
|
boolean |
post(Runnable r) |
|
|
final |
|
|
boolean |
postAtFrontOfQueue(Runnable r) |
|
|
final |
|
|
boolean |
postAtTime(Runnable r, Object token, long uptimeMillis) |
|
|
final |
|
|
boolean |
postAtTime(Runnable r, long uptimeMillis) |
|
|
final |
|
|
boolean |
postDelayed(Runnable r, long delayMillis) |
|
|
final |
|
|
void |
removeCallbacks(Runnable r, Object token) |
|
|
final |
|
|
void |
removeCallbacks(Runnable r) |
|
|
final |
|
|
void |
removeCallbacksAndMessages(Object token) |
|
|
final |
|
|
void |
removeMessages(int what) |
|
|
final |
|
|
void |
removeMessages(int what, Object object) |
|
|
final |
|
|
boolean |
sendEmptyMessage(int what) |
|
|
final |
|
|
boolean |
sendEmptyMessageAtTime(int what, long uptimeMillis) |
|
|
final |
|
|
boolean |
sendEmptyMessageDelayed(int what, long delayMillis) |
|
|
final |
|
|
boolean |
sendMessage(Message msg) |
|
|
final |
|
|
boolean |
sendMessageAtFrontOfQueue(Message msg) |
|
|
|
|
|
boolean |
sendMessageAtTime(Message msg, long uptimeMillis) |
|
|
final |
|
|
boolean |
sendMessageDelayed(Message msg, long delayMillis) |
|
|
|
|
|
String |
toString() |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
public
static
final
int
EVENT_NOTIFICATION_CHANGED
arg1: 1 to show, 0 to hide
arg2: ID of the notification
obj: Notification (if showing)
Constant Value:
3
(0x00000003)
public
static
final
int
EVENT_SCAN_RESULTS_AVAILABLE
Constant Value:
2
(0x00000002)
public
static
final
int
EVENT_STATE_CHANGED
Constant Value:
1
(0x00000001)
Fields
Public Constructors
Public Methods
public
abstract
String[]
getNameServers()
Return the list of DNS servers associated with this network.
Returns
- a list of the IP addresses of the DNS servers available
for the network.
public
void
interpretScanResultsAvailable()
Interprets scan results. This will be called at a safe time for
processing, and from a safe thread.
public
abstract
boolean
isAvailable()
Returns an indication of whether this network is available for
connections. A value of false
means that some quasi-permanent
condition prevents connectivity to this network.
public
abstract
boolean
reconnect()
Reenable connectivity to a network after a
teardown().
Record the detailed state of a network, and if it is a
change from the previous state, send a notification to
any listeners.
Parameters
state
| the new @{code DetailedState} |
reason
| a String indicating a reason for the state change,
if one was supplied. May be null . |
extraInfo
| optional String providing extra information about the state change
|
Record the detailed state of a network, and if it is a
change from the previous state, send a notification to
any listeners.
Parameters
state
| the new @{code DetailedState}
|
public
abstract
boolean
setRadio(boolean turnOn)
Turn the wireless radio off for a network.
Parameters
turnOn
| true to turn the radio on, false
|
public
abstract
void
startMonitoring()
public
abstract
int
startUsingNetworkFeature(String feature)
Tells the underlying networking system that the caller wants to
begin using the named feature. The interpretation of
feature
is completely up to each networking implementation.
Parameters
feature
| the name of the feature to be used |
Returns
- an integer value representing the outcome of the request.
The interpretation of this value is specific to each networking
implementation+feature combination, except that the value
-1
always indicates failure.
public
abstract
int
stopUsingNetworkFeature(String feature)
Tells the underlying networking system that the caller is finished
using the named feature. The interpretation of
feature
is completely up to each networking implementation.
Parameters
feature
| the name of the feature that is no longer needed. |
Returns
- an integer value representing the outcome of the request.
The interpretation of this value is specific to each networking
implementation+feature combination, except that the value
-1
always indicates failure.
public
abstract
boolean
teardown()
Disable connectivity to a network
Returns
true
if a teardown occurred, false
if the
teardown did not occur.
Protected Methods
protected
static
String[]
getNameServerList(String[] propertyNames)
Return the IP addresses of the DNS servers available for this
network interface.
Parameters
propertyNames
| the names of the system properties whose values
give the IP addresses. Properties with no values are skipped. |
Returns
- an array of
String
s containing the IP addresses
of the DNS servers, in dot-notation. This may have fewer
non-null entries than the list of names passed in, since
some of the passed-in names may have empty values.
protected
void
sendScanResultsAvailable()
Send a notification that the results of a scan for network access
points has completed, and results are available.