Issue
How to collects data transferred(upload/download) by mobile internet
on android device from particular moment (date & time) and display it above status bar across the screen..
Solution
private final Runnable mRunnable = new Runnable() {
public void run() {
TextView RX = (TextView)findViewById(R.id.RX);
TextView TX = (TextView)findViewById(R.id.TX);
long rxBytes = TrafficStats.getTotalRxBytes()- mStartRX;
RX.setText(Long.toString(rxBytes));
long txBytes = TrafficStats.getTotalTxBytes()- mStartTX;
TX.setText(Long.toString(txBytes));
mHandler.postDelayed(mRunnable, 1000);
}
}
Answered By - Android
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.