I have a program using SaveState (Android).

I have a program using SaveState (Android).
On the first version i had 6 parameters.
saving 6 parameter onsavestate.
On form show
if SaveState.Stream.Size > 0 then
begin
..... Read 6 parameters
end
else
begin
.... initialize
end
However now i need to add more parameters
here i will have problems.
if SaveState.Stream.Size > 0 then
begin
read 8 or more parameters

My only solution is to DELETE the program and reinstall it.
BUT I DO NOT WANT TO ASK the users to uninstall
SO WHAT IS THE SOLUTION FROM ONE VERSION TO the other
when more parameters are added ?

Comments

  1. store the number of parameters in the stream :)

    ReplyDelete
  2. Paul TOTH Thanks. SaveState.Stream.SetSize(); right?

    ReplyDelete
  3. you don't say how you store your data so I can't tell you...

    ReplyDelete
  4. Your first parameter could have been a version number or the number of parameters that were saved.

    Can you access the stream position to assess if you have reached the end of the stream before trying to read the new parameters?

    ReplyDelete
  5. Lars Fosdal i am jumping from one project to another. customer problems. i will return

    ReplyDelete
  6. Lars Fosdal used your idea thanks "the number of parameters"

    ReplyDelete
  7. Whats function savestate for, i use tinifiles to save setting

    ReplyDelete
  8. Irwanto Irwanto It is used on Android to save parameters. I fixed it by Lars Fosdal suggestion added a count of last save.

    ReplyDelete

Post a Comment