• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listening socket connection

 
jeet shri
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I am developing an android application in which i need to implement a background service which will will listen the socket connection made by any of the app of device.
in other words i want to capture the event when any app try to make server connection.
and then i want to fetch the destination ip address or domain name.

can any one tell me is this possible in android.
either by SDK or NDk


With thanks
jeet
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope it is not possible on API level! What a security risc this would be - sandboxing, something quite important in Android, would be rendered useless. It may be possible at sytem level (e.g. TCP/IP stack, network driver).
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't call it a security risk - with an explicit permission that the app would need to have (and which the user would need to agree to), it wouldn't be much different from installing apps that can listen to phone calls and SMS, or that have access to calendar and contact details, IMO.

Having said that, I'm nonetheless unaware of such a capability.
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I was a little harsh. And there are legit use cases.

But it would mean that an app can directly control what another one does, by directly interfering with the output/input. This is something the Android designers tried to avoid with the concept of sandboxing, intents and loose coupling. The data objects you name (SMS, phone calls, contacts) are public objects in Android by design. When an app creates files it can create public or private files. I would expect a socket connection to be private, at least by default.

Even for taking screenshots (possibly reading the output of another app) you need an app with root privileges.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic