I think the best solution is to use something like wireshark to measure the data used by the various network operations of your app, and then track your data consumption manually. Which is certainly do-able.
I say that because the bugs in TrafficStats are accumulating faster then they are being fixed, and patches are being ignored, so I have the impression that TrafficStats isn't being maintained and should be avoided. JBQ assigned many before he quit, but I believe he was just cleaning up. I realize that Android settings includes data usage stats. I have not investigated but would guess that those are also not reliable (sorry that I'm being lazy but I've already concluded that I would have wasted much less time if I just did my calculations manually).
Here are some of the bugs in trafficstats that I came across (some of the issues are in TraffficStats, some originate in the kernel) while looking at general API's. I have not tried the thread/tag/socket based API's, and don't plan to based on my experience so far, but would be interested to hear if they work better.
In 2.x
Android TrafficStats.getTotalRxBytes() is less than expected
In 3.x
TrafficStats.getMobileRxBytes() and TrafficStats.getMobileTxBytes():
https://code.google.com/p/android/issues/detail?id=19938
TrafficStats APIs do not report UDP traffic even though API level 12 onwards they should have been supported (never fixed):
https://code.google.com/p/android/issues/detail?id=32410
In 4.3, the getUid API's are totally broken, but it sounds like they might be planning to fix this bug. Regardless, if the bug has gone out to Google's partners then I think these API's are useless for the forseeable future.
TrafficStats.getUidRxBytes and getUidTxBytes always return 0 in 4.3:
https://code.google.com/p/android/issues/detail?id=58210
And see this SO post.