Updated Working for Android (markdown)

master
Ray 2 years ago
parent
commit
4682fa372b
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      Working-for-Android.md

+ 20
- 0
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

Loading…
Cancel
Save