Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Export a json file
Started by dodi_games Sep 08 2019 12:12 PM

3 replies to this topic
json
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

dodi_games

[GLOBAL: userInfoPane.html]
dodi_games
  • Contributor

  • 384 posts
  • Corona SDK

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



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,068 posts
  • Enterprise

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



[TOPIC: post.html]
#3

dodi_games

[GLOBAL: userInfoPane.html]
dodi_games
  • Contributor

  • 384 posts
  • Corona SDK

@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.



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,068 posts
  • Enterprise

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




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: json