11
22[ ![ Build Status] ( https://travis-ci.org/tonyofrancis/Fetch.svg?branch=v2 )] ( https://travis-ci.org/tonyofrancis/Fetch )
3- [ ![ Download] ( https://api.bintray.com/packages/tonyofrancis/maven/fetch2/images/download.svg?version=3.0.10 ) ] ( https://bintray.com/tonyofrancis/maven/fetch2/3.0.10 /link )
3+ [ ![ Download] ( https://api.bintray.com/packages/tonyofrancis/maven/fetch2/images/download.svg?version=3.0.11 ) ] ( https://bintray.com/tonyofrancis/maven/fetch2/3.0.11 /link )
44[ ![ Android Arsenal] ( https://img.shields.io/badge/Android%20Arsenal-Android%20Networking-blue.svg?style=flat )] ( https://android-arsenal.com/details/1/5196 )
55[ ![ License] ( https://img.shields.io/badge/license-Apache%202.0-blue.svg )] ( https://github.com/tonyofrancis/Fetch/blob/master/LICENSE )
66
@@ -21,7 +21,7 @@ Features
2121* Concurrent downloading support.
2222* Ability to pause and resume downloads.
2323* Set the priority of a download.
24- * Network specific downloading support.
24+ * Network- specific downloading support.
2525* Ability to retry failed downloads.
2626* Ability to group downloads.
2727* Easy progress and status tracking.
@@ -43,18 +43,24 @@ add the following storage permissions to your application's manifest. For Androi
4343<uses-permission android : name =" android.permission.WRITE_EXTERNAL_STORAGE" />
4444<uses-permission android : name =" android.permission.READ_EXTERNAL_STORAGE" />
4545```
46+ Also, as you are going to use Internet to download files. We need to add the Internet access permissions
47+ in the Manifest.
48+
49+ ``` xml
50+ <uses-permission android : name =" android.permission.INTERNET" />
51+ ```
4652
4753How to use Fetch
4854----------------
4955
5056Using Fetch is easy! Just add the Gradle dependency to your application's build.gradle file.
5157
5258``` java
53- implementation " com.tonyodev.fetch2:fetch2:3.0.10 "
59+ implementation " com.tonyodev.fetch2:fetch2:3.0.11 "
5460```
5561Androidx use:
5662``` java
57- implementation " androidx.tonyodev.fetch2:xfetch2:3.1.4 "
63+ implementation " androidx.tonyodev.fetch2:xfetch2:3.1.5 "
5864```
5965
6066Next, get an instance of Fetch and request a download.
@@ -177,27 +183,27 @@ You can query Fetch for download information in several ways.
177183``` java
178184// Query all downloads
179185fetch. getDownloads(new Func<List<? extends Download > > () {
180- @Override
186+ @Override
181187 public void call (List<? extends Download > downloads ) {
182- // Access all downloads here
188+ // Access all downloads here
183189 }
184190});
185191
186192// Get all downloads with a status
187193fetch. getDownloadsWithStatus(Status . DOWNLOADING , new Func<List<? extends Download > > () {
188- @Override
194+ @Override
189195 public void call (List<? extends Download > downloads ) {
190- // Access downloads that are downloading
196+ // Access downloads that are downloading
191197 }
192198});
193199
194200// You can also access grouped downloads
195201int groupId = 52687447745 ;
196202fetch. getDownloadsInGroup(groupId, new Func<List<? extends Download > > () {
197- @Override
198- public void call (List<? extends Download > downloads ) {
199- // Access grouped downloads
200- }
203+ @Override
204+ public void call (List<? extends Download > downloads ) {
205+ // Access grouped downloads
206+ }
201207});
202208```
203209
@@ -216,25 +222,25 @@ Downloaders
216222
217223By default Fetch uses the HttpUrlConnection client via the HttpUrlConnectionDownloader
218224to download requests. Add the following Gradle dependency to your application's build.gradle
219- to use the OkHttp Downloader instead. You can create your own custom downloaders
225+ to use the OkHttp Downloader instead. You can create your custom downloaders
220226if necessary. See the Java docs for details.
221227
222228``` java
223- implementation " com.tonyodev.fetch2okhttp:fetch2okhttp:3.0.10 "
229+ implementation " com.tonyodev.fetch2okhttp:fetch2okhttp:3.0.11 "
224230```
225231Androidx use:
226232``` java
227- implementation " androidx.tonyodev.fetch2okhttp:xfetch2okhttp:3.1.4 "
233+ implementation " androidx.tonyodev.fetch2okhttp:xfetch2okhttp:3.1.5 "
228234```
229235
230236Set the OkHttp Downloader for Fetch to use.
231237``` java
232238OkHttpClient okHttpClient = new OkHttpClient .Builder (). build();
233239
234240FetchConfiguration fetchConfiguration = new FetchConfiguration .Builder (this )
235- .setDownloadConcurrentLimit(10 )
236- .setHttpDownloader(new OkHttpDownloader (okHttpClient))
237- .build();
241+ .setDownloadConcurrentLimit(10 )
242+ .setHttpDownloader(new OkHttpDownloader (okHttpClient))
243+ .build();
238244
239245Fetch fetch = Fetch . Impl . getInstance(fetchConfiguration);
240246```
@@ -246,11 +252,11 @@ If you would like to take advantage of RxJava2 features when using Fetch,
246252add the following gradle dependency to your application's build.gradle file.
247253
248254``` java
249- implementation " com.tonyodev.fetch2rx:fetch2rx:3.0.10 "
255+ implementation " com.tonyodev.fetch2rx:fetch2rx:3.0.11 "
250256```
251257Androidx use:
252258``` java
253- implementation " androidx.tonyodev.fetch2rx:xfetch2rx:3.1.4 "
259+ implementation " androidx.tonyodev.fetch2rx:xfetch2rx:3.1.5 "
254260```
255261
256262RxFetch makes it super easy to enqueue download requests and query downloads using rxJava2 functional methods.
@@ -280,20 +286,20 @@ FetchFileServer
280286
281287Introducing the FetchFileServer. The FetchFileServer is a lightweight TCP File Server that acts like
282288an HTTP file server designed specifically to share files between Android devices. You can host file resources
283- with the FetchFileServer on one device and have Fetch download Files from the server
284- on another device. See sample app for more information. Wiki on FetchFileServer will be
289+ with the FetchFileServer on one device and have to Fetch download Files from the server
290+ on another device. See the sample app for more information. Wiki on FetchFileServer will be
285291added in the coming days.
286292
287293Start using FetchFileServer by adding the gradle dependency to your application's build.gradle file.
288294``` java
289- implementation " com.tonyodev.fetch2fileserver:fetch2fileserver:3.0.10 "
295+ implementation " com.tonyodev.fetch2fileserver:fetch2fileserver:3.0.11 "
290296```
291297Androidx use:
292298``` java
293- implementation " androidx.tonyodev.fetch2fileserver:xfetch2fileserver:3.1.4 "
299+ implementation " androidx.tonyodev.fetch2fileserver:xfetch2fileserver:3.1.5 "
294300```
295301
296- Start a FetchFileServer instance and add resource files that it can server to connected clients.
302+ Start a FetchFileServer instance and add resource files that it can serve to connected clients.
297303``` java
298304public class TestActivity extends AppCompatActivity {
299305
@@ -399,11 +405,11 @@ Fetch1 Migration
399405
400406Migrate downloads from Fetch1 to Fetch2 using the migration assistant. Add the following gradle dependency to your application's build.gradle file.
401407``` java
402- implementation " com.tonyodev.fetchmigrator:fetchmigrator:3.0.10 "
408+ implementation " com.tonyodev.fetchmigrator:fetchmigrator:3.0.11 "
403409```
404410Androidx use:
405411``` java
406- implementation " androidx.tonyodev.fetchmigrator:xfetchmigrator:3.1.4 "
412+ implementation " androidx.tonyodev.fetchmigrator:xfetchmigrator:3.1.5 "
407413```
408414
409415Then run the Migrator.
@@ -450,7 +456,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
450456you may not use this file except in compliance with the License.
451457You may obtain a copy of the License at
452458
453- http://www.apache.org/licenses/LICENSE-2.0
459+ http://www.apache.org/licenses/LICENSE-2.0
454460
455461Unless required by applicable law or agreed to in writing, software
456462distributed under the License is distributed on an "AS IS" BASIS,
0 commit comments