1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2026-02-06 08:33:43 +00:00

Recablage des filtres pour les sorts en local + reparsing à la volée du html en vue détail en attendant que la bdd soit carrée

This commit is contained in:
Yan Maniez 2018-05-14 21:40:18 +02:00
parent 1c451bf795
commit 3ac3afc3aa
8 changed files with 106 additions and 46 deletions

View file

@ -29,7 +29,33 @@ namespace AideDeJeu.Droid
public string GetDatabasePath(string databaseName)
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), databaseName);
var documentsDirectoryPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var path = Path.Combine(documentsDirectoryPath, databaseName);
// This is where we copy in our pre-created database
if (!File.Exists(path))
{
using (var inStream = Android.App.Application.Context.Assets.Open(databaseName))
{
using (var outStream = new FileStream(path, FileMode.Create))
{
inStream.CopyTo(outStream);
}
}
//using (var binaryReader = new BinaryReader(Android.App.Application.Context.Assets.Open(databaseName)))
//{
// using (var binaryWriter = new BinaryWriter(new FileStream(path, FileMode.Create)))
// {
// byte[] buffer = new byte[2048];
// int length = 0;
// while ((length = binaryReader.Read(buffer, 0, buffer.Length)) > 0)
// {
// binaryWriter.Write(buffer, 0, length);
// }
// }
//}
}
return path;
}
}
}