Giter VIP home page Giter VIP logo

jnipp's People

Contributors

mitchdowd avatar nico avatar rpavlik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jnipp's Issues

Bulk array actions

Individual get/set element actions involves a lot of JNI back and forth if operating over large arrays. Provide some bulk operations which set whole array segments, and allow "offline" array editing with a sync-up option.

hello, give me a smaple,thx

how to set a object?

for example:

class a {
private String aa;
private int bb;
public static b bobj;
}

class b {.....}

b bobj = new b();

a native method param is b, how to set class a.b = bobj;

jniexport void java_com_daaa_xx(JNIEVN env*, jobject thiz, jobject bobj) {

// in here , how to set class a.b = bobj;

}

Are you aware of JNI Bind?

Hello! I couldn't find a simpler way of messaging you so I thought I would open an issue.

Are you aware of JNI Bind? It looks like you're trying to do a lot of the same things that I am. Some of your open issues are actually already supported.

Just thought I'd reach out.

Support for loading custom jars/classes and/or setting additional JVM options

Hey guys, great project! I've noticed that there is no option to load a custom jar, because JavaVMInitArgs is hidden [1] from the public access. AFAIK, to load a custom jar/class from JNI, it neads to set JavaVMOption. Something like this (not tested):

JavaVMInitArgs args;

JavaVMOption options[1];
options[0].optionString = "-Djava.class.path=path/to/lib1.jar;path/to/lib2.jar"

args.options=options;
args.nOptions=1;

Maybe a version of Vm constructor with JavaVMOption migth do the trick? Like:

Vm::Vm(const char *path, JavaVMOption *opts = nullptr) { ... }

[1] https://github.com/mitchdowd/jnipp/blob/master/jnipp.cpp#L1462

multiple definitions

the header file is likely to produce multiple definitions if used in multiple files

Comprehensive set of unit tests

Should provide as close to 100% test coverage as possible.

Don't leverage off any specific unit test framework, just an application which executes and shows a pass/fail result.

Native support for "byte" data type

Other primitive types are automatically cast (e.g. int, long, char, short) but so far, byte is not automatically cast to a C++ primitive type.

Create a byte_t cast to/from Java.

Returning new objects from C++ to Java

Hi,
First off thanks a lot for this project, it makes working with the JNI much nicer!
Now to my issue: I have a native method that is expected to return a newly generated object (an ArrayList in my case, but the issue is the same for all object types). I successfully created it using your Object::newInstance() helper method and could also modify it as I wanted, but then when I want to return it to Java (the native method returns a jobject, so I used Object::getHandle() as the return value), the calling Java code receives a null pointer. After some digging I found out that this is because just before returning, the Object that I created inside my native method is destroyed, leading to the destructor being called and the JVM reference being deleted. My current workaround is to add a new boolean flag to Object that is set to true if the object should be "persistent" in the JVM, making the destructor return without further actions. But I'm wondering whether there is a better way to do it that I simply didn't discover yet.

0xC0000005 anomaly

when i run,at if (JNI_CreateJavaVM == NULL || JNI_CreateJavaVM(&javaVm, (void**) &env, &args) != 0).
Exception thrown at 0x000001EDD53F03B4 (located in tests.exe) : 0xC0000005: Access conflict occurred at read position 0x0000000000000000.
why???what should i do? please

method call does not support null arg

such as

registerReceiver(null,new IntentFilter())

in jnipp

context.calljni::Object(register_method,NULL,intentFilter)

this will cause compile error

error: call to 'valueArg' is ambiguous valueArg(values, arg);

handle (class method field) Java Exception

    try {
        jni::Class ctx("android/content/Context1");
    } catch (jni::NameResolutionException &e) {
        LOGE("the exception %s",e.what());
    }

in demo,this action will crash ,because java class Context1 can not find

add handleJavaExcption for getClass getxxxField getxxxMethod before throw std::exception

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.