https://github.com/bramtechs/hello-jni-ndkbuild-cpp20
Modern C++ on Android without the cmake bloat
https://github.com/bramtechs/hello-jni-ndkbuild-cpp20
Last synced: 8 months ago
JSON representation
Modern C++ on Android without the cmake bloat
- Host: GitHub
- URL: https://github.com/bramtechs/hello-jni-ndkbuild-cpp20
- Owner: bramtechs
- License: mit
- Created: 2024-10-30T17:11:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-30T17:23:47.000Z (over 1 year ago)
- Last Synced: 2025-09-01T06:12:29.448Z (10 months ago)
- Language: Kotlin
- Size: 146 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# hello-jni-ndkbuild-cpp20
Up-to-date [hello-jni](https://github.com/android/ndk-samples) example that uses [ndk-build](https://developer.android.com/ndk/guides/android_mk) instead of cmake.
Made as preparation to ditch cmake entirely for building [my mobile games](https://doomhowl-interactive.com).
*Modern C++ on Android with simple makefiles!*
## Implementation
```c++
#include "jni.h"
#include "android_native_app_glue.h"
#include
#include
extern "C" jstring Java_com_example_myapplication_NativeView_stringFromJNI(JNIEnv *env)
{
std::string msg = std::format("C++20 on {} with {}!", "Android", "ndk-build");
return env->NewStringUTF(msg.c_str());
}
```
