Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I think I have to serialize the entire object graph and then inflate it in the client in order to do that</p> </blockquote> <p>passing large amount of data on an <code>Intent</code> extras and serializing / de serializing it is indeed not a good approach. </p> <blockquote> <p>Because of the overhead on the client, I want the service to notify the clients when data is ready as opposed to the client continuously polling the service</p> </blockquote> <p>since the class responsible for managing your widget extends <a href="http://developer.android.com/reference/android/appwidget/AppWidgetProvider.html" rel="nofollow">AppWidgetProvider</a>, it's automatically extends <code>BroadcastReceiver</code>, so it's simple sending some broadcast directly to it whenever you want, in case you did not know.</p> <blockquote> <p>Is there a better way to ship the data back to the clients? </p> </blockquote> <p>the right approach would be sending broadcast to the clients indicating that new data is available, but not pass the data itself on the intent. instead - store the data on SQLite database (with or without a <code>ContentProvider</code>) when the thread responsible for the network respond parsing it (probably initiated from your Service from your description). then it sends the broadcast that all client will receive and fetch the data from the database. </p> <p>I strongly recommends you to see <a href="http://www.youtube.com/watch?v=xHXn3Kg2IQE" rel="nofollow">this video</a>, explaining how to implement REST servers client and data consuming best approach. </p> <blockquote> <p>Currently my application kicks off a thread that downloads a large amount of data every 15 seconds or so in the background</p> </blockquote> <p>this is not a good idea at all. your user's battery will die very soon, and you'll get very bad reviews when user's will realize that your app draining their battery and consuming all the 3G/4G bandwidth.<br> instead of pulling, you should use <a href="http://developer.android.com/google/gcm/index.html" rel="nofollow">GCM technology</a>. the main idea is that the responsibility to notify when new data is avilible passes from the client side to the server's side, and you won't have to pull all the time to check if there is updates or not. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload