Hi all
Since day’s now, I try to bring Application.Current.Properties (persistent store of properties) to work on all platforms.
In my code, I have:
protected override void OnStart()
{
if (!Application.Current.Properties.ContainsKey("iWebServerAuswahl"))
{ Application.Current.Properties["iWebServerAuswahl"] = 0; }
GV.iServerWahl = Convert.ToInt32(Application.Current.Properties["iWebServerAuswahl"]);
}
On app-start:
If the property “iWebServerAuswahl” is not defined (reloaded from persseten store), the default-value ( 0 ) is set.
Then the value from the property is overtaken I a global variable (GV.iServerwahl).
Note: The value can be changed on a setting-page in the app.
So, if no value is defined, the default-value is set, if the user has changed the default-value, the settled value is overtaken.
On WP, ALL works as expected (default value is set, a changed value is stored persistent on the device and overtaken by next start of the app and I CAN see the Application-object in debugger -> see below).
On iOS, it also works, but I have a (very) strange effect with debugger:
If I set a breakpoint on OnStart(), the debugger shows “Unknow identifier: Application”, but it works.
On Android, it DONT'T WORK (data are NOT stored persistent) and I also have the strange debugger-behavior as in iOS (“Unknow identifier: Application”).
So my questions:
- Has anybody the same problems?
- Has anybody successfully implemented the persistent store with Application.Current.Properties on Android?
Thanks for any feedback..