Build 1.0_r1(from source)

android.webkit
Class Network

java.lang.Object
  extended by android.webkit.Network

 class Network
extends Object


Method Summary
 void clearUserSslPrefTable()
          Clears user SSL-error preference table.
static void disablePlatformNotifications()
          If platform notifications are enabled, this should be called from onPause() or onStop()
static void enablePlatformNotifications()
          Enables data state and proxy tracking
static Network getInstance(Context context)
           
 String getProxyHostname()
          Get the proxy hostname.
 String getProxyPassword()
           
 String getProxyUsername()
           
 void handleAuthRequest(LoadListener loader)
          Handles authentication requests on their way up to the user (the user must provide credentials).
 void handleSslErrorRequest(LoadListener loader)
          Handles SSL error(s) on the way up to the user: the user must decide whether errors should be ignored or not.
 boolean isValidProxySet()
           
 boolean requestURL(String method, Map<String,String> headers, String postData, LoadListener loader, boolean isHighPriority)
          Request a url from either the network or the file system.
 void resetHandlersAndStopLoading(BrowserFrame frame)
          If we need to stop loading done in a handler (here, browser frame), we send a message to the handler to stop loading, and remove all loaders that share the same CallbackProxy in question from all local handlers (such as ssl-error and http-authentication handler).
 boolean restoreState(Bundle inState)
          Restores the state of network handlers (user SSL and HTTP-authentication preferences).
 boolean saveState(Bundle outState)
          Saves the state of network handlers (user SSL and HTTP-authentication preferences).
 void setProxyPassword(String proxyPassword)
          Sets the proxy password.
 void setProxyUsername(String proxyUsername)
          Sets the proxy username.
 void startTiming()
           
 void stopTiming()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Network getInstance(Context context)
Returns:
The singleton instance of the network.

enablePlatformNotifications

public static void enablePlatformNotifications()
Enables data state and proxy tracking


disablePlatformNotifications

public static void disablePlatformNotifications()
If platform notifications are enabled, this should be called from onPause() or onStop()


requestURL

public boolean requestURL(String method,
                          Map<String,String> headers,
                          String postData,
                          LoadListener loader,
                          boolean isHighPriority)
Request a url from either the network or the file system.

Parameters:
url - The url to load.
method - The http method.
headers - The http headers.
postData - The body of the request.
loader - A LoadListener for receiving the results of the request.
isHighPriority - True if this is high priority request.
Returns:
True if the request was successfully queued.

isValidProxySet

public boolean isValidProxySet()
Returns:
True iff there is a valid proxy set.

getProxyHostname

public String getProxyHostname()
Get the proxy hostname.

Returns:
The proxy hostname obtained from the network queue and proxy settings.

getProxyUsername

public String getProxyUsername()
Returns:
The proxy username or null if none.

setProxyUsername

public void setProxyUsername(String proxyUsername)
Sets the proxy username.

Parameters:
proxyUsername - Username to use when connecting through the proxy.

getProxyPassword

public String getProxyPassword()
Returns:
The proxy password or null if none.

setProxyPassword

public void setProxyPassword(String proxyPassword)
Sets the proxy password.

Parameters:
proxyPassword - Password to use when connecting through the proxy.

resetHandlersAndStopLoading

public void resetHandlersAndStopLoading(BrowserFrame frame)
If we need to stop loading done in a handler (here, browser frame), we send a message to the handler to stop loading, and remove all loaders that share the same CallbackProxy in question from all local handlers (such as ssl-error and http-authentication handler).

Parameters:
proxy - The CallbackProxy responsible for cancelling the current load.

saveState

public boolean saveState(Bundle outState)
Saves the state of network handlers (user SSL and HTTP-authentication preferences).

Parameters:
outState - The out-state to save (write) to.
Returns:
True iff succeeds.

restoreState

public boolean restoreState(Bundle inState)
Restores the state of network handlers (user SSL and HTTP-authentication preferences).

Parameters:
inState - The in-state to load (read) from.
Returns:
True iff succeeds.

clearUserSslPrefTable

public void clearUserSslPrefTable()
Clears user SSL-error preference table.


handleSslErrorRequest

public void handleSslErrorRequest(LoadListener loader)
Handles SSL error(s) on the way up to the user: the user must decide whether errors should be ignored or not.

Parameters:
loader - The loader that resulted in SSL errors.

handleAuthRequest

public void handleAuthRequest(LoadListener loader)
Handles authentication requests on their way up to the user (the user must provide credentials).

Parameters:
loader - The loader that resulted in an HTTP authentication request.

startTiming

public void startTiming()

stopTiming

public void stopTiming()

Build 1.0_r1(from source)

Please submit a feedback, bug or feature