How to synchronize sqlite (internal) database and remote database server in Corona SDK?

Hi All,

 

I would like to save Player’s Score in the SQLite Database(Device’s Database) and then post those data to remote Database Server. I would like to sync the data between sqlite internal database and remote database server when I launch the Corona App on devices.Is it Possible to be done?

 

Thanks a lot!!!..  :) 

John  

This is a very broad question. Have you looked into Corona Cloud? It is really made for this kind of thing. Rolling your own for this kind of thing is not recommended unless you really really have to.

If you indeed decide to roll your own have a look at these excellent tutorials by Rob Miracle : 

http://omnigeek.robmiracle.com/2012/02/23/need-to-save-your-game-data-in-corona-sdk-check-out-this-little-bit-of-code/

http://omnigeek.robmiracle.com/2012/04/15/using-corona-sdk-with-rest-api-services/

Hi @apple_id7.  You’re question is kind of broad in scope to give you a detailed answer for.  @ksan’s blog post suggestions are good starting points, but when thinking this through, on Apple, your app restarts very rarely.  Apple prefers to background your running app and resume it.  You only start up if your app is killed by the the user or the phone reboots.

You are going to need some online hosting/cloud service to manage your online score database.  If you choose to build your own, or even if you use something like Apple Game Center, our Corona Cloud, or something else, I would say whenever you decided to write a score to your local SQLite database you call whatever functions you need to update the live database too.

Thanks…

Hi Ksan, Thanks…

Hi Rob Miracle,

Thanks…

This is a very broad question. Have you looked into Corona Cloud? It is really made for this kind of thing. Rolling your own for this kind of thing is not recommended unless you really really have to.

If you indeed decide to roll your own have a look at these excellent tutorials by Rob Miracle : 

http://omnigeek.robmiracle.com/2012/02/23/need-to-save-your-game-data-in-corona-sdk-check-out-this-little-bit-of-code/

http://omnigeek.robmiracle.com/2012/04/15/using-corona-sdk-with-rest-api-services/

Hi @apple_id7.  You’re question is kind of broad in scope to give you a detailed answer for.  @ksan’s blog post suggestions are good starting points, but when thinking this through, on Apple, your app restarts very rarely.  Apple prefers to background your running app and resume it.  You only start up if your app is killed by the the user or the phone reboots.

You are going to need some online hosting/cloud service to manage your online score database.  If you choose to build your own, or even if you use something like Apple Game Center, our Corona Cloud, or something else, I would say whenever you decided to write a score to your local SQLite database you call whatever functions you need to update the live database too.

Thanks…

Hi Ksan, Thanks…

Hi Rob Miracle,

Thanks…