6

I am working on the application, which will detect the files which are being transmitted using WIFI/Bluetooth/other way. It will also detect the application which is doing this action.

If I want to detect the transmission of files then what will be the best approach?

I was thinking that it could be achieved by a broadcast receiver for the action Intent.ACTION_SEND. But then I come up with @CommonsWare's answer for this question.

How it will be achieved in my case?

Community
  • 1
  • 1
Swapnil Sonar
  • 2,232
  • 2
  • 29
  • 42

1 Answers1

0

All applications are sandboxed in Android, so there is limited information you can get from external apps regarding what they are doing. This is by design and would be terrible if this was all exposed. But that's not to say you can't glean some information from them. You could view data being sent over a network using the TrafficStats API's. So you could continuously poll these APIs for all UIDs and see which uid's have updated tx and rx bytes. This would give you an idea of how/when different applications are sending data over a network. This will not give you access to specific files information.

Sample code to get all uids taken from here.

final PackageManager packageManager = getPackageManager();
List<ApplicationInfo> installedApplications = 
   packageManager.getInstalledApplications(PackageManager.GET_META_DATA);

for (ApplicationInfo appInfo : installedApplications)
{
    Log.d("OUTPUT", "Package name : " + appInfo.packageName);
    Log.d("OUTPUT", "Name: " + appInfo.loadLabel(packageManager));
} 

Traffic stats API is found here.

Not sure how this would be possible over bluetooth. This of course is different if you actually built the other applications you are trying to monitor.

Community
  • 1
  • 1
Dave
  • 3,178
  • 5
  • 28
  • 44