Getting a reference to data collected by a Service from an Activity for visualization purposes
<p>Hello fellow developers,</p>

<p>I am trying to achieve something in Android and I would like some advise on the best practice.</p>

<p>I have created an Activity which can start and stop a Service which collects data.</p>

<p>Instead of simply starting and stopping the Service, the Activity should also display the data collected by the Service.</p>

<p>Here in lies the problem. The data could be quite large so I would like to avoid Serializing and sending it via an Intent. Is it possible to simply get a reference to the data stored in the Service from the Activity?</p>

<p><strong>Simple Example</strong></p>

<p>1) Activity starts</p>

<p>2) Activity starts Service to collect data</p>

<p>3) Activity exists</p>

<p>4) 24 hours pass</p>

<p>5) Activity starts</p>

<p>6) Activity wants to display data collected by Service, but data is quite large.</p>

<p>My question again is simply this. Can the Activity get a reference to the data stored in Service or does the data have to be Serialized and sent from the Service to the Activity using an Intent?</p>

<p>Kind regards,
Cathal</p>
