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

Next revision
Previous revision
plugins:building_an_apk [2016/12/22 13:50]
administrator created
plugins:building_an_apk [2018/12/30 13:28] (current)
Line 9: Line 9:
 <code>img = app.CreateImage( "Img/myface.png" );</code> <code>img = app.CreateImage( "Img/myface.png" );</code>
 not this: not this:
-<code>img = app.CreateImage( "/sdard/DroidScript/MyApp/Img/myface.png" );</code>+<code>img = app.CreateImage( "/sdcard/DroidScript/MyApp/Img/myface.png" );</code>
 ===== Extracting assets ===== ===== 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. 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.
Line 26: Line 26:
  "homeScreen":false,  "homeScreen":false,
  "pathPattern":".*\\.jpg,.*\\.txt"  "pathPattern":".*\\.jpg,.*\\.txt"
 + }
 +}
 +</code>
 +Note: This file is optional and not required for building APKs
 +
 +If you release your app on Google Play, the 'minSdkVersion' setting will control whether people with older phones can see your app in the store. If your app does not perform well on older versions of Android, then it is usually a good idea to make it unavailable for older phones or you will get lots of negative ratings and people will avoid your app. There may also be features such as Bluetooth 4.0 which are unavailable on older versions of Android.
 +
 +DroidScript uses a simplified permissions model and scans your code looking for the required Android permissions, but you may want more fine-grain control of these permissions, so the 'removePermissions' setting allows you to explicitly remove Android permissions from your APK.
 +
 +See the [[https://developer.android.com/reference/android/Manifest.permission.html|Android SDK docs]] for for a full list of permissions.
 +
 +The **'homeScreen'** setting is only used for creating home screen launchers apps, public kiosks and machine control type apps which totally take over the Android device, so don't use this option unless you know what you are doing!
 +
 +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 **'pathPattern'** setting allows you to specify which file types your app accepts. For example, if you were writing a text editor, then you would use the** *\\.txt** pattern.
 +
 +See the **'Shared Data'** and **'Receive Intent'** samples in DroidScript for demos of how to handle file and text in your app.
 +
 +The **'debuggable'** setting is intended for advanced users and allows your installed app to be debugged via the Android Debug Bridge. This setting defaults to false and should never be set to true in public releases of your app.
 +
 +Typical build.json file:-
 +<code>
 +{
 + "manifest"
 +
 + "minSdkVersion" : 19,
 + "targetSdkVersion" : 21,
  }  }
 } }
 </code> </code>
  
plugins/building_an_apk.1482414608.txt.gz ยท Last modified: 2016/12/22 21:50 (external edit)