Property | Type | Description | |
---|---|---|---|
MaxRetryAfter | int |
Property | Type | Description | |
---|---|---|---|
CancelAlarms | void | ||
GetNetworkAvailabilityState | NetworkDisabledState | ||
GetNetworkState | NetworkState | ||
HandleFileUpdated | bool | ||
PollNetworkState | void | ||
ScheduleAlarm | void | ||
UpdateLvl | void | ||
UpdateNetworkState | void |
Method | Description | |
---|---|---|
GenerateSaveFile ( string filename, long filesize ) : string |
Creates a filename (where the file should be saved) from info about a download.
|
|
GenerateTempSaveFileName ( string fileName ) : string |
Returns the filename (where the file should be saved) from info about a download
|
|
GetLogMessageForNetworkError ( NetworkDisabledState networkError ) : string |
a non-localized string appropriate for logging corresponding to one of the NETWORK_* constants.
|
|
NotifyUpdateBytes ( long totalBytesSoFar ) : void |
Calculating a moving average for the speed so we don't get jumpy calculations for time etc.
|
|
OnBind ( Android.Content.Intent intent ) : IBinder |
The on bind.
|
|
OnClientUpdated ( Messenger messenger ) : void |
The on client updated.
|
|
OnCreate ( ) : void |
The on create.
|
|
OnDestroy ( ) : void |
The on destroy.
|
|
RequestAbortDownload ( ) : void |
The request abort download.
|
|
RequestContinueDownload ( ) : void |
The request continue download.
|
|
RequestDownloadStatus ( ) : void |
The request download status.
|
|
RequestPauseDownload ( ) : void |
The request pause download.
|
|
SetDownloadFlags ( ServiceFlags flags ) : void |
The set download flags.
|
|
StartDownloadServiceIfRequired ( Android.Content.Context context, Android.Content.Intent intent, |
This version assumes that the intent contains the pending intent as a parameter. This is used for responding to alarms. The pending intent must be in an extra with the key DownloaderService#PendingIntent.
|
|
StartDownloadServiceIfRequired ( Android.Content.Context context, Android.App.PendingIntent pendingIntent, |
Starts the download if necessary. This function starts a flow that does many things: 1) Checks to see if the APK version has been checked and the metadata database updated 2) If the APK version does not match, checks the new LVL status to see if a new download is required 3) If the APK version does match, then checks to see if the download(s) have been completed 4) If the downloads have been completed, returns DownloadServiceRequirement.NoDownloadRequired The idea is that this can be called during the startup of an application to quickly ascertain if the application needs to wait to hear about any updated APK expansion files. This does mean that the application MUST be run with a network connection for the first time, even if Market delivers all of the files. |
Method | Description | |
---|---|---|
DownloaderService ( ) : System |
Initializes a new instance of the DownloaderService class.
|
|
OnHandleIntent ( Android.Content.Intent intent ) : void |
This is the main thread for the Downloader. This thread is responsible for queuing up downloads and other goodness.
|
|
ShouldStop ( ) : bool |
Returns a value indicating whether the downloader should stop. This will return True if all the downloads are complete.
|
Method | Description | |
---|---|---|
CancelAlarms ( ) : void |
The cancel alarms.
|
|
GetNetworkAvailabilityState ( ) : NetworkDisabledState |
The get network availability state.
|
|
GetNetworkState ( NetworkInfo info ) : NetworkState |
Updates the network type based upon the info returned from the connectivity manager.
|
|
HandleFileUpdated ( string filename, long fileSize ) : bool |
The APK has been updated and a filename has been sent down from the Market call. If the file has the same name as the previous file, we do nothing as the file is guaranteed to be the same. If the file does not have the same name, we download it if it hasn't already been delivered by Market.
|
|
PollNetworkState ( ) : void |
Polls the network state, setting the flags appropriately.
|
|
ScheduleAlarm ( int wakeUp ) : void |
The schedule alarm.
|
|
UpdateLvl ( |
Updates the LVL information from the server.
|
|
UpdateNetworkState ( NetworkInfo info ) : void |
The update network state.
|
public GenerateSaveFile ( string filename, long filesize ) : string | ||
filename | string | /// The filename. /// |
filesize | long | /// The filesize. /// |
return | string |
public GenerateTempSaveFileName ( string fileName ) : string | ||
fileName | string | /// The file Name. /// |
return | string |
public GetLogMessageForNetworkError ( NetworkDisabledState networkError ) : string | ||
networkError | NetworkDisabledState | /// The network Error. /// |
return | string |
public NotifyUpdateBytes ( long totalBytesSoFar ) : void | ||
totalBytesSoFar | long | /// The total Bytes So Far. /// |
return | void |
public OnBind ( Android.Content.Intent intent ) : IBinder | ||
intent | Android.Content.Intent | /// The intent. /// |
return | IBinder |
public OnClientUpdated ( Messenger messenger ) : void | ||
messenger | Messenger | /// The client messenger. /// |
return | void |
protected OnHandleIntent ( Android.Content.Intent intent ) : void | ||
intent | Android.Content.Intent | /// The intent that was recieved. /// |
return | void |
public SetDownloadFlags ( ServiceFlags flags ) : void | ||
flags | ServiceFlags | /// The flags. /// |
return | void |
public static StartDownloadServiceIfRequired ( Android.Content.Context context, Android.Content.Intent intent, |
||
context | Android.Content.Context | /// Your application Context. /// |
intent | Android.Content.Intent | /// An Intent to start the Activity in your application that /// shows the download progress and which will also start the /// application when downloadcompletes. /// |
serviceType | /// The type of the service to start. /// | |
return | DownloadServiceRequirement |
public static StartDownloadServiceIfRequired ( Android.Content.Context context, Android.App.PendingIntent pendingIntent, |
||
context | Android.Content.Context | /// Your application Context. /// |
pendingIntent | Android.App.PendingIntent | /// A PendingIntent to start the Activity in your application that /// shows the download progress and which will also start the /// application when downloadcompletes. /// |
serviceType |
/// The class of your |
|
return | DownloadServiceRequirement |