Code Monkey home page Code Monkey logo

jenny's Introduction

Welcome to my digital garage πŸš€

As a Software Engineer for a decad, I primarily focus on Android development using Java and Kotlin. However, my skillset extends to iOS development, where I've worked extensively with Objective-C. During certain phases of my career, I've delved into low-level projects, exploring Linux kernel features, writing C/C++ code, playing with C++ templates, etc.

Beyond my professional endeavors, GitHub is a delightful sanctuary where I can play with code like a digital garage.

The above sentences are written by LLMs (w/ my help😁)





My awesome projects

Awesome projects I contributed to

Some of them

jenny's People

Contributors

landerlyoung 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

Watchers

 avatar

jenny's Issues

Missing void ** cast

File https://github.com/LanderlYoung/Jenny/blob/master/cpp/jnihelper.h has a missing cast, clang complains on line 596:
from:
_jvm->AttachCurrentThread(&env, nullptr);
to:
_jvm->AttachCurrentThread(reinterpret_cast<void**>(&env), nullptr);

An import leads to compile errors (method not found) using clang/linux on line 23, I can't verify it on Android.
from:
#include <string>
to
#include <cstring>

Patch:

--- jnihelper.h	2023-11-29 07:55:21
+++ new.h	2023-11-29 07:56:09
@@ -20,7 +20,7 @@
 #include <jni.h>
 #include <cassert>
 #include <memory>
-#include <string>
+#include <cstring>
 
 #ifdef __ANDROID__
 #include <pthread.h>
@@ -593,7 +593,7 @@
       JNIEnv* env;
 
       explicit EnvWrapper(JavaVM* _jvm) : jvm(_jvm), env(nullptr) {
-        _jvm->AttachCurrentThread(&env, nullptr);
+        _jvm->AttachCurrentThread(reinterpret_cast<void**>(&env), nullptr);
         assert(env != nullptr);
       }


Generating JNI code fails for classes with same name but different package/outer class

My specific use case is for wrapping a C++ library for Java. I am defining a private nested object named Native within each class that contains all of my external functions.

i.e.

class SomeClass {
  @NativeClass
  private object Native {
     external fun doSomething()
  }
}

class AnotherClass {
  @NativeClass
  private object Native {
     external fun doSomethingElse()
  }
}

When running the kaptKotlin task, the JNI code generation fails due to java.lang.reflect.InvocationTargetException (no error message). Running the task with the --info flag shows

error: Jenny failed to process javax.annotation.processing.FilerException Attempt to reopen a file for path $PROJECT_DIR/build/generated/source/kapt/main/jenny/glue/header/Native.h

Because Jenny is generating the JNI file names solely based on the class name annotated with @NativeClass, it does not allow for naming collisions in the case of inner classes or different packages (i.e. com.example.SomeClass vs. com.example.apackage.SomeClass). JNI headers generated using javah or javac -h avoid this by creating headers that include the fully qualified name of the class.

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.