Lines Matching full:your
42 You should try to run your sync adapter based on a schedule or as the indirect result of some
43 event. For example, you may want your sync adapter to run on a regular schedule, either after a
44 certain period of time or at a particular time of the day. You may also want to run your sync
45 adapter when there are changes to data stored on the device. You should avoid running your
48 providing a refresh button in your user interface.
51 You have the following options for running your sync adapter:
67 implement if you actually store data in your content provider. If you're using a stub
89 If your app transfers data from a server and the server data changes frequently, you can use
91 the server send a special message to a {@link android.content.BroadcastReceiver} in your app.
93 ContentResolver.requestSync()} to signal the sync adapter framework to run your
106 <strong>Note:</strong> If you use GCM to trigger your sync adapter via a broadcast to all
107 devices where your app is installed, remember that they receive your message at
108 roughly the same time. This situation can cause multiple instance of your sync adapter to run
150 * Signal the framework to run your sync adapter. Assume that
163 If your app collects data in a content provider, and you want to update the server whenever
164 you update the provider, you can set up your app to run your sync adapter automatically. To do
165 this, you register an observer for the content provider. When data in your content provider
168 your sync adapter.
173 never called. In this case, you have to provide your own mechanism for detecting changes to
178 To create an observer for your content provider, extend the class
189 {@link android.content.ContentResolver} methods that modify your provider, such as
190 {@link android.content.ContentResolver#insert ContentResolver.insert()}. If there's a match, your
240 * Ask the framework to run your sync adapter.
253 // Get the content resolver object for your app
279 You can run your sync adapter periodically by setting a period of time to wait between runs,
280 or by running it at certain times of the day, or both. Running your sync adapter
281 periodically allows you to roughly match the update interval of your server.
284 Similarly, you can upload data from the device when your server is relatively idle, by
285 scheduling your sync adapter to run at night. Most users leave their powered on and plugged in
287 the same time as your sync adapter. If you take this approach, however, you need to ensure that
288 each device triggers a data transfer at a slightly different time. If all devices run your
289 sync adapter at the same time, you are likely to overload your server and cell provider data
293 In general, periodic runs make sense if your users don't need instant updates, but expect to
299 To run your sync adapter at regular intervals, call
300 {@link android.content.ContentResolver#addPeriodicSync addPeriodicSync()}. This schedules your
303 elapsed time may vary by a few seconds. Also, the framework won't run your sync adapter if the
308 run the sync adapter at a particular time of day. To run your sync adapter at roughly the
349 // Get the content resolver for your app
366 Running your sync adapter in response to a user request is the least preferable strategy
375 doesn't refresh data is an ineffective use of battery power. In general, your app should either