如何在Android中的SQLite数据库中存储PDF文件 [英] How to store a PDF file in SQLite Data base in Android

查看:67
本文介绍了如何在Android中的SQLite数据库中存储PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上,我想在我们的Android手机中下载一个PDF文件,并且不想在他尝试通过将手机连接到PC打开时授予在PC中打开PDF文件的权限.所以我想将 PDF 文件存储在 SQLite 数据库解决方案中.

Actually, I want to download a PDF file in our Android phone and don't want to give the permission to open the PDF file in PC when he try to open by connecting the Phone to PC. so I want to go with storing the PDF file in SQLite Data Base solution.

我的问题是...
是否可以在 SQLite 数据库中存储 PDF 文件?如果是,如何?或者有没有其他方法可以实现相同的功能?

My question is...
Is it possible to store PDF file in SQLite database? If yes, how? Or is there any other way to implement same functionality?

请帮帮我...

谢谢...

推荐答案

可以.只需读取pdf文件的所有字节并存储在sqlite db的blob字段中.

You can. Simply read all the bytes of the pdf file and store in the blob field of sqlite db.

这篇关于如何在Android中的SQLite数据库中存储PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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