Export a json file

Hi all! I have a question: if possible to export or move a .json file from documents directory to any Android directory outside the app?

What I want to do is create a json table, fill that table with various actions of the app user and then export/move it to a place where I can connect a jumpdrive via the provided android usb c and copy the json file to it.  I want to open the json file in an excel project.

Thanks in advance

DoDi

There is an External Storage plugin. With that and the system.pathForFile() API (http://docs.coronalabs.com/api/library/system/pathForFile.html) you should be able to get a file handle that you can json.encode() a table and write the resulting string to the file.

But I’m a little concerned about the practicality of what you want to do? How are you going to get access to the device to download the file from it? Is this an app that will only be used by a few people you are close to so you can have access to their devices?

You might want to consider uploading the files to a server somewhere, but you have to consider all the various privacy rules depending on what data you’re collecting.

Rob

@Rob

thanks for your response!

I will see the plugin.

it’s a simple app to check when an employee do something like clean a bathroom

the app will have the name of the employee, day and time of the task performed.

I still think you would be better to maybe figure out the REST api for a Google spreadsheet and add a row to the spreadsheet and if the company is using Google GSuite then HR or whoever needs to check on employees can use tools they are familiar with and not have to do with these very invasive mechanical steps.

Apps are supposed to make our lives easier, not harder and having someone not only have to track their work actions via an app, then they have to go find a manager to pop out the SD card, read it, merge it in with some other data system just doesn’t sound practical to me.

Rob