Issue
I am developing a crossplatform app with Xamarin and got stuck with this problem. Every time I launch my app, all the data I had saved before is lost. To give more details, I am using SQLite to persist some information and even storing some image files in the app's default directory. When I am running the app, I can persist everything successfully and even retrieve the data that I just persisted. But if I close the app and relaunch it, all the information and the files are gone. To get the directory, I am using the code below, which is suggested in the Xamarin tutorials.
string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
var path = Path.Combine(documentsPath, sqlite Filename);
At the moment I am focusing my tests on the Android, so I don't know if it happens on the other platforms. I am also using the Trial License, maybe it is some limitation related to it. I am also using Visual Studio 2013.
Does anyone have an ideia about it?
thanks
Solution
If by "launching app" you mean starting new debuggin session from VS just go to Tools - Options - Xamarin - Android Settings and tick "Preserve application data/cache on device between deploys" option.
Xamarin Studio should have same option somewhere.
Answered By - Artur Shamsutdinov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.