public interface IDownloaderClient
| Modifier and Type | Field and Description |
|---|---|
static int |
STATE_COMPLETED |
static int |
STATE_CONNECTING |
static int |
STATE_DOWNLOADING |
static int |
STATE_FAILED |
static int |
STATE_FAILED_CANCELED |
static int |
STATE_FAILED_FETCHING_URL |
static int |
STATE_FAILED_SDCARD_FULL |
static int |
STATE_FAILED_UNLICENSED |
static int |
STATE_FETCHING_URL |
static int |
STATE_IDLE |
static int |
STATE_PAUSED_BY_REQUEST |
static int |
STATE_PAUSED_NEED_CELLULAR_PERMISSION |
static int |
STATE_PAUSED_NEED_WIFI |
static int |
STATE_PAUSED_NETWORK_SETUP_FAILURE
Scary case.
|
static int |
STATE_PAUSED_NETWORK_UNAVAILABLE |
static int |
STATE_PAUSED_ROAMING |
static int |
STATE_PAUSED_SDCARD_UNAVAILABLE |
static int |
STATE_PAUSED_WIFI_DISABLED
Both STATE_PAUSED_WIFI_DISABLED and STATE_PAUSED_NEED_WIFI imply that
Wi-Fi is unavailable and cellular permission will NOT restart the
service.
|
static int |
STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION
Both STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION and
STATE_PAUSED_NEED_CELLULAR_PERMISSION imply that Wi-Fi is unavailable and
cellular permission will restart the service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onDownloadProgress(DownloadProgressInfo progress)
Shows the download progress.
|
void |
onDownloadStateChanged(int newState)
Called when the download state changes.
|
void |
onServiceConnected(android.os.Messenger m)
Called internally by the stub when the service is bound to the client.
|
static final int STATE_IDLE
static final int STATE_FETCHING_URL
static final int STATE_CONNECTING
static final int STATE_DOWNLOADING
static final int STATE_COMPLETED
static final int STATE_PAUSED_NETWORK_UNAVAILABLE
static final int STATE_PAUSED_BY_REQUEST
static final int STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION
static final int STATE_PAUSED_NEED_CELLULAR_PERMISSION
static final int STATE_PAUSED_WIFI_DISABLED
The service does not return these values. We recommend that app developers with very large payloads do not allow these payloads to be downloaded over cellular connections.
static final int STATE_PAUSED_NEED_WIFI
static final int STATE_PAUSED_ROAMING
static final int STATE_PAUSED_NETWORK_SETUP_FAILURE
static final int STATE_PAUSED_SDCARD_UNAVAILABLE
static final int STATE_FAILED_UNLICENSED
static final int STATE_FAILED_FETCHING_URL
static final int STATE_FAILED_SDCARD_FULL
static final int STATE_FAILED_CANCELED
static final int STATE_FAILED
void onServiceConnected(android.os.Messenger m)
Critical implementation detail. In onServiceConnected we create the remote service and marshaler. This is how we pass the client information back to the service so the client can be properly notified of changes. We must do this every time we reconnect to the service.
That is, when you receive this callback, you should call
DownloaderServiceMarshaller.CreateProxy(android.os.Messenger) to instantiate a member
instance of IDownloaderService, then call
IDownloaderService.onClientUpdated(android.os.Messenger) with the Messenger retrieved
from your IStub proxy object.
m - the service Messenger. This Messenger is used to call the
service API from the client.void onDownloadStateChanged(int newState)
The Downloader Library includes a collection of string resources that
correspond to each of the states, which you can use to provide users a
useful message based on the state provided in this callback. To fetch the
appropriate string for a state, call
Helpers.getDownloaderStringResourceIDFromState(int).
What this means to the developer: The application has gotten a message that the download has paused due to lack of WiFi. The developer should then show UI asking the user if they want to enable downloading over cellular connections with appropriate warnings. If the application suddenly starts downloading, the application should revert to showing the progress again, rather than leaving up the download over cellular UI up.
newState - one of the STATE_* values defined in IDownloaderClientvoid onDownloadProgress(DownloadProgressInfo progress)
progress - the DownloadProgressInfo object containing the current
progress of all downloads.Copyright © 2012–2014 simpligility technologies inc.. All rights reserved.