Couple of SaveState questions.

Monkey Forums/Monkey Programming/Couple of SaveState questions.

Oddball(Posted 2014) [#1]
Hi, does anybody know how large, in characters, the SaveState file can be on iOS and Android? Also am I right in thinking this is the only way to save a file on those devices?


MikeHart(Posted 2014) [#2]
Also am I right in thinking this is the only way to save a file on those devices?


How about using the FileStream class?


Oddball(Posted 2014) [#3]
Can FileStream be used on iOS and Android? If so what is the max file size, in bytes, for saving on iOS and Android?


Capn Lee(Posted 2014) [#4]
i've only personally had a savestate of somewhere in the area of 131000 characters but I found that generating this and saving it down took a helluva long time on android (timed at about 9-10 seconds on the original asus transformer) where as it didn't even cause a frame skip on html5

if you're looking at that kind of length, it will work but it'll be an effort to make it work seamlessly


muddy_shoes(Posted 2014) [#5]
The size of the SaveState string isn't policed in the monkey code. The limits are platform dependent. On iOS and Android the save mechanisms are essentially limited by maximum file size or maximum string length, whichever comes first. I'd imagine these are in the order of 2GB.


Oddball(Posted 2014) [#6]
Thanks guys. I'm gonna try this today. If FileStream does work on iOS and Android I can compress the data before saving so that may speed up saving on Android.


Oddball(Posted 2014) [#7]
FileStream worked great. I don't know why I thought I could only read/write files with Load/SaveState on iOS and Android. What is the point of Load/SaveState then when we have FileStream?


MikeHart(Posted 2014) [#8]
At the beginning we didn't had FileStream I think. Plus LoadSaveState works on all platform including HTML5.