How to add i2c function through android sensor

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to add i2c function through android sensor

892 Views
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 Kudos
3 Replies

637 Views
daiane_angolini
NXP Employee
NXP Employee

great ;)

 

thaks for sharing!

0 Kudos

637 Views
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 Kudos

637 Views
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 Kudos