2013年8月23日星期五

development of statistical single application android wifi traffic

Cattle people know that the development of statistical android wifi single application traffic, looking guidance. Paste best to source out! !
------ Solution ---------------------------------------- ----
you like counting individual, I have a thought, that judgment is 2g/3g or wifi, set the variable W, boot initialization, and then determine if the beginning is wifi state, get the uid flow T, and then assigned to W, until the switching state so far; if cut to the 2g/3g on access, but does not add that variable, that is, T, TW is 3g flow, denoted by G, if you have not switched, that is, W has remained unchanged; thereafter if Toggle the state, with T (latest)-G = W (latest);
On the contrary, your own logic, and I felt very good to achieve, is to spend the time to write judgments algorithm
If you have any objections raised, maybe my approach is wrong, like rough
------ reference ----------------- ----------------------
seemingly not counting individual applications bar, android on not seen. Statistics to all of the traffic flow.

------ reference ------------------------------------ ---
TrafficStats.getUidRxBytes (myuid);
myuid your application all uid, this according to the procedure runing ActivityManager can get access to
code does not give you the details, companies write code, can not pull out, probably first get uid, and then based on that method to get receiving traffic
TrafficStats.getUidTxBytes (myuid); This is to send traffic.
These are the Boot Start of dollars, what you want of January, write a method to save the overlay is
------ reference -------------- -------------------------
you this is a 2G and 3G traffic statistics, I need the wifi traffic statistics, but every one application wifi traffic

------ reference ------------------------------------ ---
you here only statistical 2G, 3G traffic statistics for a single application I need the wifi flow problems
------ reference -------------- -------------------------
you here only statistical 2G, 3G traffic statistics for a single application I need the wifi flow problems
------ reference ---------------------------------------
  This reply was moderator deleted at 2012-07-11 15:01:59

------ reference ------------------------------------ ---
static long getMobileRxBytes () / / get connected via Mobile total number of bytes received, does not include WiFi
static long getMobileRxPackets () / / Get Mobile connections total number of packets received, does not include WiFi
static long getMobileTxBytes () / / Mobile total number of bytes sent
static long getMobileTxPackets () / / Mobile The total number of packets sent
static long getTotalRxBytes () / / get the total number of bytes received, including Mobile and WiFi.
static long getTotalRxPackets () / / total number of packets received, including Mobile and WiFi.
static long getTotalTxBytes () / / total number of bytes sent, including Mobile and WiFi.
static long getTotalTxPackets () / / the total number of packets sent, including Mobile and WiFi.
static long getUidRxBytes (int uid) / / Get the UID of a network number of bytes received
static long getUidTxBytes (int uid) / / Get a network sends the number of bytes of UID
yourself to processing algorithms
------ reference ------------------------------- --------
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
- ---- reference ---------------------------------------
good, Thank you, I try
------ reference ----------------------------------- ----
ninth floor very well thank you for thinking I try!

没有评论:

发表评论