韌館-LearnHouse

Archive for 21 7 月, 2022

[Android]JNI呼叫C/C++函式傳遞Int Array參數與返回Array值

上層Java呼叫C/C++的函式

public native void 2DArrayInput(int[][] inputData);
public native int[] returnArray(int[] inputData2);

二維int陣列傳值:

public final static int[][] inputData = {
                                       {0x0226,0x00}
                                      ,{0x0227,0x40}
                                      ,{0x0228,0x00}
                                    };
JniTest jnitest = new JniTest();
jnitest.2DArrayInput(inputData);

Read more...

2022年7 月 posted by admin in 程式&軟體 and have No Comments