当把包含数据的XML文件中的一个Android应用程序 [英] Where to place an XML file containing data within an Android app
问题描述
我是新的Android开发。我与该应用程序会读取数据的XML文件。我应该在哪里保存这个XML文件?它应该被存储在价值文件夹?
I am new to Android development. I have an XML file with data that the app will read. Where should I keep this XML file? Should it be stored within the "value" folder?
推荐答案
我会说,要看情况。你怎么在你的XML-文件保存?此外,还有一个 RES / XML
-folder,其中XML档案可以保持。但是Android不近XML的文件什么,所以你可能需要阅读我的在哪里把它追索权的小教程。
I'd say that depends. What do you save in your XML-File? There also is a res/xml
-folder, where XML-Files can be kept. But Android does nearly anything with XML-Files, so you might want to read my little Tutorial about where to put which recourses.
此外,还有就是资产
和水库之间的差异
-directory的:
Also, there is a difference between the assets
and the res
-directory's:
- 在没有subdirectorys允许下 在特定的资源文件夹。
- 的
研究
级索引的所有资源 并提供了简单的访问。 - 有一些简单的方法,这
帮助存储在读取文件
RES
-directory
- No subdirectorys are allowed under the specific resource-folders.
- The
R
-class indexes all resources and provides simple access. - There are some simple methods which
help reading files stored in the
res
-directory
- Subdirectorys被允许(高达 你喜欢)。
- 在分度号的
研究
级
存储在 - 阅读资源
资产
使用完成的<一个href="http://developer.android.com/reference/android/content/res/AssetManager.html">AssetManager.
- Subdirectorys are allowed (as much as you like).
- No indexing by the
R
-class - Reading resources stored in
assets
is done using the AssetManager.
这篇关于当把包含数据的XML文件中的一个Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!