How to call a C/C++ function from Java


Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700

Warning: Invalid argument supplied for foreach() in /data/web/virtuals/20722/virtual/www/blog/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

Java Native Interface (JNI), part of the Java platform, is an interface that enables communication between Java applications running on a Java Virtual Machine (JVM) and native applications or libraries written in other programming languages (e.g. C, C++).

JNI provides improved performance in some low-level tasks (e.g. Math.sqrt (double a)) and enables communication with hardware devices (Bluetooth, Wi-Fi, etc.). However, there is a disadvantage in the loss of platform independence, because such program uses the library compiled for specific operating system.

Continue reading