Пример #1
0
    public void CancelDownload(DownloadOperation operation)
    {
        Profiler.BeginSample(string.Format("CancelDownload {0}", operation.ID));

        AndroidBridge.CallStatic("cancelDownload", Context, operation.ID);

        Profiler.EndSample();
    }
Пример #2
0
    public DownloadOperation StartDownload(BackgroundDownloadOptions options)
    {
        try
        {
            var id = AndroidBridge.CallStatic <long>("download", Context, options.URL, options.DestinationPath, options.Title, options.Description);

            return(new AndroidDownloadOperation(this, options, id));
        }
        catch (Exception e)
        {
            Debug.LogException(e);
        }

        return(null);
    }
Пример #3
0
    public DownloadOperation GetDownloadOperation(string url)
    {
        var id = AndroidBridge.CallStatic <long> ("getDownloadOperation", Context, url);

        return((id == -1) ? null : new AndroidDownloadOperation(this, new BackgroundDownloadOptions(url), id));
    }
Пример #4
0
 public float GetProgress(long id)
 {
     return(AndroidBridge.CallStatic <float>("getDownloadProgress", Context, id));
 }
Пример #5
0
 public DownloadStatus GetStatus(long id)
 {
     return((DownloadStatus)AndroidBridge.CallStatic <int>("getDownloadStatus", Context, id));
 }