That works if you start the native program from the Java program. It doesn't 
work if it needs to run independently.

I like Frank's approach. Generally, minimizing the amount of C++ code in an 
application will make things better. In fact, I would argue you never want 
to make a native C++ application, but rather write what you must in C++, 
expose it in small pieces via JNI, and package it as a Java application. In 
some cases, the C++ part might be the major piece, but you'll be better off 
with that thin bit of Java around your C++. Even if you don't see a need 
today, at some point in the future, there may some bit of functionality 
easily provided via Java, that you'll be happy to make use of. 

On Tuesday, March 29, 2011 12:48:44 AM UTC-7, Kostya Vasilyev wrote:
>
> You can just read the native program's standard output. Take a look at Java 
> Process class.
> 29.03.2011 6:20 пользователь "arvind" <[email protected]> написал:
> > Hi All,
> > 
> > I have an NDK application(written in C++) packaged as an executable
> > and deployed in android. I also have a Java apk file in the
> > application layer. Now my NDK app does some processing and outputs a
> > string of data in the format "name = value". Basically the output from
> > NDK looks like this:
> > name1 = value1
> > name2 = value2... Now i want each of these name value pairs to be
> > passed to java application one by one. Currently i am writing the
> > output from NDK to a file in sdcard and the java app reads from the
> > file. But i want to use an IPC mechanism which is devoid of explicit
> > file writing and reading and instead use something like sending and
> > listening to a socket. I am not sure what is the best way of passing
> > message between native code and java. Also i am not using JNI
> > interface as i have some issue with root permissions as the C++ Native
> > code runs as root userid and Java apk runs in application level and i
> > can't combine both of them. Please give me suggestions on how to
> > perform IPC between native code and java apk. I am using android
> > developer phone 1 as the device.
> > 
> > Thanks,
> > aravind
> > 
> > -- 
> > 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
>

-- 
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