我需要添加一些文件以供部署的Android应用程序访问以进行测试(稍后将从互联网下载)。特别是,我需要缓存目录中的文件供应用程序查看
有没有办法在构建时将它们添加到那里?
或任何时候。我甚至不能用android调试监视器将它们添加到apk \ cache! (它说无法推送物品)
真的唯一的方法是从网上下载它我想知道.. o_O
答案 0 :(得分:1)
您可以使用资产文件夹
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".
These files will be deployed with you package and will be accessible using Android's
AssetManager, like this:
public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
InputStream input = Assets.Open ("my_asset.txt");
}
}