Downloading new content for app

Thanks to anyone who takes the time to understand my question and give me advice.

I’m making an app that contains levels with questions and answers, basically a quiz game. I want to be able to add new levels that can be downloaded from within the app.

What file type would you recommend to store the questions/answers data? Which is easiest for an administrator (me) to make available for new downloads? Where would I be able to upload new content?

JSON data is the easiest data for Corona to ingest. Your web server just outputs the JSON object when a network.request() API call is made, you get that JSON object (a text string) in the event.response member of the event table when the network.request() completes and then you do something as simple as:

myDownloadedLevelTable = json.decode( event.response )

Then you end up with a Lua table with your data in it. Now easiest to administrate depends a lot on your skills. Maybe it’s easiest for you to create a CVS file in a spreadsheet and upload that CVS file to your server. Perhaps you have a MySQL database and you’re comfortable adding data to that and have a PHP script that can easily create that JSON object. That’s really only a question that you can answer.

You’re going to need a website that can respond to HTTP GET or HTTP POST requests if you want to use network.request() or network.download()

Rob

Thanks, Rob. Very, very helpful!

Among many options, you can use an AWS S3 Bucket for storing the content to be downloaded.  No special coding required OR you could make the bucket secure and use some S3 Lua code to login to the bucket in order to download.

JSON data is the easiest data for Corona to ingest. Your web server just outputs the JSON object when a network.request() API call is made, you get that JSON object (a text string) in the event.response member of the event table when the network.request() completes and then you do something as simple as:

myDownloadedLevelTable = json.decode( event.response )

Then you end up with a Lua table with your data in it. Now easiest to administrate depends a lot on your skills. Maybe it’s easiest for you to create a CVS file in a spreadsheet and upload that CVS file to your server. Perhaps you have a MySQL database and you’re comfortable adding data to that and have a PHP script that can easily create that JSON object. That’s really only a question that you can answer.

You’re going to need a website that can respond to HTTP GET or HTTP POST requests if you want to use network.request() or network.download()

Rob

Thanks, Rob. Very, very helpful!

Among many options, you can use an AWS S3 Bucket for storing the content to be downloaded.  No special coding required OR you could make the bucket secure and use some S3 Lua code to login to the bucket in order to download.