After searching the web about a problem I have I found that answer.
in brief, I need to spawn a new process from an Android application, and run a simple C program. I've created simple C program, like the next one:
int main()
{
printf("This is the message before sleep() function\n");
while(1){
Sleep(1000);
}
printf("This is the message after 1 second");
return 0;
}
Iv'e complied the C program with Cygwin with the next command (gcc myProgram.c -o myProgram).
Iv'e put that file in the assest folder and I copied it at the begining of the program to the internal device memory to the folder "data/data/packageName/files/myProgram"
.
Now I want to execute the program, and when I will check, adb shell -> ps I want to see two process with the same name, but I can't find it.
I am trying to run the program like this:
Runtime.getRuntime().exec("chmod 755 data/data/packageName/files/myProgram");
This is not working, I can't find two process, and I don't know if this is the right way.
What I'm doing wrong?
Thanks.