Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Downloading new content for app
Started by scottabroughton Nov 08 2018 01:46 PM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

scottabroughton

[GLOBAL: userInfoPane.html]
scottabroughton
  • Observer

  • 12 posts
  • Corona SDK

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?



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,838 posts
  • Corona Staff

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



[TOPIC: post.html]
#3

scottabroughton

[GLOBAL: userInfoPane.html]
scottabroughton
  • Observer

  • 12 posts
  • Corona SDK

Thanks, Rob. Very, very helpful!



[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,253 posts
  • Corona SDK

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.


  • scottabroughton likes this


[topic_controls]
[/topic_controls]