Wednesday, March 5, 2014

develop a single application android wifi traffic statistics


Cattle people know that the development of statistical android wifi single application traffic, looking guidance. The best source to paste it! !<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Looks like it is not a single application statistics, not seen on android. Traffic statistics to all of the traffic.

Reply:
TrafficStats.getUidRxBytes (myuid);
myuid your application all the uid, this can get runing the program gets to
according ActivityManagerCode does not give you details, company code written, can not pull out, probably the first to get uid, then get
according to the method of receiving trafficTrafficStats.getUidTxBytes (myuid); This is to send traffic.
These are the boot commences, the monthly statistics of what you want to write their own methods to save overlay is
Reply:
This is your 2G and 3G traffic statistics, I need wifi traffic statistics, but wifi traffic
each application
Reply:
Here you are just statistics 2G, 3G traffic, wifi traffic problems I need a single application of statistics
Reply:
Here you are just statistics 2G, 3G traffic, wifi traffic problems I need a single application of statistics
Reply:
The reply was deleted at the moderator 2012-07-11 15:01:59

Reply:
static long getMobileRxBytes () / / get the total number of bytes received via Mobile connection, do not include WiFi
static long getMobileRxPackets () / / get total number of packets received Mobile connection does not include WiFi
static long getMobileTxBytes () / / Total number of bytes sent
Mobilestatic long getMobileTxPackets () / / Total number of data packets sent
Mobilestatic long getTotalRxBytes () / / get the total number of bytes accepted, including Mobile and WiFi etc.
static long getTotalRxPackets () / / The total number of packets accepted, including Mobile and WiFi etc.
static long getTotalTxBytes () / / total number of bytes sent, including Mobile and WiFi etc.
The total number of packets static long getTotalTxPackets () / / sent, including Mobile and WiFi etc.
static long getUidRxBytes (int uid) / / Get the number of bytes
acceptance of a network UIDstatic long getUidTxBytes (int uid) / / Get the number of bytes sent
UID of a networkYou go processing algorithms
Reply:
There, that should be included 2g/3g and wifi traffic, as to how to take a single application wifi, which I was careless, did not see the problem, sorry
Reply:
Do you want a single statistic, I have a thought, that judgment is 2g/3g or wifi, set the variable W, power initialization, and then determine if the beginning is wifi state, get the uid flow T, then assigned to the W, until the switch state so far; If cut to 2g/3g on access, but do not add that variable is T, TW was 3g traffic, denoted by G, if you have not switched, that W has remained the same; thereafter if you switch the state, with T (latest)-G = W (latest);
Instead, go to your own logic, I felt very good to achieve, is to spend the time to write judgments
algorithmIf you have any objections raised, maybe I have the wrong way to think of rough
Reply:
Okay, thank you, I try
Reply:
Ninth floor very good idea to try and I thank you!
Reply:
Alas, how to ensure that our statistical process boot on startup, but the process will not be killed. This is very good guarantee. Can not guarantee the accuracy of the statistics from the data.

No comments:

Post a Comment