Issue
Consider a song is getting downloaded over my android device via any other application. Or an application is getting downloaded from market. At this stage my device is using mobile network.
Can we write code which will tell data download is in progress from connected network.
Using ConnectivityManager
I can get all active network list. I can get the connected network name as well.
Is connected means streams are ready to do any data transmission or data is transmitting?
How to know at time data is getting downloaded or not?
Solution
Class android.net.TrafficStats
(since API level 8) provides values you are looking for. Via periodic monitoring of values you may conclude something about progress of your (but not separately, if other network communication is pending in parallel) song download.
UPDATE:
Since API level 12 you can get much more detailed info from the same class. A number of useful new functions has been added.
Answered By - Zelimir
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.