Cross-platform SDK and HTML5 tools for mobile app development
X
 

Serial store access

2 posts / 0 new
Last post
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:
Serial store access

Afternoon,

For my project I've got some data packaged up. This contains images and text I want to put on screens. My problem is that it has very quickly grown to 775k, with only a few smallish (230x170) PNG files. Each of these images was much bigger than I was expecting (80 - 100k) and its really increased the size of my download. Now, to access the store, I need to load all of it into memory, read out what I want and then delete it from memory. Obviously, I now need to increase the data size by 775k just to read the data, which means that older phones won't have enough ram.

Is there anything we can do to access stores via a stream or specifiying which bytes (an offset and a length) we wish to read, and only that data being loaded?

Fredrik Eldh
Fredrik's picture
Offline
Mobile Sourcerer
Joined: 16 Feb 2009
Posts:
Re: Serial store access

Each store can only be read (into a MoSync data object) as a whole. It seems to me that it might be better to split the data up into multiple files.

However, once a store is read into a data object, that data object can then be accessed randomly, using functions like maReadData() and maCreateImageFromData().

I don't understand why you should need to read the entire thing into program memory. If you can avoid that, you can decrease the data size.

Login or register to post comments