I am trying to implement this example using C # and Monodroid, but I am having difficulty reading and writing the Asset file:
http://docs.xamarin.com/android/advanced_topics/using_android_assets
I use an emulator, not a device.
First of all, it's hard for me to find the namespace for Assets.Open. I ended up finding
const string lfn = MyAssetFile.txt;
System.IO.StreamReader(Android.Content.Res.Resources.System.Assets.Open(lfn);
Is this the correct namespace?
Secondly, my Asset file is marked as AndroidAsset and "Copy Always" in the VS Properties panel, but my attempts to read the file always fail (File Not Found) with this statement:
string settings = "";
using (StreamReader sr = new System.IO.StreamReader (Android.Content.Res.Resources.System.Assets.Open(lfn))) settings = sr.ReadToEnd();
I have the wrong VS settings, so the asset file is not copied to the emulator or it is copied OK, but my code to open / read is wrong?