Skip to content

Instantly share code, notes, and snippets.

View HumbertoCabezas's full-sized avatar

Humberto Cabezas HumbertoCabezas

View GitHub Profile
public class AndroidExternalStorageWriter : IAndroidExternalStorageWriter
{
public string CreateFile(string filename, byte[] bytes)
{
if (!Directory.Exists(Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, "AccountMate")))
Directory.CreateDirectory(Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, "AccountMate"));
var path = Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, "AccountMate", filename);
File.WriteAllBytes(path, bytes);