Skip to content

Repository files navigation

Example2 for Scapix JNI

Scapix JNI is a modern C++20 library for Java Native Interface (JNI). It provides type-safe APIs and automatic resource management, with zero runtime overhead compared to manually written JNI code.

// Generated C++ headers for all JDK/Android classes:
#include<scapix/java_api/java/lang/System.h>
#include<scapix/java_api/java/util/Locale.h>
#include<scapix/java_api/java/text/DateFormatSymbols.h>namespacejni= scapix::jni;
usingnamespacescapix::java_api;voidexample()
{
// call any Java functions from any Java classesauto version = java::lang::System::getProperty("java.version");
auto languages = java::util::Locale::getISOLanguages();
auto zone_strings = java::text::DateFormatSymbols::getInstance()->getZoneStrings();
auto properties = java::lang::System::getProperties();
}

Clone and build (Windows, macOS, Linux)

git clone https://github.com/scapix-com/scapix-jni-example2
cd scapix-jni-example2
./build.sh default

About

Example for Scapix C++ JNI library

Topics

Resources

Stars

10 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages