Best Implementation for Opening & Storing a Large Amount of Images on Client
Application Type
Mobile
Service Studio Version
11.10.16 (Build 40208)

I would like to know if there is a more efficient way to implement my mobile app idea. Any input is appreciated!

The purpose of the app is for users to scan QR codes located on poles within various motorcycle trail systems. When the user scans the QR code (through the app, not directly from camera outside of app) a separate screen will appear showing the map for the trail the user is on. There are are about 125 maps. But, in addition to the base number of maps I would like to make multiple copies of each map with a unique position marker to indicate where the QR sticker/user is located on the map. So, instead of just a map... the image would be the map plus a green dot indicating where the user is located. An example can be seen below. There may be 5-10 variations of each map. The idea is that even without GPS signal and cellular service a user can scan a QR code located on a trail to get the map of the trail system they are on and a rough indicator where they are on the map. So in total there may be 1000+ images since each unique location identifier would need its own map. 

Since there are so many maps which will take awhile to create... this will also consume a decent amount of space (about 2-3 GB) to store locally on the users device which I am okay with. I could make the image files smaller with less resolution if this becomes a problem.

How I am currently approaching the QR --> image implementation is assigning simple QR codes with a unique identifier like 1, 2, and 3... eventually I will use identifiers like 2-1-8 (county #, trail system #, marker #). After scanning the QR code a variable is assigned the value of the QR code and the switch statement decides which screen to navigate to. Each screen contains the unique map with green dot. I only have 3 map screens for now but there would have to be +1000 screens as I mentioned earlier for this to work. This seems very tedious and I may run into lags once the number of screens increase. 

Also, I originally tried using iframe and PDF files but this was causing me issues with scaling. Having an image seemed to help with scaling, zooming, etc. on mobile.


So what are your thoughts? How would you change the implementation for this idea to be more efficient? Hopefully I explained my idea and purpose clearly. 

mvp_badge
MVP

I'd say you need to store the image somewhere on the device, and load them on demand. Obviously you can't have one Screen per map, you need a generic Screen dat loads the right map from the device.

Hi,

You can have images stored on the server;and an entity maintaining the images & records with the identifier.
Your QR-code should return the Identifier & further on you have a server action that should return you the URL of the respective Image.. which you hit using the InAppBrowser to load.

- You scan QR-code - it returns the Identifier or let's say a URL
- You call a screen & pass the URL as an input
- that screen open the URL & render in on inAppBrowser.


@Kilian Hekhuis When the images are stored in the resources are they automatically stored on the device? Is there a certain way you need to save the images such that they are stored on the device after the app install?

@assif_tiger The implementation you mention seems to be using server actions which require the client's device to have an internet connection. The main idea behind this app is for it to work without internet connection. 

Then I would say either store images as binary on local entity and load it..

Or store it on serverside and sync it on local entity..so that u can hv control on data..if incase need to update any image.

mvp_badge
MVP

You should not include the image as resource, because resources are stored inside the Module, and the Module then becomes unworkably large (takes ages to up/download). The app should come without the images, and there should be a way to one-time load the images from somewhere (probably your server), and also some option to load any map updates you may provide in the future. I think you should also allow users to load only part of the maps, e.g. for a certain state or region, as I can imagine users wouldn't want to store maps on their device that will never be used.

mvp_badge
MVP

I don't think storing in the Local Storage is a good idea. There's just way too many data here, and the Local Storage is limited to only a few GiB (2 iirc). Also databases are not ideal for binary data like map images.

Yep, I agree with you.
And I guess now he left with the only option to have data on serverside & sync it on local but only the desired one.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.