0

I have developed an iPhone app using Monotouch and am about to do some user testing and run a trial once every 90 minutes on the same task with a different user. Therefore I need to 'zero' the app to avoid biases from the previous user's work. Since the data is stored in SQLite, is there a way to programmatically backup the iPhone data within Monotouch, either to a remote server or to a file persistent on the device?

2
  • I'm not sure if I understand your question. Sounds like chicken-egg: If you want to wipe everything after each test, why do you bother backing data up? And if you want to back data up, why would you then delete it...? Commented Mar 11, 2012 at 12:08
  • basically, I would like to keep the data generated by each user. Just wondering whether I can implement a button in the app that 'resets' the app to its initial status while generating a backup file with the data. Commented Mar 11, 2012 at 12:29

1 Answer 1

2

For backup File.Copy(source, destination) is sufficient. As for where, I'd say in the same location where your db is currently located. (I wouldn't recommend this though.) You will need to ship with the app a copy of the empty database that you copy over when a new user starts using the app. You need to figure out what's the identifier of each user (username, hash of their email address, etc..)

If you want to upload the database, then you can do it via a HttpWebRequest, or ftp/sftp (if you have libraries handy).

My opinion is that you need to:

  1. use 1 database
  2. partition data by user id
  3. each user gets to see his/her own data
  4. encrypt the database if you are storing sensitive data
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.