How to communicate between native processes

355 views
Skip to first unread message

vick.s

unread,
Oct 4, 2010, 6:17:10 AM10/4/10
to android-ndk
Hello seniors,
i have two processes running in my native code, i need a
communication mechanism between them. I learnt about d-bus and tried
to implement, but it seems ndk does not support d-bus.
Is there any other processes i can use for IPC? If somebody can
provide any materials or tutorial links, it will be very helpful.

Thanks

Chris Stratton

unread,
Oct 4, 2010, 11:39:02 AM10/4/10
to android-ndk
unix domain sockets

Onur Cinar

unread,
Oct 4, 2010, 12:12:10 PM10/4/10
to andro...@googlegroups.com

Hi Vick,

Here is a quick tutorial on Unix IPC:

http://beej.us/guide/bgipc/output/html/multipage/index.html

In order to be safe, I would suggest the following two options first:

1. Plain TCP/IP socket communication between your applications through the loop-back device.  Since networking is officially supported by the NDK, we know that this interfaces will survive.

2. Using AIDL through JNI. Which is probably the safest way.

Best regards,

-onur



--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


---
www.zdo.com

Chris Stratton

unread,
Oct 4, 2010, 5:06:16 PM10/4/10
to android-ndk
On Oct 4, 12:12 pm, Onur Cinar <onur.ci...@gmail.com> wrote:
> In order to be safe, I would suggest the following two options first:
>
> 1. Plain TCP/IP socket communication between your applications through the
> loop-back device.  Since networking is officially supported by the NDK, we
> know that this interfaces will survive.

I would recommend against this, as the application will have to have
internet permission even for local loop back, and users will wonder
why if it is not by nature a networked application.

Using a unix domain socket avoids this. (Android's linux kernel is
modified to place restrictions on the AF_INET family, but not the
AF_UNIX family)

Reply all
Reply to author
Forward
0 new messages