How do I write/create/store files locally on mobile devices?

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi all.

    I would like to manage a database that can be modified and created by the users in-game and I would like to do it through (create/write/store) local files instead of web storage. I was searching the web and the forum to find the answer if Construct 2 can write and store local files but I can't find a straight answer. Many people only asking about how to read external files but what I want to do is not only read existing files but also write and create local files on mobile devices and I'm wondering if Construct 2 can do that or not?

    So far it seems like I can generate JSON files and download it, but it is not exactly what I want because I want to store the files within the application and not to download them. NW.js object seems to be able to read and write files locally, but it is desktop only as far as I know but I need the functionality on mobile (or is it works on mobile too?).

    Anyone could tell me please if it possible to create, write and store local files in a Construct 2 application on mobile devices?

    Thanks in advance.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ddabrahim

    I am not an expert on saving local files. but I do a lot with databases.

    As far as i know, the whole idea of writing to local files on mobile is considered a major security threat, so pretty much the only local option would be to use Local Storage. You could take an array full of data and store that in Local Storage easily. I guess it depends on how much data you want to store, and how important data integrity is - if it is local, people will find a way to modify it in ways you might not want.

    Setting up a database on a web site and passing data back and forth with AJAX calls is not that hard and works really well for me. Then you have access and a lot more control over all the data your users are saving - if you want to do any kind of statistics, or checking if anything suspicious is going on.

  • Thank you for your reply. I thought writing local files might be not an option, actually I'm just experimenting with Local Storage and it seems to be fine but data integrity is very important I don't know how reliable it is. I haven't actually thought about setting up a database on a website, I'm might give it some thought.

    Thanks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)