diff --git a/Working-for-Android.md b/Working-for-Android.md index 1acb627..4d8bc46 100644 --- a/Working-for-Android.md +++ b/Working-for-Android.md @@ -78,6 +78,26 @@ endif ``` +**WARNING: If compiled project is developed in C++ instead of C, there are additional considerations:** + +To compile the game into a shared library (`libmain.so`) the following flags are required: + +- Compile C with `clang`: `-std=c99 -lc` +- Compile C++ with `clang++`: `-std=c++11 -lc++` + +Add required shared libraries to the generated APK: + +- Compiling in C: +``` + $BUILD_TOOLS/aapt add $__OUTP/$NAME.apk lib/$ABI/libmain.so +``` +- Compiling in C++: +``` + cp $TOOLCHAIN/../../../../sources/cxx-stl/llvm-libc++/libs/$ABI/libc++_shared.so lib/$ABI/libc++_shared.so + $BUILD_TOOLS/aapt add $__OUTP/$NAME.apk lib/$ABI/libc++_shared.so + $BUILD_TOOLS/aapt add $__OUTP/$NAME.apk lib/$ABI/libmain.so +``` + _Step 2:_ To install the APK into connected device (previously intalled drivers and activated USB debug mode on device): %ANDROID_SDK_TOOLS%\adb install simple_game.apk