I am creating an app for friend and essentially I want them to be able to type in a food, when found tells them nutrition information.
I plan to include as many food as possible so would I have to code all the different types of foods in my main.lua with the outcomes or is there some sort of database trick I can do?
Depending on the number and size of records, you may not want to keep it all in memory. This is where a database comes in handy. Corona SDK supports SQLite for things like this.
Another option if you have network connectivity is to use a remote database. The benefit here is you can add more data to it without having to release a new app. There might already be online nutrition databases that provide access through an API to access their data.
There are also services like Parse.com that offer database in the cloud services. Several people on here have build mod_parse modules that you can use to bridge your Corona SDK app with Parse databases. You will need to google for them though.
Depending on the number and size of records, you may not want to keep it all in memory. This is where a database comes in handy. Corona SDK supports SQLite for things like this.
Another option if you have network connectivity is to use a remote database. The benefit here is you can add more data to it without having to release a new app. There might already be online nutrition databases that provide access through an API to access their data.
There are also services like Parse.com that offer database in the cloud services. Several people on here have build mod_parse modules that you can use to bridge your Corona SDK app with Parse databases. You will need to google for them though.