Question

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..

Was it helpful?

Solution

enter image description here

 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);
        }
    }

OTHER TIPS

You can learn how to get transferred data on android from here How to obtain amount of transferred data through Wi-Fi from other applications?

and here's the notifications link,

http://developer.android.com/guide/topics/ui/notifiers/notifications.html

just a little google search.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top