On Jun 6, 8:34 am, Tony Houghton <[email protected]> wrote:

> 10.0.2.2 is a special address so that apps in an emulator can connect to
> services on the host running the emulator. AIUI your service is running
> on the same Android device as the client so I think you want 127.0.0.1.

Yes.  Not only is the special address the wrong computer, it's unique
to emulators and not available on real devices.  If using a network
socket, loopback is the answer.

However, unless you absolutely have to emulate IP networking, it may
be preferable to use a unix-domain socket rather than a network one.
This will remove the requirement that any apk using it carry internet
permission, while keeping many of the semantics comparable.

While unix domain sockets aren't the first choice for IPC within
android (that would be Binder) they definitely are used within android
itself, for example the connection between the adb daemon and a
debuggable app process which makes java debugging possible is done via
a unix socket.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to