Is there any way to access image file information in an offline app?

0
Hey everyone, we are currently working on an app that must be usable offline, in an outdoor mission, as an installed apk on Android. The point is to connect attributes (enumerations like “Picture taken outside”/”Picture taken inside” and “Cars”/”One car”/”No cars”) to pictures. It’s not important whether the picture is already on the phone or if it’s to be taken with a camera widget – both is fine. After the outdoor mission, the pictures are to be transferred to a PC and the classifications must be accessible in any text-based form. For this application, it is crucial to be able to connect unique image-file-information (e.g. filepath, filename) with the classifications. The problem is that any attempt to do so has failed so far – read “Further Notes” for more information. That all might give some context to the question that is posed in the title: Is there any way to access image file information in an offline app? Kind regards       Further Notes We’ve tried the Camera Widget and the Image uploader Widget, both of which seem to be the only widgets that can be used for this cause in offline-mode. The FileID-attribute of System.FileDocument cannot be accessed in offline mode, the size of the file is not a unique attribute. Thus, there is no way to draw a connection between text-data and the stored images (neither images in the phone’s native image-directories, nor ones in the cache-directory of the app). We have also not found a way to influence the filename that’s assigned to the image when it’s stored into the cache-directory. The internal database of the app (which seems to be found in /data/data/… in Android) might be helpful, but can only be accessed via rooting your phone, which is also no solution for us.
asked
3 answers
0

Why do you need a unique file identifier? It feels to me like you’re trying to get a primary key of the image to use as a foreign key elsewhere, but in Mendix you shouldn’t need one. That’s the whole point of associations in Mendix.

It seems to me that your photo object should be a specialization of System.Image or System.FileDocument. It should then have either:

  • Attributes representing the different metadata values that your user is setting in the field
  • And/or some associations to other metadata objects

 

For either of these scenarios, you don’t need a unique ID for the file.

answered
0

You could try things out in a Before Commit microflow. That happens on the server, when you synchronize, and gives access to all attributes.

answered
0

Update: We tried using a Sync-Button now. As far as we understand it, it's supposed to synchronize the database, even in an offline-app, if an internet-connection is available.
This synchronization should have made it possible to call After-Event-Microflows, as Frederic suggested. The button was the only way we could come up with to sync the database, after failing to create an app via apk that is both offline- and online-capable.
Sadly, even this button doesn't work, replying "Your changes cannot be synchronized at this moment. They will be synchronized later" (despite a working internet connection)

answered