Disclaimer: I am not a RIM expert, but ... there is a key to a possible way to do this on the page that is linked above, where it talks about the transport descriptor.
If you can get a TransportDescripter (accessible from API v5.0.0), you probably know if the data will be routed through GPRS or WiFi (note that this is NOT the same as opening a connection).
If you know this, you can use RadioInfo.GetNumberOfPacketsSent and RadioInfo.GetNumberOfPacketsReceived to calculate the packets that are sent and received when you have a GPRS connection.
Connect
Get TransportDescriptor = GPRS
Receive Packages / Receive
Receive Packages / Receive
WiFi Switches
Receive Packages / Receive Immediately (I)
GPRS packets = packets (I)
GPRS Connection
Receive Packages / Receive Immediately (II)
WiFi packets = packets (II) minus packets (I)
etc.
It only gives an estimate and includes a bit of dirty code. As I said, this is just an assumption from reading the documentation ... I would be interested if someone points out why this method does not work, though.
source share