On 30 June 2017 at 03:58, Dirk Hohndel <[email protected]> wrote:
> So how the heck do I get an int return value out of a JNI call???
>
> I've tried quite a few different variations of this
>
>                         // returns a BluetoothDevice
>                         QAndroidJniObject 
> dev=iterator.callObjectMethod("next","()Ljava/lang/Object;");
>                         if 
> (checkException("Iterator<BluetoothDevice>.next()", &dev)) {
>                                 continue;
>                         }
>                         QAndroidJniObject typeObj = 
> dev.callObjectMethod("getType", "()I");
>
> getType() returns an int. I want to check if this is an LE-only device.
>

untested:

http://doc.qt.io/qt-5/qandroidjniobject.html#callMethod

jint type_jni = dev.callMethod<jint>("getType");
int type_c = (int)type_jni;

^
https://android.googlesource.com/platform/libnativehelper/+/master/include/nativehelper/jni.h#35

lubomir
--
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to