How to find data usage of newly installed application?
getUidTxBytes(int uid) and getUidRxBytes(int uid) are used to get the data usage, but in case if a new app is installed and using the data, how can I identify that the new app is installed? And also how come I know the newly installed app getting data usage?
I am pretty new to this topic.
You can register for Broadcast Intents from the system like
ACTION_PACKAGE_ADDEDandACTION_PACKAGE_CHANGEDto be notified when new applications are installed or updgraded. The UID of the package is always passed with these Intents as an extra.SDK Docs link for more information.
HTH