gpt4 book ai didi

java - 我想在我的申请中提供一些 pdf 文件

转载 作者:行者123 更新时间:2023-12-01 05:05:55 25 4
gpt4 key购买 nike

经过互联网上的某些研究和查找后,我发现我无法将这些文件放入 Assets 文件夹中,因为这些文件对于我的应用程序来说是私有(private)的,我希望在按下重定向用户的按钮时调用 native pdf 应用程序到特定的文档。我感到困惑的是如何将文件与我的应用程序 bundle 在一起,以便当用户下载或安装我的应用程序时这些文件存储在她的 SD 卡中。

最佳答案

copy your assests files to the sdcard单击按钮时,打开 SD 卡中的文件,如下所示

 File rootDir = Environment.getExternalStorageDirectory();

File file = new File(rootDir + "/filepath/"+fileName);//give the file path here
if(file.exists())
{
// do action here
}

关于java - 我想在我的申请中提供一些 pdf 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12671038/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com