Have you looked at Peach’s Ego system? (http://techority.com/2011/12/28/ego-easy-saving-and-loading-in-your-corona-apps/)
I would use this if you only need one process to determine if the app has been opened before. It will create a very small text file that should not interfere with performance. How you can use this is create a file that saves a number 1 as soon as the image you want loaded is displayed. Then you have a condition that checks if the file’s number is < 1. If it is, the image has never been displayed, if not, the image has been displayed and will not display again. That’s my pseudo code, here’s an example:
[lua]
local ego = require(“ego”)
local saveFile = ego.saveFile
local loadFile = ego.loadFile
–Create appOpenedBefore.txt
local isFirstRun = loadFile (“appOpenedBefore.txt”)
–If the file is empty (this means it is the first time you’ve run the app) save it as 0
–The second time this is run, isFirstRun will not be “empty” and you will not save isFirstRun to 0
local function checkForFile ()
if isFirstRun == “empty” then
isFirstRun = 0
saveFile(“appOpenedBefore.txt”, isFirstRun)
end
end
checkForFile()
–Then you need your image function to be run IF this is the first time the app has been opened
–Make sure to parse isFirstRun to a number or else it will be read as a string and you will get
–errors
if (tonumber(isFirstRun) < 1) then
–Run the image code and set isFirstRun to 1 and SAVE
isFirstRun = 1;
saveFile(“appOpenedBefore.txt”, isFirstRun)
end[/lua]
After this is run once, isFirstRun will be set to 1 and the if statement with the image code will never run again. I hope this helps you out! [import]uid: 50511 topic_id: 26364 reply_id: 106896[/import]