PDA

View Full Version : HowTo: Saving application settings on Symbian Device



aya_lawliet
23rd June 2011, 11:00
Hi everyone,

Before I posted this thread, I searched the forums for a solution. But I couldn't find what I'm looking for.

I wanted to add a feature on our app, that checks application updates on a once-a-day basis. Currently, everytime you run the app, it checks for updates. If you run the app a hundred times a day, it checks for updates a hundred times also. This is bad for users.

What I want to do is add a feature that only checks for updates once a day (when the app is run). Is this possible? Can I save the state of the application on the device?

I tried using QSettings, but it only works on the Simulator, when I run the app on the device, it doesn't save anything. :C

Can anyone suggest a better solution for this? thanks in advance.

mvuori
23rd June 2011, 13:03
For a simple task like this, writing and reading a file with QFile would be an easy solution.

But perhaps there is some problem in you QSettings based code that could be fixed.

I remember having a problem with QSettings not saving data and needing to add a MySettings->sync() call after the writes. This was in a destructor of a class and I suppose stopping the application was not quite synchronised with what ever QSettings was doing. The same may explain your situation -- simulator is so much slower that it has different problems than the device.

aya_lawliet
23rd June 2011, 14:17
Thank you very much. I will try the sync() first. The QFile is also a good solution to save other data, other than the application state. Thanks for the idea.