public class

NetStat

extends Object
java.lang.Object
   ↳ android.os.NetStat

Summary

Public Constructors
NetStat()
Public Methods
static long getMobileRxBytes()
Get total number of rx bytes received through rmnet0 or ppp0
static long getMobileRxPkts()
Get total number of rx packets received through rmnet0 or ppp0
static long getMobileTxBytes()
Get total number of tx bytes received through rmnet0 or ppp0
static long getMobileTxPkts()
Get total number of tx packets sent through rmnet0 or ppp0
static long getTotalRxBytes()
Get the total number of bytes received through all network interfaces.
static long getTotalRxPkts()
Get the total number of packets received through all network interfaces.
static long getTotalTxBytes()
Get the total number of bytes sent through all network interfaces.
static long getTotalTxPkts()
Get the total number of packets sent through all network interfaces.
static long getUidRxBytes(int uid)
Gets network bytes received for this UID.
static long getUidTxBytes(int uid)
Gets network bytes sent for this UID.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public NetStat ()

Public Methods

public static long getMobileRxBytes ()

Get total number of rx bytes received through rmnet0 or ppp0

Returns
  • number of Rx bytes through rmnet0 or ppp0

public static long getMobileRxPkts ()

Get total number of rx packets received through rmnet0 or ppp0

Returns
  • number of Rx packets through rmnet0 or ppp0

public static long getMobileTxBytes ()

Get total number of tx bytes received through rmnet0 or ppp0

Returns
  • number of Tx bytes through rmnet0 or ppp0

public static long getMobileTxPkts ()

Get total number of tx packets sent through rmnet0 or ppp0

Returns
  • number of Tx packets through rmnet0 or ppp0

public static long getTotalRxBytes ()

Get the total number of bytes received through all network interfaces.

Returns
  • the number of bytes received through all network interfaces

public static long getTotalRxPkts ()

Get the total number of packets received through all network interfaces.

Returns
  • the number of packets received through all network interfaces

public static long getTotalTxBytes ()

Get the total number of bytes sent through all network interfaces.

Returns
  • the number of bytes sent through all network interfaces

public static long getTotalTxPkts ()

Get the total number of packets sent through all network interfaces.

Returns
  • the number of packets sent through all network interfaces

public static long getUidRxBytes (int uid)

Gets network bytes received for this UID. The statistics are across all interfaces. The statistics come from /proc/uid_stat. .

Returns
  • byte count
See Also

public static long getUidTxBytes (int uid)

Gets network bytes sent for this UID. The statistics are across all interfaces. The statistics come from /proc/uid_stat. .

Returns
  • byte count
See Also