Thank for the link.
I think I have to use "getUidRxBytes" and "getUidTxBytes". But: How do I get the UIDs for all installed packages by PackageName?
If I do it this way I have to write the complete logic for counting WiFi- and Mobile-Traffic per App. If I'm right the OS resets the counters at each reboot. So I have to request the stats each second or minute with a service.
Isn't it possible to ask the os-integrated stats as show in the screenshot in first post?