Search code examples
javascriptiphonefile-iocordovastreamreader

How do you open a file line by line in phonegap?


I'm looking to do some pretty data-intensive stuff using phonegap. The first thing I looked at was to stream-read a JSON file line by line to collect the data needed. Unfortunately, I can't seem to find a way. Is there a memory-effective way of stream-reading a file from phonegap?

John.


Solution

  • What you are trying to do is currently not possible with the standard phonegap api.

    Files are written completely into a DOMString right now.

    If you really need this you can take a look into writing a phonegap plugin that returns files by line. Here the link to the wiki to get you starting writing plugins: http://wiki.phonegap.com/w/page/36752779/PhoneGap-Plugins