This shows you the differences between two versions of the page.
plugins:building_an_apk [2017/03/08 20:25] 118.171.2.174 [Using a build.json file] |
plugins:building_an_apk [2018/12/30 13:28] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Building an APK ====== | ||
- | The DroidScript ApkBuilder plugin allows you to export your apps to standard Android Package files (APK files). You can then distribute your apps to your friends or upload your them to Google Play for the whole world to try! | ||
- | ===== Usage ===== | ||
- | Once the ApkBuilder plugin is downloaded, you can create APK files by long pressing on your app icon in DroidScript and selecting the 'Build APK' option. | ||
- | ===== File paths ===== | ||
- | It is important to use relative file paths in your JavaScript source code to load images, sounds and external scripts etc, because these files are copied into the APK file as internal assets during the build process. Remember the **"/ | ||
- | |||
- | So you should do this: | ||
- | < | ||
- | not this: | ||
- | < | ||
- | ===== Extracting assets ===== | ||
- | If your app is running a web server or streaming video from assets, then you will need to extract these assets from your APK to the internal sdcard when your app is first run. These assets can then be served/ | ||
- | |||
- | Another reason you might want to extract assets to the device' | ||
- | ===== Using a build.json file ===== | ||
- | If you create a file called ' | ||
- | < | ||
- | { | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | </ | ||
- | Note: This file is optional and not required for building APKs | ||
- | |||
- | If you release your app on Google Play, the ' | ||
- | |||
- | DroidScript uses a simplified permissions model and scans your code looking for the required Android permissions, | ||
- | |||
- | See the [[https:// | ||
- | |||
- | The **' | ||
- | |||
- | If you want your app to handle certain types of file when the user tries to open them or use the 'Share via' option, then the **' | ||
- | |||
- | See the **' | ||
- | |||
- | The **' | ||
- | |||
- | Typical build.json file:- | ||
- | < | ||
- | { | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | </ | ||