Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

scapix-com/example2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

81 Commits

Repository files navigation

Example for Scapix JNI

Scapix JNI is a modern C++20 wrapper 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();
}

Install and build this example (Windows, macOS, Linux)

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

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /