Saving new or existing files require some important actions on the host application side especially where to load and save the files on the device. Some certain locations require special permissions to be set in the manifest. Please find more information about this in the official Android documentation ( e.g. getFilesDir() , getExternalFilesDir(java.lang.String) ). The saving samples always write files to the app specific folders.
Note: Using folders without setting up proper permissions in the manifest may lead to a crash.
Saving files can be invoked by calling system provided commands (SAVE, SAVEAS) or kernel functions, no matter if it is a new or existing file. Existing files have already a real file path on the device the SDK uses for writing but for saving new files it is necessary to setup the setWorkingFolder( … ) provided by the singleton CFxARESInstance.instance(). The SDK will always trigger the callback dialogGetFileName( … ) provided by CFxARESInstanceDelegate, this callback allows the host application to show a custom user interface that allows the user to specify a file name or path or the host application can even directly return a fixed location.
Existing commands
Status | ||
---|---|---|
|
...
The sample module brings a custom save command _CUSTOMSAVE and a custom close command _CUSTOMCLOSE. The custom save command shows how saving a new file can be initiated from the
Status | ||||
---|---|---|---|---|
|