Android: Cannnot save data downladed from server using DownloadManager to internal memory -


I am downloading data from the server using the DownloadManager class in Android. Data saves external memory but I want to save them in internal memory. I did my research and what I found is that I tried the second solution of cyngus : < Pre> public static final string PROVIDER_NAME = "com.provider.Downloads"; Public stable final URI CONTENT_URI = Uri.parse ("Content: //" + PROVIDER_NAME + "/ download") DownloadManager.Request req = New DownloadManager.Request (Uri.parse (LINK)); Req.setDestinationUri (CONTENT_URI);

This did not work, he gave me an error: java.lang.IllegalArgumentException: a file URI no: content: //com.provider.downloads/downloads . Am i wrong

It is clearly mentioned that the destination you set is setDestination * Methods should be on external storage and your app must have WRITE_EXTERNAL_STORAGE permission:

Set local destination for downloaded file. There should be a file URI for a path on external storage, and WRITE_EXTERNAL_STORAGE permission in the calling app.

I do not know how to get access to the internal storage path here.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -