简体   繁体   English

如何处理MvvmCross中的可下载资产

[英]How to handle downloadable assets in MvvmCross

I have an app that synchronises content with a web server so that the app ends up with an offline and cut down version of the server based web pages. 我有一个应用程序,它将内容与Web服务器同步,以便应用程序最终得到基于服务器的网页的离线和缩减版本。 All text and html is stored in a SQLite database but what is the best approach for handling file assets? 所有文本和html都存储在SQLite数据库中,但处理文件资产的最佳方法是什么? In my case this is a mix of image and audio files. 在我的例子中,这是图像和音频文件的混合。

The synchronisation is all set up in the core project and my Touch project has a Content directory set up for storing the assets and my intention had been to have a similar setup for Droid. 同步都在核心项目中设置,我的Touch项目有一个内容目录设置用于存储资产,我的意图是为Droid设置类似的设置。 I could pass the list of files needed to the UI projects and download them from there but that seems wrong. 我可以传递UI项目所需的文件列表并从那里下载,但这似乎是错误的。

Thanks. 谢谢。

For that I would create a Service in Mvx which the ViewModels you create use for getting the external assets. 为此,我将在Mvx中创建一个服务,您创建的ViewModel用于获取外部资产。 Take for instance the Daily Dilbert Tutorial . 每日Dilbert教程为例。 You could consider the daily comics as being very similar to your external assets, where the DilbertService is used to get all the comics and presents them in a List . 您可以将每日漫画视为与您的外部资产非常相似,其中DilbertService用于获取所有漫画并将其呈现在List However your list could be a list of files located on the SDcard or where you decide to store your files. 但是,您的列表可能是位于SD卡上的文件列表,也可能是您决定存储文件的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM