现碰到的问题如下: 在Java层写了一个类代码如下:
public class MeiaPush {
public native int meia_push_init ();
public native int meia_push_set_client_info (String cid, String pwd, String type, String token);
public native int meia_push_get_alarmlist (Object param, int count);
public native int meia_push_exit ();
public int MeiaPushInit ()
{
Log.e ("Yan", "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
meia_push_init ();
return meia_push_set_client_info ("00000000001", "123456", "android", "yan_yan");
}
}
JNI层也实现了。
在其它类中调用MeiaPushInit 这个函数没有问题,
但是在Service类中调用就会出现“java.lang.unsatisfiedlinkerror native method not found”
请问 为什么会出现这个问题, 如何解决。 Service类中和其它类调用JNI函数有什么区别么?
谢谢!