How to add i2c function through android sensor

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to add i2c function through android sensor

1,585 次查看
weishangHsu
Contributor I

Hi!, I using imx515 and 535 processor now, i need to use I2C function. I write a jni libray and it works on android activity. But when i load this .so file and use the function inside the libray in a service. The service always crash and  get "UnsatisfiedLinkError: myi2c" error message. I contact the FAE, he said he doesn't familiar with JNI and suggest me to use android sensor to simulate I2C interface. Is there anybody meet this problem or know how to solve the problem? thank you!

0 项奖励
回复
3 回复数

1,330 次查看
daiane_angolini
NXP Employee
NXP Employee

great ;)

 

thaks for sharing!

0 项奖励
回复

1,330 次查看
weishangHsu
Contributor I

hello Daiane:

        thanks for your reply, the problem is solved. I make a stupid error, i should write the correct jni function define in the .c file:
        jstring Java_+ mypacketname..._+ activity class name+ _( JNIEnv* env, jobject thiz ...)
       {  .....}

        change to

        jstring Java_+ mypacketname..._+ service class name+ _( JNIEnv* env, jobject thiz ...)
       {  .....}
Daiane Angolini said:

 

Do you want to include some other sensor support?

 

or

 

Do you want to create something like i2ctools within an application?

0 项奖励
回复

1,330 次查看
daiane_angolini
NXP Employee
NXP Employee

Do you want to include some other sensor support?

 

or

 

Do you want to create something like i2ctools within an application?

0 项奖励
回复