Reputation: 3380
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.
Upvotes: 2
Views: 170
Reputation: 63303
You can register for Broadcast Intents from the system like ACTION_PACKAGE_ADDED
and ACTION_PACKAGE_CHANGED
to 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
Upvotes: 1