当把包含数据的XML文件中的一个Android应用程序应用程序、文件、数据、XML

2023-09-06 01:06:18 作者:怎安好

我是新的Andr​​oid开发。我与该应用程序会读取数据的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被允许(高达 你喜欢)。 在分度号的研究级 存储在资产阅读资源 使用完成的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.