Thursday, May 5, 2011

synchronizing objects ID in app & web database?

Hi,

We have an Android app and a Web Service. We want to download part of the places objects to the mobile. The user will be able to download more of a certain city. Because of that we need to save the city_id of the web in the mobile database. We've thought on two options:

  • Each database will have it own primary IDs, but we will save the Web Primary ID in the mobile too (so we can ask to the webservice for more info). That's the easiest option.
  • The mobile table will not autoincrement and the objects will have the same IDs as in the web.

Which one (or another) do you think is the best approach?

thanks!

From stackoverflow
  • Use the IDs from the server - they are valid unique identifiers, and there's nothing particularly special about autoincrementing.

    fesja : thanks, i will do it that way; it's more consistant

0 comments:

Post a Comment