Elaborating a little more
I have ported ushare and upnp for Android. and I want to run this using an front end android application.
So I wrote the app using Android NDK:
in which Source part contains source code for shared lib
jstring Java_com_Android_uShare_
uShare_RunuShare(JNIEnv *env, jobject jobj)
{
if (execl("/system/bin/ushare","ushare",(char*)0) < 0)
{
fprintf(stderr,"\nExec failed\n\n");
return (*env)->NewStringUTF(env, "exec failed !!!!!!!!!!!!!!");
}
else
{
return (*env)->NewStringUTF(env, "uShare is running successfully");
}
and application part contains ::
package com.Android.uShare;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.io.*;
public class uShare extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button btnOk;
final TextView tview;
class clicker implements Button.OnClickListener
{
public void onClick(View v)
{
tview.setText(RunuShare());
}
}
btnOk.setOnClickListener(new clicker());
}
static
{
System.loadLibrary("uShare");
}
public native String RunuShare();
}
when I run it on emulator it crashes and throw exception
Even i tried it for other binaries found in /system/bin it shows same behaviour for all binaries
So probbaly this issue is related to permission. since all binaries have permission (owner root and gropu shell) while app has user app
please guide me on the same.
Is there any other constraint as well
Please guide me on same.
Regards,
Arun