Android的 - 下载文档/ PDF从互联网并保存到内部存储器 [英] Android - Download Doc/PDF from the internet and save to internal memory

查看:124
本文介绍了Android的 - 下载文档/ PDF从互联网并保存到内部存储器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做出将主要开放和阅读predetermined设置的,我有文档的应用程序。最初的想法是为所有在第一次运行或安装(约等于40 MB)复制到用户的内部存储器中的文件(/数据/数据​​/(应用程序名称)/文件)。我知道这可能是具有有限的空间在内部存储器中的一些手机是一个坏主意。我现在想改变我的应用程序的想法,从互联网上的存储位置下载文件并将其保存到内存中。这样,用户只能查看需要的文件,严重剃下来所需要的存储器的大小。我已经看到了如何下载文件,这种情况下我想用一个PDF文件的一些code片段,但我不能找到一种方法将它们保存到内存(/数据/数据​​/(APP)/文件) 。我见过很多片段处理数据库,但我需要保存PDF和DOC文件。

如何任何帮助:一个DOC / PDF文件从互联网1.下载文件,2.立即将文件保存到内存中,3推出从内部存储器使用第三方程序中的DOC / PDF文件(例如是Adobe Reader的)。

我AP preciate的帮助!

解决方案
  
      
  1. 在下载DOC / PDF文件从Internet文件,2.立即将文件保存到内存中,
  2.   

有关,你可以尝试这个例子:例1 和<一HREF =htt​​p://www.hassanpur.com/blog/2011/04/android-development-downloading-a-file-from-the-web/相对=nofollow>例题

  
      
  1. 从内部存储器使用第三方程序(例如正在Adobe Reader的)启动DOC / PDF文件。
  2.   

有关,你可以使用这个答案: Answer1 和<一href="http://stackoverflow.com/questions/2923265/android-how-do-i-open-another-app-from-my-app">Answer2

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!

解决方案

  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 Example2

  1. 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 Answer2

这篇关于Android的 - 下载文档/ PDF从互联网并保存到内部存储器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆