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> This did not work, he gave me an error: It is clearly mentioned that the destination you set is 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. 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);
java.lang.IllegalArgumentException: a file URI no: content: //com.provider.downloads/downloads . Am i wrong
setDestination * Methods should be on external storage and your app must have
WRITE_EXTERNAL_STORAGE permission:
Comments
Post a Comment