-
Notifications
You must be signed in to change notification settings - Fork 346
/
CHANGELOG
717 lines (601 loc) · 38.4 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
Androidx version 3.4.1
1. Fix for slow download start on Android 14+. Removed dependency on broadcast receiver
Androidx version 3.4.0
1. Fixes slow download start issues on Android 14+
2. Updated library dependencies.
3. Connectivity manager deprecation fixes.Thanks to @vicajilau
4. Range End Handling fixes. Thanks to @Baniares
5. Documentation update. Thanks to @gardenappl
6. NetworkInfoProvider fixes. Thanks to @nstratak
Version 3.1.0/ Androidx version 3.2.0
1. Android 14 compatibility, min SDK 16, AGP 8.2.0, Gradle 8.5, Kotlin 1.9.20. Thanks to @helloimfrog
2. Android SDK 34 and fixes of register receiver. Thanks to @Kutikov
3. Updated Gradle to 8.3.1 and fixed sampleApp. Thanks to @vicajilau
Version 3.0.12/ Androidx version 3.1.6
1. Download TotalBytes fixes. Thanks to @badrazizi
2. OnCompleted not called in some instances.
3. Fixed " A resource failed to call close" errors. Thanks to @Braxeo
4. Fixed Pen Test issues: Thanks to @StuStirling
5. Added new batch enqueue method. Thanks to @thib-rdr
6. Fixed rapid pause and resume issues. Thanks to @jpvs0101
7. Breaking change. Reverted OkHttp client to 3.12.12 to support Android versions older than 21. Thanks to @badrazizi
8. Fixed issues with sample app
Big thanks to everyone who contributed and open issues. Happy Holidays. Stay Safe!
Version 3.0.11/ Androidx version 3.1.5
2. Notification sound fixes.
3. RxJava fixes.
4. Content Length fixes
5. Added NetworkType.UNMETERED
6. Lots of bug fixes.
Thanks to everyone who contributed!
Version 3.0.10/ Androidx version 3.1.4
1. Improvements/Bug fixes to getting a download's content-length
2. FetchDatabaseManager interface improvements. It is now easier to create custom fetch databases.
Note: New methods were added and old methods may have been updated for the FetchDatabaseManager interface.
3. FetchNotificationManger interface improvements. It is now easier to control notifications.
Note: New methods were added and old methods may have been updated for the FetchNotificationManger interface.
-> The DefaultFetchNotificationManager class has also been updated and is now abstract. See java docs for
details. Also seen sample app DownloadListActivity on how to use the DefaultFetchNotificationManager class.
4. Fetch updateRequest method will now call fetch listener onDeleted(download) method when a request is being updated
5. Added new Fetch method `getAllGroupIds(callback)` that returns all group id's being managed by Fetch.
6. Added new Fetch method `getDownloadsByTag(tag, callback)` that returns all download's being managed by Fetch with the specified tag.
Special thanks to @alvince and @DHosseiny for providing fixes for this release.
Version 3.0.9/ Androidx version 3.1.3
1. Improvements to getting content length.
Version 3.0.8/ Android x version 3.1.2
1. Fixed group error reporting bugs with FetchGroup.getProgress() method.
2. Fixed network on main thread error.
3. Improved network connection checks.
4. Improvements and fixes to the StorageResolver when working with the Storage Access Framework.
5. Files are now pre allocated on local storage on request enqueue. This prevents waste of data. See FetchConfiguration method `fun preAllocateFileOnCreation(preAllocateFile: Boolean)` to enable or disable this feature. On by default.
6. Added new field segment to Downloader.Request. See java docs for details.
7. Added new Fetch method `fun getContentLengthForRequests(requests:List<Request>, fromServer: Boolean, func: Func<List<Pair<Request,Long>>>, func2: Func<List<Pair<Request, Error>>>): Fetch`
8. Performance improvements to the Parallel downloader mode.
Version 3.0.7/ Android x version 3.1.1
Added new pauseAll method on Fetch.
Added new resumeAll method on Fetch.
Better logging.
Library code cleanup.
Special thanks to Alex Starchenko for submitting the fixes and improvements
Version 3.0.6
Identical to the androidx version 3.1.0
Version 3.0.5
This release only adds a new Feature that allows Fetch to auto retry failed downloads for any reason. Set the number of times Fetch will auto retry a download when it fails.
This feature if off by default.
1. New fields added on Download: autoRetryMaxAttempts and autoRetryAttempts. See Java docs.
2. New field added on RequestInfo: autoRetryMaxAttempts. See Java docs.
3. New method added on Fetch: fun resetAutoRetryAttempts(downloadId: Int, retryDownload: Boolean = true, func: Func2<Download?>? = null, func2: Func<Error>? = null): Fetch
4. New method added on RXFetch: fun resetAutoRetryAttempts(downloadId: Int, retryDownload: Boolean = true): Convertible<Download?>
5. New method added on FetchConfiguration: fun setAutoRetryMaxAttempts(autoRetryMaxAttempts: Int): Builder. See Java Docs
```java
final FetchConfiguration fetchConfiguration = new FetchConfiguration.Builder(this)
.enableRetryOnNetworkGain(true)
.setDownloadConcurrentLimit(2)
.setAutoRetryMaxAttempts(10) // set global auto retry max attempts for all downloads.
.build();
final Fetch fetch = Fetch.Impl.getInstance(fetchConfiguration);
//OR
final String url = "dummy url";
final String file = "dummy file";
final Request request = new Request(url, file);
request.setAutoRetryMaxAttempts(5); // set auto retry on individual downloads.
fetch.getDownload(request.getId(), download -> {
if (download != null) {
download.getAutoRetryAttempts(); //get the number of auto retry attempts.
download.getAutoRetryMaxAttempts(); //get the number of max attempts.
}
});
//reset the auto retry attempts for a download
fetch.resetAutoRetryAttempts(request.getId(), true, null, null);
```
Version 3.0.4
1. updated documentation
2. remove has activeDownloads(): Boolean method. Use fun hasActiveDownloads(includeAddedDownloads: Boolean, func: Func<Boolean>): Fetch or fun addActiveDownloadsObserver(includeAddedDownloads: Boolean = false, fetchObserver: FetchObserver<Boolean>): Fetch instead.
3. Added new methods on Fetch addActiveDownloadsObserver(includeAddedDownloads: Boolean = false, fetchObserver: FetchObserver<Boolean>): Fetch and removeActiveDownloadsObserver(fetchObserver: FetchObserver<Boolean>): Fetch
4. Added new method on FetchConfiguration fun setHasActiveDownloadsCheckInterval(intervalInMillis: Long): Builder
5. Added new REPORTING option on Reason enum
6. Added new method on FetchConfiguration fun createDownloadFileOnEnqueue(create: Boolean): Builder
7. Fix for starting download immediately whiles enqueuing
Version 3.0.3
- Bug fixes for hasActiveDownloads method.
- Download url redirection fixes and improvements
- Added internet check method to FetchConfiguration called setInternetAccessUrlCheck(url: String?): Builder
See documentation on usage.
- Added new fields redirected and redirectedUrl on Downloader.ServerRequest class.
Version 3.0.2
- Added Wrapper class around FetchDatabase to provide safer access
- Added Priority Sort to change the way Fetch queues downloads based on time created.
Note: Fetch 3.1.0 Will be the next big release. The library will be migrating to AndroidX packages.
Point releases will be created for the none AndroidX version of the library.
Version 3.0.1
- Added new method hasActiveDownloads(includeAddedDownloads: Boolean, func: Func<Boolean>)
Version 3.0.0
*Version 3 comes with a lot of enhancements and fixes*
Fetch:
- FetchGroupListener. FetchGroupListener extends from FetchListener and allows you to listener for
updates on a group. The methods on FetchGroupListener will return a FetchGroup object that contains
all the downloads in a group and will inform you which download triggered a change on the group. Also see AbstractFetchGroupListener.
- Added new method to rename a completed download's file. see Fetch.renameCompletedDownloadFile method.
Observers:
- Introducing FetchObserver. Fetch now allows you to subscribe from updates for a single Download or a Group of Downloads.
Using the FetchObserver and FetchGroupObserver interface respectively. See Fetch.attachFetchObserversForDownload(id, observers...) documentation
for more information. Also check the sample app for usage.
- Introducing FetchGroup. FetchGroup is an object that contains all information about a group Fetch manages. The group is
automatically updated any time a download from the group updates. You can subscribe to FetchGroup's using the FetchGroupObserver.
FetchGroupObservers attached to a FetchGroup will be notified when downloads on a group changes. You will be notified of
the Reason for the change as well. See Fetch.getFetchGroup(id, callback) documentation for more information.
Database:
- Fetch now allows you to provide your own database manager to manage downloads. See the FetchDatabaseManager documentation and
FetchConfiguration.Builder class to get started. Note: Fetch depends on your FetchDatabaseManager methods to be synchronized to work correctly.
Download:
- Added new fields on the Download objects. Fields: etaInMilliSeconds, downloadedBytesPerSecond. See documentation.
Fixes & Small Improvements:
- You can now set the Handler Fetch will use to perform all operations on. See FetchConfiguration.Builder.setHandler method.
- Fixed a bug that prevented notification buttons (pause, cancel, resume, etc) from firing the intent.
Version 2.3.6
- Out of Memory Error. Fixed issued in the downloader where an out of memory error would occur.
Version 2.3.5
- Fetch methods removeAllInGroupWithStatus, deleteAllInGroupWithStatus, getDownloadsInGroupWithStatus
have been updated to allow more than one Status to be queried or actioned upon. See Java doc for details
. Special thanks to Marcin Adamczewski for submitting PR.
- Fetch logging is now disabled by default and can be enabled with the FetchConfiguration method. `.enableLogging(true)`
- The Error enum object now has a new field attach `httpResponse`. This response object contains the HttpCode and other
http related information. This field is only provided when an error occurs and it is related to the Http response.
- Fixed EnqueueAction.UPDATE_ACCORDINGLY that caused the onComplete listener method to be called if the newly enqueued request
was previously downloaded and completed but the file on the storage system was delete.
Version 2.3.4
- Added default cookie manager for the okhttp and httpurlconnection client Downloaders.
- Fixed an EnqueueAction.INCREMENT_FILE_NAME bug where files were not properly created.
- Download, Request, DownloadBlock and other data classes now extend Serializable.
- Okhttp and HttpUrlConnection clients now add a default Referer header to each request if
one is not provided. Default Referer is the host of the url passed in the request.
- Behavior change and Updates for ActiveDownloads method on Fetch. The ActiveDownload method
can now only be called on threads other than the Main(UI) Thread. The ActiveDownload method
now correctly return true if there are active downloads. Downloads with a queued or Downloading status.
Note: Calling this method on a UI thread will throw a FetchException.
- Added new awaitFinish methods on Fetch. The awaitFinish method blocks the current non UI thread
until Fetch has completed all enqueued downloads. The awaitFinishTimeout method takes in a time in milliseconds
to release the hold if Fetch has not completed all downloads in the allocated timeframe.
Passing 0 to the awaitFinishTimeout method will hold the thread indefinitely(Never releasing).
Recommend to use the awaitFinishTimeout method inside Android Workers and release the task when a certain amount of time has passed. See Java docs for details.
Note: Calling this method on a UI thread will throw a FetchException.
Version 2.3.3
- Fixed return type of Downloader interface method onPreClientExecute. Now returns Void correctly.
Version 2.3.2
- Downloader interfaces and classes that extend Downloader now have a new method called onPreClientExecute(client: T, request: Downloader.ServerRequest): R?
This method allows you to specify settings on the client before executing the request.
- Fixed resume bug with Parallel downloader
Version 2.3.1
This is the first stable version of Fetch 2. Enjoy.
- Fixed an issue where the priority queue backoff would not work correctly.
- Fixed an issue where request with a file uri would not resume correctly.
- Fixed an issue where the Fetch database would crash on large group calls.
- Added new method fun fileExists(file: String): Boolean on StorageResolver.
- Added new method getServerResponse for Fetch and RxFetch.
- Fixed an issue where completed download notifications using the DefaultNotificationManager would
show the progress bar when a download completed.
Version 2.3.0-RC1
This version has lots of changes, improvements and bug fixes. Please read carefully.
New
1. Fetch now supports notifications via the FetchNotificationManager interface.
See DefaultFetchNotificationManager class and sample code on usage.
2. Fetch now supports saving downloads to URI paths via StorageResolver.
See sample code and DefaultStorageResolver class for usage.
- New constructor added for Request object. Request(url, Uri)
- New get method added on Request object. request.getFileUri()
- New get method added on Download interface. download.getFileUri()
- New set method added on FetchConfiguration.Builder class. builder.setStorageResolver(storageResolver)
- New set method added on FetchConfiguration.Builder class. builder.setNotificationManager(fetchNotificationManager)
- New interface added FetchNotificationManager. See java Docs.
- New class added DefaultFetchNotificationManager. See java Docs.
- New interface added StorageResolver. See javaDocs.
- New class added DefaultStorageResolver. See java Docs.
Bug Fixes
- Improvements and bug fixes to Parallel and Sequential file downloader.
- Fixed an issue where the onCompleted method would not be called for downloads with unknown content length.
- Fixed bug where EnqueueAction.DO_NOT_ENQUEUE_IF_EXISTING would throw an exception when it should not.
- Improvements to EnqueueAction.Update_ Accordingly
- Tons of bug fixes and performance improvements.
Breaking Changes
- The Fetch and RxFetch List enqueue method now has a new signature.
fun enqueue(requests: List<Request>, func: Func<List<Pair<Request, Error>>>? = null): Fetch
See Java Docs for more information. The new signature allows for the case where a request may fail
to enqueue but other request are still enqueued instead of the whole operation being terminated.
If the Error is Error.NONE this means that the download was successfully enqueued. Otherwise
this means that the enqueue for the request failed.
- In order to make Fetch more modular and accommodating to different application environments,
the following methods were removed from the Downloader interface and are now on the StorageResolver interface.
If you are overriding these methods, you must extend the StorageResolver interface or DefaultStorageResolver class
and set an instance on the Fetch Configuration builder you are using to create your Fetch instance.
Methods Moved:
fun getRequestOutputResourceWrapper(request: Downloader.ServerRequest): OutputResourceWrapper
fun getDirectoryForFileDownloaderTypeParallel(request: Downloader.ServerRequest): String
Version 2.2.0-RC16
- Enqueue Action bug fixes
Version 2.2.0-RC15
- Network state check improvements.
- Fetch.getHasActiveDownloads() should now report accurately.
- Added new getListenerSet() method on Fetch. This returns the set of listeners attached to the Fetch instance.
- Fixed database error not parsing error correctly to Error enum for consumption.
- Fixed enqueue request bug.
- Improvements to Sequential downloader.
Breaking Changes
- Improvements for verifying the hash of a completed download.
- FetchConfiguration method enableMD5Check(enabled: Boolean) has been renamed to enableHashCheck(enabled: Boolean)
- Downloader interface verifyMD5Hash method has been renamed to verifyContentHash. See Java docs.
- New method added on Downloader interface called getContentHash. See Java docs.
- Error value INVALID_MD5_HASH has been renamed to INVALID_CONTENT_HASH
Version 2.2.0-RC14
- Added new EnqueueAction (UPDATE_ACCORDINGLY) which is now the default EnqueueAction. (NEW)
- Bug fixes to Fetch and RxFetch enqueue methods.(BEHAVIOR CHANGE)
- Bug fixes to Fetch and RXFetch updateRequest methods. (BEHAVIOR CHANGE)
- Added new boolean param called updatedListeners for Fetch and RxFetch updateRequest methods. (BREAKING CHANGE)
- Improvements and bug fixes to download processing backoff strategy.
Version 2.2.0-RC13
- Added new backoff logic for the queue processor
Version 2.2.0-RC12
- Added new method enableFileExistChecks(enabled: Boolean) on FetchConfiguration class
- Small fixes to ParallelDownloader
Version 2.2.0-RC11
- Fixed issue where downloads would get stuck in the queue and fetch would mark all downloads as failed.
- Behavior change: Fetch no longer mark downloads with a Failed status if the file on the disk storage system is not found.
If the file is not found and the download status is Queued or Paused, Fetch will simply start the download from the beginning.
Version 2.2.0-RC10
- Added new Fetch field named hasActiveDownloads. This field indicates if the fetch namespace has
active(downloading or queued) downloads. Use this field to keep background services using fetch
alive. This field is thread safe.
Version 2.2.0-RC9
- Fixed issue where different namespace Fetch instances shared the same logger object
- Breaking Change. Added new boolean param for add completed downloads method. Now:
fun addCompletedDownload(completedDownload, boolean, func, func2): Fetch
and
fun addCompletedDownloads(completedDownloadsList, boolean, func, func2): Fetch
- Added documentation for Extras and MutableExtras classes.
Version 2.2.0-RC8
- Fixed issue where downloads will not start processing after calling autoStart.
- Fixed issue where the callbacks returned wrong download object.
- Fixed issue where the download callbacks where not called.
Version 2.2.0-RC7
- Many fixes and performance improvements to the Parallel ParallelDownloader.
Breaking changes Parallel Downloader: For a much needed performance and memory improvement changes has to be made
to the way the Parallel downloader stores download information. Partially
downloaded request from old versions of Fetch when moved to the new Parallel downloader will have to download from the start
using the new format but will continue to work as expected after the first run.
- The created field for the Download and CompletedDownload objects are now in milliseconds.
Breaking changes Created Field. Previously those field stored the created time in a mix of nanoseconds and milliseconds.
You may need to do the conventions as necessary on downloads created with previous versions of Fetch.
- Files deleted outside of Fetch for a completed download no longer caused the download status to change to failed.
- Enqueuing downloads improvements
- Download Progress reporting fixes.
- Enqueue list method now ensures that each request in the list is distinct by file. If not, an error is thrown
with the appropriate reason when the requests are being enqueued.
- RxFetch improvements and bug fixes
- Added new Fetch and RxFetch method fun addListener(listener: FetchListener, notify: Boolean, autoStart)
You can now autoStart download processing after attaching a fetchListener.
- Added new Fetch method fun getFetchConfiguration(). This method returns the configuration object that created the Fetch instance.
- Added new object Extras and MutableExtras that makes to easy to store and get custom key/value pairs with type support for a request/download.
Breaking Changes. The extras field on Request, CompletedDownload, FileResource has all been updated to use Extras object. Existing extras maps (Map<String, String) are migrated to
the new extras object automatically.
- Added new Fetch and RxFetch method fun replaceExtras(id: Int, extras: Extras, func, func2) to replace the extras
on an existing request/download stored in the Fetch database.
- Threads created by Fetch are now named. Improves debugging.
- FetchFileServer Delegate.Listener method names have been updated to better reflect their use.
- FetchFileServer uses Extras object instead of custom json string where possible.
- Bug fixes and performance improvements
- Logging improvements
Version 2.2.0-RC6
- Fixed multi enqueue issues.
Version 2.2.0-RC5
- EnqueueAction.REPLACE_EXISTING fixes
- Fixed bug where deleted download returns the wrong status
- fixed bug when fetching the catalog from a Fetch file server causes Json Exceptions
Version 2.2.0-RC4
- Fixed action methods throwing a collection empty exception.
- Big fixes and improvements.
Version 2.2.0-RC3
- Fixed Fetch.Impl.getDefaultInstance()
- Fixed RxFetch.Impl.getDefaultInstance()
Version 2.2.0-RC2
- Allow downloadConcurrentLimit to be set to 0. Effectively that instance of Fetch can perform all normal actions except downloading requests.
- Can now set download concurrent limit on Fetch instance at runtime using method fun setDownloadConcurrentLimit(downloadConcurrentLimit: Int): Fetch
- Errors Fetch throws now have an attached throwable: eg `error.getThrowable()` that you can retrieve the exception that caused the Error. Note throwable may be null.
- Added new Parameters to FetchListener onStart method now: fun onStarted(download: Download, downloadBlocks: List<DownloadBlock>, totalBlocks: Int)
- Added new Parameters to FetchListener onError method now: fun onError(download: Download, error: Error, throwable: Throwable?)
- Added new FetchListener method fun onWaitingNetwork(download: Download). This method is always called on a background thread.
- Download Manager bug and crash fixes
- Fixed GlobalNetworkType bug causing it to not work correctly
Version 2.2.0-RC1
This version has so many fixes and improvements that I forgot half of them. Listing all I can remember and marked correctly in the commits.
Big thanks to @duncanokeyo on Github for continuously pointing out issues and improvements.
- Fixed issue where DownloadConcurrent issue was not working.
- Fixed issue where Sequential Downloader reported download progress in the wrong order.
- Added new onStarted(download) method on FetchListener
- Request class has a new field call extras of type Map<String, String>. Use this field to store additional data with a request.
- Download interface has new field called extras of type Map<String, String> that returns the extras of a request.
- Control a download's speed by overriding downloader method getRequestBufferSize(request): Int
- To update information on a request. Call Fetch method updateRequest(requestId, updatedRequest, func, func2)
- FetchListener method onDownloadBlockUpdated(download, downloadBlock, totalBlocks) is now called in a timely fashion
- Added new Fetch method getContentLengthForRequest(request, fromServer, func, func2)that returns the content-length
of a download. You can call this method before or after enqueuing a download. It works independently of other Fetch actions.
- Added new Fetch method getFetchFileServerCatalog(request, func, func2). Use this method to get the full file resource catalog of a FetchFileServer.
- Many Fetch action methods(pause, resume, retry, etc) now take two additional callback to are notified of the success and failure of an
action. Read the Javadocs for more information on what data is returned to the callback methods.
- RxFetch no longer extends Fetch interface. The allowed several fixes and improvements.
- Downloader method getHeadRequestMethodSupported(request) now default to false unless you override
- Downloader interface has several new methods and improvements.
- Downloader method getRequestFileDownloaderType now take an additional parameter of type Set<Downloader.FileDownloaderType>
that returns a set of supported FileDownloaderTypes for a request.
- Sequential downloader has been improved
- Parallel downloader has been improved.
- Many fixes when more that one fetch instances share the same namespace.
- Download status reporting fixes.
- FetchFileServerDownloader class now moved into package com.tonyodev.fetch2
- Fetch action methods(pause, resume, retry, etc) now return the proper error when the action fails. Use action methods with callback params.
- HttpUrlConnectionDownloader, OkHttpDownloader, FetchFileServerDownloader improvements
- General error reporting improvements.
- FetchFileServer improvements
- FileResource class updates
- Removed FetchFileResourceDownloadTask class
- General bug fixes and improvements
Version 2.1.0-RC15
- Downloader improvements
- Added new method fun getHeadRequestMethodSupported(request: ServerRequest): Boolean for downloader. True by default.
Version 2.1.0-RC14
- Downloader improvements
- Parcelable classes - Request, Download, CompletedDownload, DownloadBlock and FileRequest.
- Fetch File Server improvements
- Fetch File Server Task class improvements
- bug fixes
Version 2.1.0-RC13
- Added new Fetch method getDownloadBlocks(downloadId: Int, func: Func<List<DownloadBlock>>): Fetch
- Parallel downloader bug fixes
- Downloader improvements
Version 2.1.0-RC12
- Added new Status. Status.Added
- Added new FetchListener method onAdded(download)
- Added new FetchListener method onDownloadBlockUpdated(download: Download, downloadBlock: DownloadBlock, totalBlocks: Int)
- Bug Fixes
Version 2.1.0-RC11
- Fixed Database Migration issue that caused crash.
- Added new field downloadOnEnqueue on Request and Download class.
Use: Action used by Fetch when enqueuing a request to determine if to place the new request in
the downloading queue immediately after enqueue to be processed with its turn arrives.
The default value is true. If true, the download will have a status of Status.QUEUED.
If false, the download will have a status of Status.ADDED.
Version 2.1.0-RC10
- Updated Fetch.updateRequest method.
Version 2.1.0-RC9
- Renamed enqueue option EnqueueAction.THROW_ERROR_IF_EXISTING to EnqueueAction.DO_NOT_ENQUEUE_IF_EXISTING
to better reflect the action intention.
Version 2.1.0-RC8
- Added new Enqueue Action option: EnqueueAction.THROW_ERROR_IF_EXISTING. See java docs for details.
- Added Error option : Error.REQUEST_WITH_FILE_PATH_ALREADY_EXIST
Version 2.1.0-RC7
- Added new Fetch methods addCompletedDownload(completedDownload, callback, callback) and addCompletedDownloads(completedDownloadsList, callback, callback).
These methods allows you to add a completed download to Fetch for management. Associated methods were also added for RxFetch.
Version 2.1.0-RC6
- Added new method onServerResponse(request: ServerRequest, response: Response) on Downloader class
- Added new property responseHeaders on Downloader.Response class
Version 2.1.0-RC5
- Removed enableListenerNotifyOnAttached on FetchConfiguration listener. Added new method on Fetch class
called addListener(fetchListener, notify) instead.
This option allows Fetch to notify the newly attached listener instantly of the download status
of all downloads managed by the namespace. Default is false.
- Added new Fetch and RxFetch method getDownloadsByRequestIdentifier(identifier: Long). Use request.identifier field.
- Added new convenience method on FetchConfiguration class called getNewFetchInstanceFromConfiguration which
returns a newly created instance of Fetch.
- Updated Kotlin plugin version to 1.2.50
- Updated other library dependencies.
- Bug Fixes
Version 2.1.0-RC4
- Added new method enableListenerNotifyOnAttached(enabled) to FetchConfiguration.Builder class.
This option allows Fetch to notify the newly attached listeners of the download status
of all downloads managed by the namespace. Default is false.
Version 2.1.0-RC3
- Removed used AppCompat Dependency on library modules.
Version 2.1.0-RC2
- Added missing identifier field on Downloader.Request class.
Version 2.1.0-RC1
This version of Fetch contains many fixes and breaking changes.
Note: Uses will not lose downloads migrating to this version once the same namespace is set.
There are no behavioral changes in the way requests are downloaded.
Changes include method renaming and moving classes into a different packages. New in this
version of Fetch is the release of the FetchFileServer. See demo in sample app. The wiki for this repo will be updated
over the coming days.
Changes:
- Logger, Downloader, Func, Func2 and FetchLogger classes moved to com.tonyodev.fetch2core
- OkHttpDownloader class moved to com.tonyodev.fetch2okhttp. Add this dependency implementation "com.tonyodev.fetch2okhttp:fetch2okhttp:2.1.0-RC1" to your build.gradle file.
- Fetch.Builder and RxFetch.Builder classes has been removed and is replaced with FetchConfiguration.Builder.
- To get an instance of Fetch call Fetch.Impl.getInstance(fetchConfiguration)
or RxFetch.Impl.getInstance(fetchConfiguration) to get a new instance.
- You can now get a default instance of Fetch by calling Fetch.Impl.getDefaultInstance(). Be sure to set
the default FetchConfiguration at least once before calling the getDefaultInstance() method. To set the default configuration
call Fetch.Impl.setDefaultInstanceConfiguration(fetchConfiguration)
- To set a custom Http Downloader for Fetch, call setHttpDownloader(downloader) on the FetchConfiguration.Builder.
- To set the namespace of a Fetch instance, call setNamespace(namespace) on the FetchConfiguration.Builder.
- New method enableMd5Check(enabled) on the FetchConfiguration.Builder. If supported by the server, Fetch will check
the md5 checksum after a download completes and will report errors if the md5 checksum does not match.
- You can now have multiple instance with the same namespace. All Fetch instances with the same namespace will
be updated automatically.
- Closing an instance of Fetch no longer causes crashes and releases all resources when appropriate.
- Fetch Listeners are now held as weak references to reduce memory leaks.
- Fetch Listener onQueued method has been updated to onQueued(Download download, boolean waitingOnNetwork)
- New Kotlin friendly methods added to Fetch for enqueuing requests and querying download information.
- Request class now has an enqueueAction field which replaces RequestOptions.
- RequestOptions enum was removed and replaced with EnqueueAction enum. There are two EnqueueAction types available.
REPLACE_EXISTING and INCREMENT_FILE_NAME. Each new Request has a default enqueue action of REPLACE_EXISTING
which will replace any existing request that Fetch is managing with the same File. If INCREMENT_FILE_NAME
is set on the request, Fetch will auto increment the file name for the request and return the updated
request in the first callback of the enqueue method. Be sure to update your external request references
with the updated request.
- Request class no longer allows you to set the id field of a request. Request class has new field called identifier.
Use the identifier(Long) field to set your own unique id to identify a request or download.
- New enqueueAction and identifier fields added on Download and Request class.
- Logging is now enabled by default in Fetch
- Fetch Error 12 and 14 removed. No longer needed because of EnqueueAction simplicity.
FetchFileServer
- Introducing the FetchFileServer. The FetchFileServer is a lightweight TCP File Server that acts like
an HTTP file server designed specifically to share files between Android devices. You can host file resources
with the FetchFileServer on one device and have Fetch download Files from the server
on another device. See sample app for more information. Wiki on Fetch File Server will be
added in the coming days.
- To download files from a FetchFileServer using Fetch, set a custom file server downloader on the
FetchConfiguration.Builder class by calling the setFileServerDownloader(fileServerDownloader) method.
The com.tonyodev.fetch2downloads package already contains a custom downloader called
FetchFileServerDownloader that you can use and extend.
- You can also use the FetchFileServer without having to use Fetch to download files hosted by the
file server. See the FetchFileResourceDownloadTask class inside the com.tonyodev.fetch2downloads
package for more details.
Version 2.0.0-RC22
- Bug fix for progress reporting on Parallel downloads
Version 2.0.0-RC21
- Bug fix for status reporting on Parallel downloads
Version 2.0.0-RC20
- Added New FileDownloader types. Parallel and Sequential Downloaders.
a)Parallel downloader slices a download in multiple parts allowing for faster download.
This downloader processes the download over several background threads. Use the parallel downloader when system resources are not constrained.
b)Sequential downloader is the default downloader, and processes a download request Sequentially.
The download is processed on a single background thread. The Downloader is Generally Fast.
See the Downloader.kt java docs for more information.
- Bug fixes
Version 2.0.0-RC19
- Added new RequestOptions for Fetch. Fixed RequestOptions from RC18. See the Java documents and sample app for more information.
- Bug fixes
- Updated the sample app to reflect RequestOption changes
Version 2.0.0-RC18
- Added new RequestOptions for Fetch. See the Java documents and sample app for more information.
- Bug fixes
- Updated the sample app
Version 2.0.0-RC17
- Added new method getRequestOutputStream(request: Request, filePointerOffset: Long): OutputStream? on Downloader interface.
You can now provide Fetch a custom downloader that provides an OutputStream per Download. See Downloader.kt documentation for more information.
Also see sample app for more information on custom downloader.
Breaking Changes
- Added new method getRequestOutputStream(request: Request, filePointerOffset: Long): OutputStream? on Downloader interface.
- Added new fields id, file, and tag on Downloader.Request class.
- Added new field request on Downloader.Response class.
Version 2.0.0-RC16
- Fix for retry on network gain. Thanks to dougkeen
- Library updates
Version 2.0.0-RC15
- updated Fetch Migrator
Version 2.0.0-RC14
- Bug fixes to database sanitize methods
Version 2.0.0-RC13
- Bug fixes.
- Added new Error.FILE_NOT_FOUND constant if the downloaded file on the local devices was deleted
and the matching request is still managed by Fetch.
- Fetch now sanitizes(Checks if the local file exist) downloads from the database on each get call.
Version 2.0.0-RC12
- Improved error reporting and handling when a download encounters an error.
- Error returned with a download that encountered an error now has a throwable attached when the error occurs.
Version 2.0.0-RC11
- Fixed Fetch close bugs
- Fixed onResume bugs
- Bug fixes
Version 2.0.0-RC10
- Memory usage improvements
- Performance improvements
- Bug fixes
Version 2.0.0-RC9
- Lowered min sdk to 14
- Updated android support library, Kotlin, rxJava and okHttp library
- Added copy method on Download Interface
- Bug fixes on DownloadInfo class
- Fixed FetchImplementationException crash after calling close method on Fetch.
- Added missing callbacks on rxFetch enqueue methods
- Better error handling for non-existing urls - Special thanks to Joshua Park (jclova) for the fix.
- Added enabledAutoStart method on Fetch Builder
- Added retry download on network lost feature.
- Added enableRetryOnNetworkGain method on FetchBuilder
- Added Tag field to Request and Download classes. Tags are saved to the FetchDatabase. See documentation.
- Overall improvement and bug fixes
Version 2.0.0-RC8
- Can now use your own unique id for a request.
- Added new methods removeAllWithStatus(status: Status) and fun deleteAllWithStatus(status: Status)
- RxJava library update
Version 2.0.0-RC7
- Kotlin update.
- Fixed download priority issue.
Version 2.0.0-RC6
- Dependency fixes.
- kotlin update.
- Fixed okResponse method in httpUrlConnectionDownloader class.
Version 2.0.0-RC5
- Behavior Change: Added download speed reporting in Fetch Listener onProgress method.
- Fixed ETA reporting. Reports are more accurate using weighted moving average.
Version 2.0.0-RC4
- Fixed slow downloading speeds on some devices.
Version 2.0.0-RC3
- Fix compile and build issue for non Kotlin projects.
- Minor changes for rxFetch.
Version 2.0.0-RC2
- Added new inner class HttpUrlConnectionPreferences to HttpUrlConnectionDownloader. See java docs.
- travis config update.
- remove circleci config file.
- updated unit tests.
- Change source and target comparability from version 1_8 to 1_7 for better project comparability.
Version 2.0.0-RC1
*Fetch has been completely rebuilt in version 2 and is not compatible with Fetch version 1.
What's new?
- Fetch is now faster, more accurate, customizable and developer friendly.
- Fetch instances are thread safe.
- Fetch uses less system resources.
- More status reporting methods have been added to the FetchListener.
- Better download status reporting.
- Better error reporting.
- Grouped download support added.
- Download time remaining is now reported in the FetchListener onProgress method.
- Support for HttpUrlConnection and OkHttp client downloader. You can also provide Fetch
your own custom Downloader. See the Java Docs for the Downloader class and check out the README.
- Better logging. You can also provide Fetch with your own custom logger. See the update samples.
- Network specific downloading support.
- Set priority on downloads.
- Built entirely in Kotlin.
- Updated Samples.
Version 1.1.5
- bug fixes
Version 1.1.4
- bug fixes
- Android Oreo compatibility
Version 1.1.3
- Enqueuing is now faster
- New RemoveRequest(id) and RemoveRequestsAll() methods that removes a request from the database but does not delete the file
- Error log fixes
- Database Bug fixes.
- Fixed cursors not closing properly
- New setOnUpdateInterval(ms) to control the progress update interval.
Version 1.1.2
- Added new get(long...ids) method to Fetch.
- Max Limit on concurrent downloads removed.
- Fetch Service now stops when all work is done.
- Bug fixes.
Version 1.1.1
- Fixed SQLite error when strings where not escaped when inserting into the database.
- Added new updateUrlForRequest method to Fetch.
- Bug fixes.
Version 1.1.0
- Concurrent Downloads Support.
- Logging improvements.
- New Settings class to change Fetch's behavior.
- Bug fixes and performance improvements.
Version 1.0.3
- Improved progress reporting.
- Bug fixes and performance improvements.
- updated API methods.
Version 1.0.2
- Bug fixes around progress reporting.
- Bug fixes and performance improvements.
Version 1.0.1
- Bug fixes and performance improvements.
- Fetch Listener now also reports downloaded bytes and file size.
- New Fetch Call feature.
- Update Fetch documentation.
Verson 1.0
- Simple and easy to use API.
- Continuous downloading in the background.
- Ability to pause and resume downloads.
- Set the priority of a download request.
- Ability to retry failed downloads.
- Easy progress and status tracking.
- And more...