Looking for help on synchronizing local events with remote server when online

  • Replies:0
Daniel Maher
  • Forum posts: 3

Apr 5, 2018, 10:26:22 PM via Website

I have a system that generates quotes but it's completely web based at the moment so it pulls live pricing data for every quote. What I'd like is to build an Android application to do the same but to use old pricing until it returns to a Wi-Fi area where it will automatically download any updates to the pricing in the database. I would also like it to save the quote data from the quotes it created offline and upload them to the online database when connected so that other tablets can view these quotes.

  1. For getting the new pricing, is there a native Android function for triggering a function call when connectivity is gained? Should it run every time the user connects or just once per day?

  2. Would I be maintaining a local database on the device and also a remote database on the server? That seems like unnecessary duplication.

  3. How would I store the offline quotes, would I use a local database on the device? I'm guessing I would have to use the salesman ID in the quote number so that it's always unique because I'm going to want to give the customer their quote number before the salesman leaves their home and at that point they won't have any records in the online database to get this quote number so 2 sales people could be trying to synchronize the same row ID in the quotes table. If I prepend the quote number with the salesman ID, it won't conflict and when they get back online they'll always be uploading unique quote ID.

Be the first to answer