Efficient local storage and access of maps in a mobile app?

192 Views Asked by At

What is the efficient way (with respect to memory and speed) to store and access maps for a mobile app? Don't want to use internet streaming for the maps.

Are the following ways efficient?

  • Store the maps as images in the mobile's local memory
  • Access the images by its file paths all stored in an array
  • Also each map has 2 opposite corner coordinates stored in a text file which is accessed to apply a coordinate system for the map.
  • The coordinates from the text file are read/parsed with input stream and stored in arrays (ie. an array for x and y).

So the above ways have 2 types of files: an image and a text file with 2 coordinates (for each image). And arrays for map paths and corner coordinates. I understand I would use file connection (persistent storage).

In the end, would like to: Develop a mobile app that can view maps locally and change maps according to user's coordinate cursor. I guess the map change can occur with boundary checking the specified coordinates with user's coordinate cursor. For example call a changeMap(x, y) in a paint(...) method.

So please suggest a cleaner and efficient way to store and access maps with coordinates.

1

There are 1 best solutions below

7
On

why not combine multiple methods? If text data isn't too heavy, you can store it in RMS. You can store images in RMS too, newer devices do not have theoretical limits on size of RMS, however a record store cannot exceed about 500KB. Store larger files on the memory card.