O'Reilly logo

Corona SDK HOTSHOT by Nevin Flanagan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Maintaining a history

To help the user with common phrases and save bandwidth and translation allowance, the app will store a history of requested translations and their results. We'll give the user the option to view them, and use them to avoid duplicate network requests if the user enters text that has already been translated.

Getting ready

We'll store the history file in the app's Documents folder, which sync software generally backs up to the user's computer. Each line will be a JSON-encoded copy of the arrays of strings that holds the original text and the translation.

Open the main.lua file in the TranslationBuddy folder, if you don't already have it open from the previous task.

Getting on with it

The history view and the entry view both need ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required