I am trying to develop an app which calls a external program (written in C) using the Runtime.getRuntime().exec method. This program is basically an gstreamer-based RTSP server, and it works good if I run from the Android command prompt. However, when I run the program from the app, I am getting the following error.
Failed to bind socket (Permission denied)
I had given the network access in my AndroidManifest.xml file.
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
I also tried this:
String cmd = "ping localhost";
Runtime.getRuntime().exec(cmd);
For which I got:
ping: icmp open socket: Operation not permitted
I also tried to run an another program from an app (which shows an image on the Android screen - surfaceflinger sink). So, I included android.permission.ACCESS_SURFACE_FLINGER
in the manifest file. However, it wasn't able to display on surfaceflinger sink.
So, I have a feeling that these permissions are not passed on to these external programs. Is there a way to achieve this? I don't want to convert these C-based programs to Java.