Android:强制数据/文件位于 SD 卡上
我是新手,这是我的第一篇文章。
我想创建一个具有大量静态文件(html)的应用程序。由于这些html文件的大小,当用户安装应用程序时,我希望能够“强制”这些文件安装在sd卡(外部存储)上。将读取这些文件的实际应用程序可以安装在内置存储上。 我应该把这些文件放在哪里?在哪些文件夹中?我知道我不能将它们放在“assets”或“res/raw”文件夹中,因为它们将被打包为应用程序的一部分,然后安装在内置存储上。 我想字典/拼写检查应用程序会实现类似的方法(参考数据存储在 SD 卡上,而主应用程序位于内置存储上) 谢谢。
I'm a newbie and this is my first post.
I want to create an application that has a lot of static files (html). Due to the size of these html files, when the user install the application, I want to be able to "force" these files to be installed on sd card (external storage). The actual application that will read these files can be installed on built in storage.
Where should I put these files? In which folders? I know I can't put them in "assets" or "res/raw" folder because they will be packaged as part of the application and then installed on the built in storage.
I would imagine dictionary/spell checker application would implement similar method (the reference data is stored on sd card while the main app is on the built in storage)
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您正在开发高于 2.2 的 Android 版本,您可以查看 AndroidManifest.xml 根元素中的
android-installLocation
属性。不过,谷歌提供的机制是基于应用程序的。以下网址提供完整说明,可能会帮助您入门。
http://developer.android.com/guide/appendix/install-location.html
You can take a look at the
android-installLocation
attribute in AndroidManifest.xml's root element if you are developing for android version later than 2.2. The mechanism google provided is on an app basis, though.The following url for a complete explanation might help you get started.
http://developer.android.com/guide/appendix/install-location.html