Questions tagged [jni]

The Java Native Interface (JNI) gives both the ability for JVM implementations to run system native code, and the ability for native code to run Java code (by creating new JVM instances). The most common target languages for JNI are C and C++, for which at least the Sun/Oracle JDK implementations provide helper commands (javap, javah).

Filter by
Sorted by
Tagged with
6
votes
1answer
50 views

Design a native video buffer in C++ to be shown on android application and shared with other modules in native space and Java

I'm working on a design for a video buffer in C++ that will be used by many consumers both in the native library space(C++) as well as Java side using JNI. My Idea is the following: Have a buffer ...
2
votes
2answers
92 views

Production-ready comparison between byte-array and ByteBuffer

I want to compare the performance difference between using byte[] and ByteBuffer in Java, which approach I should use in my ...
4
votes
2answers
63 views

Android NDK Low performance

I am trying to write a NDK program for quicksorting an array. However, in my benchmarks C is doing consistently worse than Java, as indicated by my results: Java 1190625 C 1809218 Java 895104 C ...
1
vote
0answers
104 views

A JavaFX for generating beeping sound on Windows via JNI

This is my practice program: a simple dialog box using which a user may specify a frequency of a sinus audio signal, and play it via pressing a button. It contains a GUI: App.java ...
1
vote
1answer
55 views

Optimizing loop - Reducing native calls

I am developing Android-Disassembler. I need to optimize the loop below. It is currectly calling native method for each instructions(about 4 bytes). So this loop will be looped about millions of ...
3
votes
2answers
598 views

Makefile for a small JNI project

So I'm going to publish this small project on GitHub and I thought I'd better do a makefile for it. The source code consists of 1 Java Class 1 Native JNI module written in C 1 stdlib wrapper object ...
4
votes
1answer
67 views

Video frame to Minecraft map colors

I'm still somewhat new to C, so pardon me for any silly mistakes I've made. I'm trying to convert video frames into Minecraft map colors using JNI and ...
6
votes
1answer
558 views

Having fun with JNI: formatting a number

I attempted some (easy) coding with Java Native Interface. This is what I have: six_pack_Neatifier.h: (autogenerated by javah) ...