凡被保存在存储在Android上的PhoneGap应用程序文件? [英] Where are files saved in PhoneGap app stored on Android?

查看:156
本文介绍了凡被保存在存储在Android上的PhoneGap应用程序文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PhoneGap的使用文件的插件。我懂阅读及放大器;文件写入到文件系统,这些都是正确的坚持。但是,当我试图找到从本地文件浏览器应用程序在平板电脑上,或从Windows资源管理器将这些文件(通过USB连接),我无法找到这些文件的任何痕迹通过浏览到该文件夹​​的PhoneGap号称存储这些(平板\机器人\数据\ com.xxx.yyy \文件),也有搜索功能。我没有贴在我的Andr​​oid平板电脑的任何外部卡。任何想法如何找到这些文件?

I am using PhoneGap with File plugin. I am able to read & write files to file system and those are persisted correctly. But when I try to locate those files from native file explorer app on tablet or from Windows Explorer (through USB connection), I can't find any traces of these files by browsing to folder that PhoneGap claims to store those (Tablet\Android\data\com.xxx.yyy\files) to nor with search functionality. I do not have any external cards attached to my Android tablet. Any ideas how to find those files?

推荐答案

在认真研究的 Android的文档有关存储的选择,我发现,这是的内部存储的是用于应用程序的私人的数据不应该是可能预期的行为通过访问文件系统的其他应用程序来读取。

After carefully studying Android documentation about storage options I spotted that this is the intended behavior of internal storage which is used for applications private data that shouldn't be possible to read by other applications accessing the file system.

我把所有的时间认为的外部的简称SD卡,而是外部存储设备这样的描述

I have all the time thought that the external referred to SD cards but instead the external storage is described like this

每一个Android兼容设备支持共享外部存储   你可以用它来保存文件。这可以是一个可移动存储介质   (如SD卡)或内部(不可移动)的存储。档   保存到外部存储是世界可读和可修改   由用户时它们使USB大容量存储到上一个传输文件   计算机。

Every Android-compatible device supports a shared "external storage" that you can use to save files. This can be a removable storage media (such as an SD card) or an internal (non-removable) storage. Files saved to the external storage are world-readable and can be modified by the user when they enable USB mass storage to transfer files on a computer.

这似乎是我一直在寻找的确切行为。通过使用 cordova.file.externalDataDirectory ,我是能够在内部文件系统中的文件存储(不是SD卡),看看它们在文件浏览。

which seems to be the exact behavior I was looking for. By using the cordova.file.externalDataDirectory, I was able to store the files on internal file system (not to SD card) and see them in the file explorer.

我认为,外部存储的假设,指的是仅SD卡是不是完全没有道理的,因为<一href="https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md#android-file-system-layout"相对=nofollow>文件插件拥有的 / 的作为的 cordova.file.externalRootDirectory 的在Android的文件系统布局的目录。这一定是让我觉得这样的东西。

I think that the assumption of external storage referring to SD card only isn't totally unreasonable since the File plugin has / as a directory for cordova.file.externalRootDirectory in file system layout for Android. This must have been the thing that made me think that way.

这篇关于凡被保存在存储在Android上的PhoneGap应用程序文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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