Software Archive
Read-only legacy content
17060 Discussions

How to "write to"?

Cooper_M_
Beginner
399 Views

I have a big question regarding to "write to" and using this program. I'm attempting to create an app using this program - but I am still uncertain on how to proceed. Suppose I wanted to use an app and use it to collect data (varying from account information to inputs), and I understand that I need to use "write to' to accomplish that. 

What I don't understand is how to approach it. I understand that we need a server of some sort to collect data. I understand write to function as creating or opening file then write into the file. But I want to test some codes and practice using this technique and use the code to implement creating files using app I'll be making. I can't get server yet but would like to "prepare" for it if possible. So how do we practice and code to store files before actually use the server? 

I'm ok if I could save data via my computer desktop or something like that. But I don't know how to get around on that using XDK and creating app (then tested on my iPad) without using actual server - for testing/learning purpose. 

Thank you

0 Kudos
3 Replies
Amrita_C_Intel
Employee
399 Views

I believe this link might have your answer.

http://qnimate.com/working-with-file-system-using-intel-xdk/

0 Kudos
Cooper_M_
Beginner
399 Views

Thank you. That link looks very helpful! I will try and create a demo with just this to test.

I have one question. If I use filesystem.root using iPad as demo - where would the file appear? In iPad or would it transfer to my laptop somewhere? I just want to know where to look so I can confirm the result had succeed or not. 

Again, thank you! 

 

Edit; I ran into error of localfilesystem not defined. I've added script to load the filesystem.js as well to help but doesn't work. I have no idea how to proceed. 

0 Kudos
Chris_P_Intel
Employee
399 Views

If you need to keep data locally, in the app, then there are several solutions:

 

 

If you need to keep it on a remote server, then the very simplest solution is to use something like Parse.com, Kinvey,com or one of their many competitors. These are for-pay services that manage data storage, user authorization, and more. Parse and Kinvey are really powerful and easy. Highly recommended if you are not familiar with server side development.

Otherwise, you will need to run your own HTTP server with your own code for collecting and storing that data. There are dozens of decisions to make (hosting, OS for server, HTTP stack, Database, security, what languages to employ, CORS, etc etc) and a lot of material to master. Heroku, Amazon, Rackspace are the big names in this field, but there are thousands of other routes and options. 

Hope this helps,

Chris

0 Kudos
Reply