Currently when my application is grabbing large files from the internet using HTTPURLConnection and the device drops 3G/4G/Wifi service, what ever data it was fetching does not finish or get resumed. How do I get it to resume and finish?
My current code:
// set the URL that points to a file to be downloaded
URL url = new URL(downloadURL);
// create the new connection
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
// set up some things on the connection
urlConnection.setRequestMethod("GET");
urlConnection.setDoOutput(true);
// connect and download
urlConnection.connect();
// used in reading the data from the internet
InputStream inputStream = urlConnection.getInputStream();
urlConnection.disconnect();