Skip to content

Latest commit

 

History

89 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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>

namespace jni = scapix::jni;
using namespace scapix::java_api;

void example()
{
    // call any Java functions from any Java classes

    auto 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