OLD | NEW |
1 Android | 1 Android |
2 ======= | 2 ======= |
3 | 3 |
4 Prerequisites | 4 Prerequisites |
5 ------------- | 5 ------------- |
6 | 6 |
7 _Currently we only support building Skia for Android on a Linux or Mac host! In
addition, | 7 _Currently we only support building Skia for Android on a Linux or Mac host! In
addition, |
8 we only use the Mac build for local development. All shipping variants are comp
iled on | 8 we only use the Mac build for local development. All shipping variants are comp
iled on |
9 Linux for performance reasons._ | 9 Linux for performance reasons._ |
10 | 10 |
11 The following libraries/utilities are required in addition to those needed for a
standard skia checkout: | 11 The following libraries/utilities are required in addition to those needed for a
standard skia checkout: |
12 | 12 |
13 * Apache Ant | |
14 * The Android SDK: http://developer.android.com/sdk/ | 13 * The Android SDK: http://developer.android.com/sdk/ |
15 | 14 |
16 ~~~~ | |
17 $ sudo apt-get install ant git | |
18 ~~~~ | |
19 | |
20 Check out the source code | 15 Check out the source code |
21 ------------------------- | 16 ------------------------- |
22 | 17 |
23 Follow the instructions [here](../download) for downloading the Skia source. Mod
ify .gclient to add the following line to | 18 Follow the instructions [here](../download) for downloading the Skia source. |
24 the bottom, and then run gclient sync again: | |
25 | |
26 target_os = ["android"] | |
27 | 19 |
28 Inside your Skia checkout, `platform_tools/android` contains the Android setup | 20 Inside your Skia checkout, `platform_tools/android` contains the Android setup |
29 scripts, Android specific dependencies, and the Android Sample App. | 21 scripts, Android specific dependencies, and the Android Sample App. |
30 | 22 |
31 Setup the Android SDK | 23 Setup the Android SDK |
32 --------------------- | 24 --------------------- |
33 | 25 |
34 To finish setting up the Android SDK you need to download use the SDK to | 26 To finish setting up the Android SDK you need to download use the SDK to |
35 download the appropriate API level. To do this simply go to the directory | 27 download the appropriate API level. To do this simply go to the directory |
36 where you installed the SDK and run the following commands | 28 where you installed the SDK and run the following commands |
(...skipping 19 matching lines...) Expand all Loading... |
56 Custom Android Build Script | 48 Custom Android Build Script |
57 --------------------------- | 49 --------------------------- |
58 | 50 |
59 The android_ninja script is a wrapper for the ninja command (provided by | 51 The android_ninja script is a wrapper for the ninja command (provided by |
60 depot_tools) and is specifically designed to work with the Skia's build | 52 depot_tools) and is specifically designed to work with the Skia's build |
61 system. To use the script you need to call it from Skia's trunk directory with | 53 system. To use the script you need to call it from Skia's trunk directory with |
62 the -d option plus any of the options or arguments you would normally pass to | 54 the -d option plus any of the options or arguments you would normally pass to |
63 ninja (see descriptions of some of the other flags here). | 55 ninja (see descriptions of some of the other flags here). |
64 | 56 |
65 export ANDROID_SDK_ROOT=/path/to/android/sdk | 57 export ANDROID_SDK_ROOT=/path/to/android/sdk |
| 58 export ANDROID_HOME=/path/to/android/sdk |
66 export PATH=$PATH:/path/to/depot_tools | 59 export PATH=$PATH:/path/to/depot_tools |
67 | 60 |
68 cd skia | 61 cd skia |
69 ./platform_tools/android/bin/android_ninja -d nexus_10 # or nexus_7, galaxy_
nexus, etc... | 62 ./platform_tools/android/bin/android_ninja -d nexus_10 # or nexus_7, galaxy_
nexus, etc... |
70 | 63 |
71 The -d option enables the build system to target the build to a specific | 64 The -d option enables the build system to target the build to a specific |
72 architecture such as MIPS (generic), x86 (generic) and ARM (generic and device | 65 architecture such as MIPS (generic), x86 (generic) and ARM (generic and device |
73 specific flavors for Nexus devices). This in turn allows Skia to take | 66 specific flavors for Nexus devices). This in turn allows Skia to take |
74 advantage of specific device optimizations (e.g. NEON instructions). | 67 advantage of specific device optimizations (e.g. NEON instructions). |
75 | 68 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 approach will also produce the noisiest results. | 121 approach will also produce the noisiest results. |
129 | 122 |
130 # <input> is file/dir on device | 123 # <input> is file/dir on device |
131 ./platform_tools/android/bin/android_run_skia --release nanobench --skps <in
put> | 124 ./platform_tools/android/bin/android_run_skia --release nanobench --skps <in
put> |
132 | 125 |
133 Build and run SampleApp | 126 Build and run SampleApp |
134 ----------------------- | 127 ----------------------- |
135 | 128 |
136 The SampleApp on Android provides a simple UI for viewing sample slides and gm i
mages. | 129 The SampleApp on Android provides a simple UI for viewing sample slides and gm i
mages. |
137 | 130 |
138 BUILDTYPE=Debug ./platform_tools/android/bin/android_ninja -d $TARGET_DEVICE | 131 BUILDTYPE=Debug ./platform_tools/android/bin/android_ninja -d $TARGET_DEVICE
SampleApp_APK |
139 | 132 |
140 Then, install the app onto the device: | 133 Then, install the app onto the device: |
141 | 134 |
142 ./platform_tools/android/bin/android_install_app | 135 ./platform_tools/android/bin/android_install_app |
143 | 136 |
144 Finally to run the application you can either navigate to the Skia Samples | 137 Finally to run the application you can either navigate to the Skia Samples |
145 application using the application launcher on your device or from the command | 138 application using the application launcher on your device or from the command |
146 line. The command line option allows you to pass additional details to the | 139 line. The command line option allows you to pass additional details to the |
147 application (similiar to other operating system) that specify where to find | 140 application (similiar to other operating system) that specify where to find |
148 skp files and other resources. | 141 skp files and other resources. |
149 | 142 |
150 ./platform_tools/android/bin/android_launch_app --resourcePath /data/local/t
mp/resources | 143 ./platform_tools/android/bin/android_launch_app --resourcePath /data/local/t
mp/resources |
151 | 144 |
152 By default if no additional parameters are specified the app will use the defaul
t | 145 By default if no additional parameters are specified the app will use the defaul
t |
153 params... | 146 params... |
154 | 147 |
155 --resourcePath /data/local/tmp/skia_resoures | 148 --resourcePath /data/local/tmp/skia_resoures |
156 --pictureDir /data/local/tmp/skia_skp | 149 --pictureDir /data/local/tmp/skia_skp |
157 | 150 |
| 151 |
| 152 Android Studio Support |
| 153 ----------------------- |
| 154 |
| 155 You can also build and run SampleApp (and some other experimental apps) using An
droid |
| 156 Studio. To create the project either select "import project" from the quickstar
t |
| 157 screen or use File -> Open. In both cases you'll need to select ./platform_tool
s/android/apps |
| 158 as the root directory of your project. |
| 159 |
| 160 Finally to be able to build within Android studio it needs to know the path to |
| 161 ninja so you will need to add a properties file and populate it with the path |
| 162 to depot_tools. The syntax and location of that file is... |
| 163 |
| 164 # |
| 165 # file location: ./platform_tools/android/apps/gradle.properties |
| 166 # |
| 167 depot_tools.dir=<path_to_depot_tools> |
| 168 |
| 169 That should be all the setup you need. You should now be able to build and depl
oy |
| 170 SampleApp on ARM, Intel, and MIPS devices. |
| 171 |
| 172 |
158 Build tools | 173 Build tools |
159 ----------- | 174 ----------- |
160 | 175 |
161 The Android platform does not support skdiff at this time. | 176 The Android platform does not support skdiff at this time. |
162 | 177 |
163 Clean up all generated files | 178 Clean up all generated files |
164 ---------------------------- | 179 ---------------------------- |
165 | 180 |
166 make clean | 181 make clean |
167 | 182 |
(...skipping 11 matching lines...) Expand all Loading... |
179 # include additional arguments in quotes (e.g. "dm --nopdf") | 194 # include additional arguments in quotes (e.g. "dm --nopdf") |
180 ./platform_tools/android/bin/android_gdb_native dm | 195 ./platform_tools/android/bin/android_gdb_native dm |
181 | 196 |
182 # SAMPLE APP | 197 # SAMPLE APP |
183 # make sure you've installed the app on the device first | 198 # make sure you've installed the app on the device first |
184 ./platform_tools/android/bin/android_gdb_app | 199 ./platform_tools/android/bin/android_gdb_app |
185 | 200 |
186 When the gdb client is ready, insert a breakpoint, and continue to let the | 201 When the gdb client is ready, insert a breakpoint, and continue to let the |
187 program resume execution. | 202 program resume execution. |
188 | 203 |
OLD | NEW |