facebook

JavaScript to create text file

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #333409 Reply

    Karzulovic
    Member

    Is it posible to use javascript in order to create a .txt file and store it in the internal memory of the phone?
    The idea is to store some information that the user provides and export it to the txt file so that i can view it in my pc
    (>’.’)>?

    #333444 Reply

    support-michael
    Keymaster

    MobiOne support your custom javascript to capture and hold data in memory and then send it to a webservice for handling. Apps do this all the time when capturing user inputs and submitting them to their own backend for processing. From the small amount of info you have shared it does not seem that you need a physical file of any sort unless you plan for the data to persist across sessions. And even then there are other mechanisms that may be much more efficient and simple than mess’n with files, e.g., html5 localstorage.

    #333452 Reply

    Karzulovic
    Member

    The idea is that i can export a .txt file so that i can later manipulate with other programs. At least to my knowledge txt files are much easier to import and manipulate this is why im asking.

    I need to import the txt into a webpage, the idea is that the user does not need internet to input the data and then i can recollect all the data.

    Or is there an easier way?

    Keep in mind that this app is for a proyect so i know the ppl using it, its not to distribute in google play, appstore, etc.
    thanks

    #333484 Reply

    Karzulovic
    Member

    My solution was to create a local database and when the user has internet give him the option to upload it to the main database
    I used this example on using SQL with mobiONE
    http://www.genuitec.com/support-genuitec/viewtopic.php?f=8&t=1037&start=0

    #333500 Reply

    support-michael
    Keymaster

    @Karzulovic

    I generally discourage use of websql unless it is really needed and you know your s**t and are good with complex async js programming. Do you really need a sql db? I ask because this is one of the more abused features that I see used by devs and confused by devs on these forums.

    Give html5 localstorage a look first before jumping on the websql pain train.

    #333528 Reply

    Karzulovic
    Member

    I’m now using local db but i have a problem with page transitions.
    My code runs fine at first.
    I have 3 pages:
    -Create db
    -Create table
    -Insert data

    At first they all run fine but if I go back and try to create a new table for example:
    Create db -> Create table -> insert data -> Create table (a new one)
    The test center gets non responsive and i have to restart mobione
    It also happens with dbs

    But if I merge the 3 pages into 1 everything runs fine.

    I’ve checked the code and all items are correctly assigned to each page.
    Any ideas?
    Thanks

    Also if I try to insert more than 20 columns into a table test center also gets stuck
    :O

    #333534 Reply

    Hi Karzulovic,

    We have replicated the issue with the 19 columns. Until we resolve this issue we recommend that you use a tool such as the chrome webinspector for websql development & testing.

    Re transition+sql problem: Can you share your project with us to investigate? Send a zip file to support at genuitec dot com, use title: mobione data from Karzulovic

    #333563 Reply

    Karzulovic
    Member

    I already erased that proyect :/
    Now I just merged everything into 1 page and rearranged the tables and so far everything is running fine

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: JavaScript to create text file

You must be logged in to post in the forum log in