Download Doc/PDF from the internet and save to internal memory [closed]
Asked Answered
H

0

9

I am attempting to make an application that will primarily open and read a predetermined set of documents that I have. The original idea was for all the documents (about 40 equaling MB) to be copied into the user's internal memory (/data/data/(appname)/files) on first run or install. I realize that this may be a bad idea with some phones having limited space in the internal memory. I now am thinking of changing my app idea to download a file from a stored location on the internet and have it saved to the internal memory. This way the user can view only the needed documents, severely shaving down the size of the memory needed. I have seen some code snippets of how to download files, for this instance I want to use a PDFs, but I cannot find a way to save them to the internal memory (/data/data/(app)/files). I have seen many snippets dealing with databases but I need to save PDFs and doc files.

Any help on how to: 1. download a doc/PDFs file from the internet, 2. immediately save the file to internal memory, 3. launch the doc/PDFs from the internal memory using a 3rd party program (example being adobe reader).

I appreciate the help!

Hagiographa answered 30/4, 2012 at 5:27 Comment(6)
What exactly do you mean "from the internet"? Where are those files stored? Are they publicly available over http (web)? Do you need certain credentials to access them? The Internet is a pretty big place.Teacher
And why do you insist on internal memory? Why can't you save those files to the external storage and use them from there? If you still want to use internal storage follow the guidelines here: developer.android.com/guide/topics/data/…Teacher
1. download a doc/PDFs file from the internet, 2. immediately save the file to internal memory, For that you can try this example : Example1 and Example2Hypothecate
3. launch the doc/PDFs from the internal memory using a 3rd party program (example being adobe reader). For that you can use this Answers : Answer1 and Answer2Hypothecate
Yes, publicly available files that I would upload so the app could just download them and place them in the stored location. I preffered the internal memory because I wouldn't want to clutter up the SDcard and most phones today don't run too low on internal memory - in my experience.Hagiographa
OK, it's just that I had some trouble accessing files on internal memory sometimes. And it might even be a phone and Android version dependent issue.Teacher

© 2022 - 2024 — McMap. All rights reserved.