Currently, I am working on developing an application that has a unique requirement - it must be able to function offline and have a synchronization mechanism with servers. This means that users should have the ability to sync the app with server data whenever needed.
To achieve this, I created a process that utilizes Cordova's 'FileTransfer' combined with Node.js to generate a json file containing the most up-to-date information, which is then downloaded to the local file system of the device. However, I encountered a challenge when attempting to fetch the data using a standard http request to this file.
After investigating the logcat of my device, I discovered that executing http requests to the 'file://' protocol was not feasible. As I reflect on this issue, it is beginning to make sense why the process did not work as expected.
My main question now is: How can I retrieve a file from the local file system? Is there a method to simulate a service running on the device for this purpose?
Thank you in advance for any guidance or solutions!