将资产文件从一项服务传递到另一项服务
我有一项服务,应该通过使用其他服务(提供商)提供的数据文件来使其通用。我更喜欢提供者尽可能简单,并且他们提供的数据应该存储在资产文件中。数据将是恒定的,并且只能由客户端读取一次。
因为我没有“意图”或“内容提供者”方面的经验,所以我希望得到关于走哪条路的建议。
更具体地说:
ContentProviders 是否太复杂了?我查看的示例都使用数据库。
是否可以将一种指向资产文件的文件指针从一个服务传递到另一个服务,或者提供者是否必须读取其资产文件并将数据以对象形式传递给客户端?
I have got a service, which should be made generic by using data files provided by other services (providers). I prefer the providers to be as simple as possible, and the data they provide should be stored in asset files. Data will be constant and only be read once by the client.
Because I have no experience with 'intent' or 'contentProviders' I would like suggestions on which way to go.
More specific:
Is ContentProviders too complicated for this ? The samples I looked at were all using databases.
Is it possible to pass a sort of file pointer to an asset file from one service to another, or do the provider have to read its asset file and pass the data to the client in an object ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以像这样访问资产文件。如果我是正确的“file:///android_asset/fileName”,请尝试此操作
You can access asset files like this. Try this if i am correct "file:///android_asset/fileName"