Problem in loading libhello-jni.so

47 views
Skip to first unread message

swapnil kamble

unread,
Aug 27, 2009, 9:19:37 AM8/27/09
to andro...@googlegroups.com
Hi,
   I have sample libhello-jni.so, I am calling that from my android app with following app. But everytime application does loadlibrary it crashes. I have kept that .so in root directory of project. Can somebody help in getting this working ? I pasting my android app code

public class HelloJni extends Activity
{

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);


        TextView  tv = new TextView(this);
        tv.setText( stringFromJNI() );
        setContentView(tv);
    }


    public native String  stringFromJNI();

    static {
        System.loadLibrary("hello-jni"); // fails here
    }
}

Thanks in advance.
--
...Swapnil

|| Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
|| Hare Rama    Hare Rama   Rama   Rama    Hare Hare ||

Rajat Dixit

unread,
Aug 27, 2009, 12:23:14 PM8/27/09
to andro...@googlegroups.com
"I have kept that .so in root directory of project."

Why are you doing this?
lib file should be in the "libs/armeabi" folder of your app.
loadLibrary() loads it from there...
Dont move it from there, and it should work fine.

- Rajat, New York
Reply all
Reply to author
Forward
0 new messages