I am currently using FilePicker in xamarin forms to choose a zip file, then I get fullpath from it and use this fullpath in Xamarin.Android project. Using following code:
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Select zip file"
});
if (result != null)
{
FileNameLabel.Text = $"{result.FileName}";
if (!result.FileName.EndsWith("zip", StringComparison.OrdinalIgnoreCase))
{
await DisplayAlert("Wrong File", "Selected file is not right", "Ok");
}
else
{
var stream = result.OpenReadAsync();
_filepath = result.FullPath;
}
}
I want to do the same thing, but without FilePicker, instead add my zip file as embedded resource. I know I can access, embedded resouce using following code, but I am unable to get FullPath.
var assembly = IntrospectionExtensions.GetTypeInfo(typeof(App)).Assembly;
Stream stream = assembly.GetManifestResourceStream("TestFile.json");
is it possible to do something like:
File file = new File(assembly.GetManifestResourceStream("TestFile.Zip"));
_fullname = file.FullName;