Play with this demo
In this Activity, you can :
- start a SpiceRequest and observe the result : getting an image displayed ;
- you can monitor the progress of the download both in the activity and in the notification bar.
- cancel a started request ;
- start a request, rotate the device and observe that UI is updated as expected (result is cached by RoboSpice);
- rotate the device as much as you want, even during loading, RoboSpice is robust and will update the results as soon as they arrive;
- a request is sent on demand only. When a new activity is created, cache is used. You only update the Tweets if you want to.
- try to delay the requests by 10 seconds, send a request, leave the activity, come back and you will get the results.
If previous results were stored in cache, you get them, if results are pending, you get them when they arrive.
- send requests as often as you want, requests will be aggregated automatically.
- delay the requests by 10 seconds, send a request, leave the activity, leave the app (by any mean : home button, go to another app, phone call, etc.) and you
will get the results.
- you can even delay the requests by 10 seconds, send a request, kill the app using the task switcher, reopen the app and the activity, and you will get the results,
updated by new ones if a request was pending.
- switch off the phone, reopen the activity, result is displayed as it is cached on disk.
- observe no more memory leak, you can start as many requests as you want.
RoboSpiced basic image downloader.
This Activity uses a RoboSpice request to get a large image from the Internet.
RoboSpice overview
Progress and RoboSpice
On this demo activity, you can observe the progress of the RoboSpice job. RoboSpice provides a nice framework to get notified of progress.
Monitoring RoboSpice requests
On this demo activity, you can observe the progress of the RoboSpice job inside the activity and also via the notification bar. The notification bar
is updated via a custom Android Service (not the SpiceService). This demonstrates that all kind of contexts can use RoboSpice Service, an activity,
a service, an application, a fragment... they all can be aware of requests processing.
Canceling the request
RoboSpice requests can be cancelled easily and this applies to this example as well. RoboSpice basic request classes offer a good IO support
and downloads can be interrupted. This doesn't apply to rest requests sent via Spring Android.
We provide additional examples of RoboSpice capabilities in the next Activities...