How to find the absolute path of Assets folder in android.

MansaMansa INMember
edited June 2014 in Xamarin.Android

I'm trying to load an xml which is located in Assets folder using the following code

StreamReader strm = new StreamReader(Assets.Open("Version.xml"));
XDocument xd = XDocument.Load(strm);

This works fine , but i want to load through the absolute path something like this
var xmlFilePath = "file:///android_asset/Version.xml";
XDocument xd = XDocument.Load(xmlFilePath);

which is not working,suggest me a solution to find the path of Assets folder so that i can read my xml .


  • TomOpgenorthTomOpgenorth Xamurai CAXamarin Team Xamurai

    (moved this to the Android forum).

    The contents of the Assets folder aren't files, they are embedded into the APK. You can find an example of how open a Stream to an asset in this forum post.

Sign In or Register to comment.