Trigger event on data access / data receive
<p>I am trying to build an android app that dynamically shows graph of data usage by different apps in device. I have 2 questions: </p>

<p>1) TrafficStats has methods to get getUidTxBytes(int uid), I want to monitor changes as and when it happens, say if there is a app that is running as service and gets data in background, the graph should reflect same. How do you suggest me to do this, do you want me to start a new service for monitoring every single Tx/Rx, I need to run this tool for hours, sure it will drain out battery. Please advise. </p>

<p>2) Is there any other way to know (may be a broadcast as and when there are data changes happening in device because of App). </p>

<p>Thank you for sharing.</p>
