Sha256: 2bd1e15959dada684e1ecb8e1fc8946687e4c60a7740fbd52d89ed568a07a49d

Contents?: true

Size: 950 Bytes

Versions: 18

Compression:

Stored size: 950 Bytes

Contents

//#include "rhodes/JNIRhodes.h"
#include <rhodes.h>
#include <android/log.h>
#include <common/RhodesApp.h>
#include <logging/RhoLogConf.h>
#include <stdlib.h>


#define logging_enable false

static char barcode_result[16000];

extern "C" const char* rho_barcode_barcode_recognize(const char* filename) {
    JNIEnv *env = jnienv();
    jclass cls = rho_find_class(env, "com/rhomobile/barcode/Barcode");
    if (!cls) return NULL;
    jmethodID mid = env->GetStaticMethodID( cls, "recognize", "(Ljava/lang/String;)Ljava/lang/String;");
    if (!mid) return NULL;

    jstring objFilename = env->NewStringUTF(filename);
    jstring res = (jstring)env->CallStaticObjectMethod(cls, mid, objFilename);
    env->DeleteLocalRef(objFilename);

    if (res == NULL) {
         return NULL;
    }

    const char* code = env->GetStringUTFChars(res,0);
    strcpy(barcode_result, code);
    env->ReleaseStringUTFChars(res, code);

    return barcode_result;
}

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rhodes-3.0.2 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.2.beta.1 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.1 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.1.beta.8 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.1.beta.7 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.1.beta.6 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.1.beta.5 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.1.beta.4 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.1.beta.3 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.1.beta.2 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.0 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.0.beta.7 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.0.beta.6 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.0.beta.5 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.0.beta.4 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.0.beta.3 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.0.beta.2 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp
rhodes-3.0.0.beta.1 lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp