Jorge Betancourt | 265e3e1 | 2021-04-08 15:27:13 -0400 | [diff] [blame] | 1 | AndroidKit is an AAR, or Android Library, that compiles Skia's native code, |
| 2 | JNI bindings, and Java wrapper classes into a shared library. |
| 3 | |
Florin Malita | 2a650cc | 2021-04-12 13:38:44 -0400 | [diff] [blame] | 4 | BUILDING |
Jorge Betancourt | 265e3e1 | 2021-04-08 15:27:13 -0400 | [diff] [blame] | 5 | |
| 6 | 1) Through Android Studio |
| 7 | - Start a project by opening skia/platform_tools/android/apps with Android Studio. |
| 8 | - Ensure that you're local.properties file is filled out with paths to your |
| 9 | Skia out directories. It should look like this: |
| 10 | |
| 11 | sdk.dir=[sdk file path] |
| 12 | depot_tools.dir=[depot tools file path] |
| 13 | x86.out.dir=[out file for x86] |
| 14 | x64.out.dir=[out file for x64] |
| 15 | arm64.out.dir=[out file for xarm64] |
| 16 | arm.out.dir=[out file for arm] |
| 17 | |
| 18 | - Click on AndroidKit on the project tree, click Build in the toolbar, and select |
| 19 | " Make Module 'apps.androidkit' " |
| 20 | - The AAR will be under the build/outputs/aar directory. |
| 21 | |
| 22 | 2) Through the terminal |
| 23 | - Run: platform_tools/android/bin/android_build_app -C out/[out_dir] androidkit |
| 24 | - If it builds with no errors, you’ll find the AAR in the out directory you were building from |
| 25 | |
Florin Malita | 2a650cc | 2021-04-12 13:38:44 -0400 | [diff] [blame] | 26 | |
| 27 | LOADING |
| 28 | |
| 29 | Before using AndroidKit classes, client applications must explicitly load the native library. |
| 30 | This is usually accomplished via a static class initializer, e.g. |
| 31 | |
| 32 | public class MyApp { |
| 33 | static { |
| 34 | System.loadLibrary("androidkit"); |
| 35 | } |
| 36 | |
| 37 | ... |
| 38 | } |
| 39 | |