https://github.com/scapix-com/example2
Example for Scapix C++ JNI library
https://github.com/scapix-com/example2
cpp cpp11 cpp14 cpp17 java jni jni-android jni-bindings jni-sample jni-wrapper
Last synced: about 2 months ago
JSON representation
Example for Scapix C++ JNI library
- Host: GitHub
- URL: https://github.com/scapix-com/example2
- Owner: scapix-com
- License: other
- Created: 2019-03-13T16:38:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-22T19:35:15.000Z (11 months ago)
- Last Synced: 2025-03-31T18:51:22.422Z (3 months ago)
- Topics: cpp, cpp11, cpp14, cpp17, java, jni, jni-android, jni-bindings, jni-sample, jni-wrapper
- Language: C++
- Homepage: https://www.scapix.com/java_link
- Size: 39.1 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Example for [Scapix JNI](https://www.scapix.com/jni/)
[Scapix JNI](https://www.scapix.com/jni/) is a modern C++20 wrapper for Java Native Interface ([JNI](https://docs.oracle.com/en/java/javase/21/docs/specs/jni/)).
It provides type-safe APIs and automatic resource management, with ZERO runtime overhead compared to manually written JNI code.```cpp
// Generated C++ headers for all JDK/Android classes:#include
#include
#includenamespace jni = scapix::jni;
using namespace scapix::java_api;void example()
{
// 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();
}
```### Install and build this example (Windows, macOS, Linux)
```bash
$ git clone https://github.com/scapix-com/example2
$ cd example2
$ ./build.sh default
```