User Tools

Site Tools


plugins:building_an_apk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

plugins:building_an_apk [2016/12/22 13:50]
administrator created
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 **"/sdcard/DroidScript"** folder will probably not exist on someone else's mobile device. 
- 
-So you should do this:-   
-<code>img = app.CreateImage( "Img/myface.png" );</code> 
-not this: 
-<code>img = app.CreateImage( "/sdard/DroidScript/MyApp/Img/myface.png" );</code> 
-===== 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/streamed from the there instead, because assets cannot be served or streamed from inside an APK. 
- 
-Another reason you might want to extract assets to the device's internal sdcard, is when you need to modify them in some way or allow the user to modify them at run time. For example you might have a template settings file or database file that should be extracted when the app is first run. You can handle the extraction of assets using the **app.IsNewVersion()** and **app.ExtractAssets()** methods. 
-===== Using a build.json file ===== 
-If you create a file called 'build.json' at the top level of your project, then you will be able to control certain aspects of the build process, such as the 'minSdkVersion' setting in the manifest, which sets the minimum version of Android that your app will run on. 
-<code> 
-{ 
- "manifest" 
- 
- "minSdkVersion" : 18, 
- "targetSdkVersion" : 21, 
- "debuggable" : false, 
- "removePermissions" : "WRITE_EXTERNAL_STORAGE, ACCESS_WIFI_STATE", 
- "homeScreen":false, 
- "pathPattern":".*\\.jpg,.*\\.txt" 
- } 
-} 
-</code> 
  
plugins/building_an_apk.txt ยท Last modified: 2018/12/30 13:28 (external edit)