Offline Use - Loading Images - XY Background

Alrighty, a bit of knowledge seeking around this.

First, if I enable “The app can start when offline” the loading images indication in the menu goes away. I’m kind of confused on how that option and the “Store content for offline use” interact together, and what the intent is. Why can’t I start while offline, and still load the images when there is connectivity? I guess I’m just a little confused as to what is actually going on in the background.

Second, when I was set to see the loading images it needed to load 1116 images. I went into my data set and literally counted how many images with relative data paths my application had access to, and it was ~70 images. What is that about?

Third, Dynamic XY Background images don’t seem to load and function correctly when offline even when I wait for all 1116 images to load. I have a setup where we have a color background image and a grayscale version of that same image. We allow the user to toggle back and forth so that the Pin are well highlighted over grayscale, but they can switch to color when they need to zoom in and review the details of the drawing. This expression results in relative image path which is available in a basic image column on the parent to the pins. When we’re online and not thinking about this, everything works fine. When we load the app/images, and then switch to offline, nothing about the XY background functions well… What should I be expecting?

2 Likes

I seem to recall a developer posting that there are resized versions of each image.

1 Like

Hmmm well, 15 different versions of the same image and still not being able to stick it on the background, or automatically give me a grayscale option seems a bit excessive :stuck_out_tongue:

1 Like

Maybe AppSheet is using the Image Pyramid for XY Background Images?


That would explain the amount of images in your App.

Is for sure disconcerting to users. But I’m more interested in the offline functionality, and it seems sketchy with XY
Have you done much experimentation with offline?

@Adam can you help me out with some knowledge around this?

I found some information in this article:

One important pre-condition for all offline access is that the app must initially be launched on the device when it is online.


Note that offline content viewing of images and documents only works when the links to the images or documents use relative paths as described in Working with PDF Files.


Launching offline : If you have used the lightweight deployment mechanism, you are familiar with launching apps from their home screen icons. By default, a mobile device needs to be online in order to launch an app from its home screen icon. Once launched, the app can then function offline or with intermittent connectivity.

However, if you wish to launch the app when the device is offline, you must go to the Behavior>Offline & Sync tab and set the ‘Offline App Launch’ option. You must do this before installing the app on your device . If your app has already been installed to the home screen, the shortcut must be deleted and installed again after enabling the offline option. Otherwise you will need to launch it from the AppSheet app itself.

1 Like

:flushed: You are so right @Grant_Stead
I hadn’t tested my App offline, but it’s true: Images are showing up; XY Background Images do not.
In fact: XY does not work at all while offline.
Maybe this related to the “Maps and Offline Usage” in the above help article?
“However, you won’t be able to display the position in the map view while the app is offline.”

I’m guessing that even though we can simply use relative paths for images as background, that deep down appsheet is still converting it into some sort of public image.

I mean I know it’s possible to do… When I travel sometimes I’ll download an entire map so that I have it for offline use… I honestly just figured this would all work the same…

Yes that’s right, but not possible in AppSheet.
In the Help Article it says:

Maps and Offline Usage

It’s possible to capture the user’s current location with a LatLong input because this can use the device’s GPS. However, you won’t be able to display the position in the map view while the app is offline. We’re unable to cache Google map data for offline use because it would violate Google’s terms of service. Google’s own Maps app does offer downloading of map regions for offline use, but unfortunately they don’t make this feature available for third party apps that use maps.

1 Like

Well they’re not third party any more… :nerd_face::money_mouth_face:

1 Like

Hi @Grant_Stead so what’s the summary? You can’t use a XY App while offline? :thinking:

Another thing: Every time I start the app, it will show the “Loading Images” and will load again all images. Do you see the same behavior?

1 Like

Currently, XY offline is a little strange. Theoretically it should work, but in practice it does not.

The map must preload into cache all the images that it would need for offline use while you’re connected…

So, if you’re offline, and add an image through the app, and deref that into the XY background… It won’t ever show up as a background. It won’t exist in the map cache… Further, if you have any expressions that choose one background over another dynamically, only the images that are “used” will be pushed to cache, making the others not available offline.

So, the main trick is making sure you preload any images that will be used into the map… Think a virtual xy column or something… (This won’t correct adding an image while offline to be used in XY)

One other issue is that only 10 images were/are cached…

KML also isn’t cached. So, it’s just gone while offline.

Also, the behavior around zoom levels and caching each of those is hard for me to fully explain, or even understand. But right now, when I’m offline, I can’t really zoom in, the map blanks on me…

Yes, the same loading behavior exists for me as well… It’s very fast though, and I think it’s doing a check or download type thing…

I’m working with @Adam to solution this a little better. I’m very hopeful that we can find a middle ground solution.

1 Like

Thank you very much for the input.

If we could use dynamic expressions for the KML layer, we could use relative paths and then it should be available offline?
I started using KML for info Text screen overlay. To tell the user what to do on the xy map view.

1 Like

No, AppSheet would need to specifically build the KML Caching into the Map Java… Currently it’s not.

1 Like

So, is there any chance to get XY backgrounds fully working when it’s offline?

So far, in my opinion, not yet…
I feel like Adam is close, but my testing of the fixes haven’t produced results…

2 Likes

Saw this on changelog:
An issue was fixed where zooming in too far would cause XY maps to go blank when offline.

Caveats: For XY maps to work offline, the app must enable offline caching and must be started online before going offline. Currently only supported on Android.

Rollout: 100% free users and 33% paid users.

So, this is the solution? Need online at startup app or one map?

2 Likes

Basically…
Unless I’m mistaken the map is java, and the images must be loaded into cache…

1 Like