• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Listening socket connection

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Rancher
Posts: 43076
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic