What Design-Pattern would be intelligent in which following Components(simplified) exists:
3 Components
– GUI
– Data fetcher
– Database

I have no Access to the Server in the Internet, its just a Data-Source. The Data which lays in the Internet is always the newer one, the local-Database is just a copy(cache) of the one in the Internet. The GUI can request and update of the local cache, the Service-like-component fetches then asynchronously the newest data, which could take awhile.
The GUI shows only Data from the local Database, which he can fetch synchronously.
So my Question is, what classes would you use for the maybe longterm running Service with Progressbar capabilities ? Are there better Designs for this kind of “problem”? Are there better practices?
On the Service Like Component:
jobIdto indicate a job that is being processed in the backgroundjobId. The implementation of this service could return a status, percentCompleted or any other relevant info that will tell the caller the current status of the update process. The implementation of this method needs to be able to report an incremental progress (such as reporting the incremental store in the local storage) in order to make an accurate progress bar, otherwise the best the UI could do is show the spinning progress bar.AsyncTaskusage which execute update in the background and report to the user when it is finished. If this operation might take a while, you could implement the completion of the update via Android notification bar or push notification.Assuming you have the interface to get the progress of the update, you could utilize the AsyncTask onProgressUpdate to report the progress of the update. The method is specifically designed for that.
Your steps are roughly as follow:
onProgressUpdate. The AsyncTask roughly looks like