1

I am new to android programming. I am creating an app that download a file and measure bytes recieved through the application.

I am using thread to do the download and using another thread to measure the bytes recived using getUidRxBytes function.

In the device it is working very well but in emulator getUidRxBytes function is always returning -1.

Pls help me to understand this issue. Thanks in advance.

4

1 回答 1

0

While the Android emulator can do most everything you need for development, there are things it doesn't do. This looks like one of them.

If you check the documentation for your function, it tells you that a return value of -1 means UNSUPPORTED

http://developer.android.com/reference/android/net/TrafficStats.html#UNSUPPORTED

于 2013-03-11T05:28:50.907 回答