Updated Working for Android (markdown)

Ray
2022-10-10 17:37:06 +02:00
parent 36b4d4b4c8
commit 4682fa372b

@ -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