Version 1.68 The headlines ============= 1. This version has automatic permissions handling and defaults to V26 of the Android API (now required by Google Play for new apps). Apps built with the APK builder included in this release will automatically ask the user for any required dangerous permissions at startup. They will show a blank screen if any of the permissions are not given at startup. You can optionally handle the permissions manually by adding autoPermissions:false to the build.json file (sample below). 2. Added a new app.ExtExec() command which allows you to execute Linux shell commands in the powerful Linux environment provided by the free app called Termux. The Termux app runs as a service and there's almost no limit to what you can achieve with a full blown Linux machine running on your Android device! How about installing git, or nodejs or using ssh or gzip. Try typing 'busybox' at the terminal prompt to see what built-in commands are already available to you (Instructions for using Termux from DS below) 3. I've also added French, German and Russian language options, so you can see menus and samples in your own language. Docs will also be translated once we have the English version finished (it's being worked on) 4. You can now add your own HTML based extensions to WiFi editor (for both left and right tabs). You need to put your (unzipped) extension files in a /sdcard/DroidScript/Extensions folder. I've included two samples in the release folder which demonstrate both local and remotely hosted extension content. (This should also work in the Chromebook editor, but I've not tested it yet) Note: You could create a plugin in install extensions automatically 5. No requirement for a Wifi router anymore, the Wifi IDE now works when phone is running as an access point/hotspot. 6. Using Overlays and 'Chat Heads' are now possible in both apps and background services. Hope you like the changes :) An update will be available on Google Play in the next few hours,but if you want to side-load it right now, then you can get it from here:- http://androidscript.org/apk/DroidScript_168 It will take some time for the new release to propagate across the planet through Google Play, so I won't update the APKBuilder app on Google Play right away.But if you want to build an APK with the latest features right now, then you will have to grab it from the folder above and drop it into your DroidScript/Plugins folder and restart DroidScript (create the Plugins folder if it does not exist) Chromebook Support ================== Quite a lot of work has been done to make sure this version is compatible with Chromebooks. As far as we know DroidScript is only easy way to create Chromebook apps directly on a Chromebook :) We plan to continue improving our support for Chromebooks as these devices are popular in education these days and we believe DroidScript has a part to play in training the next generation of coders. (BTW: The planet needs many more coders than are currently available!) Notes on Overlays ================= Overlays allow you to draw over other apps and create 'Chat Heads' like Facebook or show important information over other apps. Overlays can be created both foreground apps and background services. An example of a ChatHead service is included in the beta release folder. When you create an Overlay object the user will be prompted to give permission but you can also use the app.GetPermission( "overlay" ) method to do it manually. Notes on the Game Engine ======================== This is a new high performance 2d game engine included in this release, however it is still at the beta development phase, so no examples have been included with this release. If you want to get involved in the development and testing of this engine, then please join the Beta forum by sending a request to support@droidscript.org Here is the full list of changes since the last official release:- DS168 - "Install" permission now auto added only when necessary. - "SysWin" permission now auto added when using app.CreateOverlay(). - Fixed permissions problem with Overlays on Oreo. - app.StartApp() can now be used without any params to launch the current app. DS167b1 - app.SetKioskMode() now asks for appropriate permissions when required. - app.GetPermission() now suppports the 'overlay' keyword. - Added app.CreateOverlay() method (Premium only). - Added "Chat Heads" sample (Premium only). - Added 'rawX','rawY',screenX,screenY params to Image and Layout OnTouch callbacks. - Fixed Launcher sample for >= Oreo. - Added app.ChooseAccount() to request user's device email address. - Fixed dodgy chars in docs for CreateSeekBar, CreateSensor, CreateWebServer and CreateWebView. DS166b3 - Fix plugin onActivityResult issue. - Added 'nokeys' option to app.CreateDialog() method. - Added 'nokeys' and 'showkeys' options to app.SetOptions(). - Removed dodgy html characters from some of the docs examples. DS166b2 - List control onclick event params now cope with double quotes. - Fixed recently introduced bug with spinner calling onChange when first shown. - Added code to handle OnActivityResult in DS plugins. DS 166b1 - Fixed Notification SetSmallImage method crashing on API < 23 (now does nothing) - app.GetIPAddress() now works when phone is running as an Access Point. - Wifi IDE can now easily be used when phone is running as Access Point. - File browsing now always enabled for Embedded systems. - Added new !exit command to wifi IDE (useful to kill DS on embedded systems) - Fix bug on GPIO sys.Out() for banana-pi (eg.echo 1 > /sys/class/gpio_sw/PA11/data) - Fixed bugs where some premium features were not being checked. - Added app.SetWifiApEnabled( true, ssid, key ) for Android 6 or older device only. - Added app.IsWifiApEnabled() for Android 6 or older device only. - Fixed bug with app.CreateWizard() not allowing text editing (focus was blocked) - Fixed problem with dark text in Spinner lists on Oreo. - Spinner now copes better with large fonts. - Fixed problem with lists chopping of bottom of text on Oreo. - img.Save() now works after multiple calls to img.Update() are made. - The ReadData() method on the file object is now escaped when using text mode. - List control onclick event params are now JavaScript escaped instead of ^*^ escaped. - app.GetAccounts() and app.GetUser() now request appropriate permissions on Oreo. - Save SPK option now added to menus on Chromebooks. DS 165b1 - Fixed Phone States sample permissions issue for Oreo. - Added SetSmallImage() to Notify component (image should be a single color with alpha). - Updated Notifications sample. DS 165a4 - Added support for BananaPi-M2-Zero (runs in headless mode). - Creating app shortcuts now working on oreo. - Notifications now working on Oreo. - Coarse location permission now requested on oreo when using PhoneState object. - Fixed menu button on Chromebooks. - Tool-tip short descriptions for app.* methods added for WiFi-IDE/Chromebooks. - Added lay.SetTouchThrough() method. DS 165a3 - Fixed the crash on Marshmallow after accepting permissions. - HTML apps are now scanned for permissions before launch in IDE. - When using auto-permissions, apps will not start unless ALL perms are accepted. - Added autoPermissions:true/false option to build.json file. - Added app.IsDebugEnabled(). DS 165a2 - API level 26 now default target (Google Play requirement) - UDP sockets now closed when net.Close() or net.Destroy() is called. - app.CheckPermission( "extsdcard" ) now returns storage uri on success else empty string. - app.CheckPermission() can now take a 'dangerous' perms list ("Storage,Camera,SMS,..."). - app.GetPermission() callback returns a list of un-granted perms when using 'dangerous' perms. DS 165a1 - Added app.ExtExec() command (can now execute commands in Termux!). - Added French, German and Russian language options. - Added extensions facility to WiFi editor (for both left and right tabs) - Fixed Chromebooks menu button. - You can now drop *.obj files onto the Wifi editor file browser. - Fixed SetOnLongTouch() callback failure on Text controls. - Fixed docs failing to copy or run samples. - Added support for PixelBook (untested). - Added 'exact' option to app.SetAlarm (only works for single shot alarms). - Various typos etc fixed in samples (thanks to BareK) - Added Wifi IDE F3 and Shift+F3 for searching for selected word (same as Ctrl+K). - Added Ctrl+L for deleting current line (same as Ctrl+D) - Added Ctrl+G for goto line. DS 164a4 - Fixed scaling bug with re-loading images after calling app.SetDensity. - Enabled Cam/audio + location in WebView and HTML apps ('NoCapture','NoLocate' to disable). - Added app.script() method (async load of local scripts) - Added Angry Birds style game demo for game engine. - Game engine libs now exluded from non-game APK builds. DS 164a3 - Various Game engine updates. - Added app.ExtractPlugins method. - Added obj.Method( name,types,p1,p2,p3,p4 ) access Java via reflection (premium). DS 163a1 - Added Block based editing for DSJ files (still in alpha)! - Added screenshot button to Wifi IDE (screen shots now captured to .edit folder). - Added 'nofocus' option to app.Alert() method (useful for kiosk mode) - Added dlg.IsVisible() method. - Added new app.CreateWizard + new 'Wizard' sample for premium users. - Fixed recent bug with img.SetImage() not allowing image as first param. - Added 'base64' mode to app.WriteFile method (writes a base64 string to raw binary data) - Added app.SimulateScroll( obj,x,y,dx,dy,count,fling ) method, simulates mouse wheel scrolls. - Added app.SimulateDrag( obj,x1,y1,x2,y2,step,pause ) method, simulates mouse drag. - Shortened startup time on Chromebooks. DS 162a2 - Removed jqplot from internal assets, moved jquery to /Sys/Libs. - Removed 'WebView Gauges' and 'WebView Graphs' samples moved to downloadable demos. - Fixed drawer lock/unlock bug. - Enabled mixing of width/height vals with 'FillX', 'FillY' option. - Fixed app.SetScreenMode to remove menus when null/empty string used. - Changed app.SetScreenMode to fire OnConfig. DS 162a1 - Added game engine (alpha)! - Fixed Launcher sample to use android.intent.action.MAIN instead of .VIEW. Simple example of handling permissions manually =============================================== build.json ---------- { autoPermissions: false } javascript ---------- function OnStart() { : : } //Called when user touches our button. function btn_OnTouch() { if( app.CheckPermission("SMS,Camera") ) { app.GetPermission( "SMS,Camera", PermissionResult ) return } app.CreateSMS() app.CreateCameraView() } //Handle result of permissions request. function PermissionResult( ungranted ) { if( ungranted ) app.ShowPopup( "Permission denied!" ) else btn_OnTouch() } Calling Termux scripts from DS ============================== Enable Termux to access sdcard:- Goto Android settings/apps/termux and enable Install termux tasker plugin:- https://f-droid.org/packages/com.termux.tasker/ Create a simlink folder for the termux tasker plugin from termux home dir like this:- mkdir .termux mkdir /sdcard/termux /sdcard/termux/scripts ln -s /sdcard/termux/scripts .termux/tasker To call a termux script from DS:- app.WriteFile( "/sdcard/termux/scripts/hello.sh", "echo Hello $1" ) var err = app.ExtExec( "termux", "hello.sh", "Dave", "hide" ) if( err ) alert( "Termux Error:" + err ) Banana-Pi M2-Zero GPIO example ============================== function OnStart() { //Create a layout with objects vertically centered. lay = app.CreateLayout( "linear", "VCenter,FillXY" ); //Create a text label and add it to layout. txt = app.CreateText( "Banana-Pi GPIO" ); txt.SetTextSize( 32 ); lay.AddChild( txt ); //Create a toggle button. tgl = app.CreateToggle( "GPIO", 0.4 ); tgl.SetMargins( 0, 0.02, 0, 0 ); tgl.SetOnTouch( tgl_OnTouch ); lay.AddChild( tgl ); //Add layout to app. app.AddLayout( lay ); //Create system processing object as super user. sys = app.CreateSysProc("su"); } //Called when user touches our toggle button. function tgl_OnTouch( isChecked ) { if( isChecked ) sys.Out( "echo 1 > /sys/class/gpio_sw/PA6/data\n" ); else sys.Out( "echo 0 > /sys/class/gpio_sw/PA6/data\n" ); } Banana-Pi M2-Zero UART example ============================== function OnStart() { //Create a layout with objects vertically centered. lay = app.CreateLayout( "linear", "VCenter,FillXY" ); //Create a text label and add it to layout. txt = app.CreateText( "Banana-Pi UART" ); txt.SetTextSize( 32 ); lay.AddChild( txt ); //Create a button. btn = app.CreateButton( "Send Serial", 0.4, 0.15 ); btn.SetMargins( 0, 0.05, 0, 0 ); btn.SetOnTouch( btn_OnTouch ); lay.AddChild( btn ); //Add layout to app. app.AddLayout( lay ); //Create system processing object as super user. sys = app.CreateSysProc("su"); } //Called when user touches our 'Send Serial' button. function btn_OnTouch() { sys.Out( "echo hello > /dev/ttyS1\n" ); } Basic Vim1 GPIO example ======================= //Called when application is started. function OnStart() { //Create a layout with objects vertically centered. lay = app.CreateLayout( "linear", "VCenter,FillXY" ); //Create a text label and add it to layout. txt = app.CreateText( "Hello" ); txt.SetTextSize( 32 ); lay.AddChild( txt ); //Create a toggle button. tgl = app.CreateToggle( "Toggle Button", 0.4 ); tgl.SetMargins( 0, 0.02, 0, 0 ); tgl.SetOnTouch( tgl_OnTouch ); lay.AddChild( tgl ); //Add layout to app. app.AddLayout( lay ); sys = app.CreateSysProc("su"); sys.Out( "echo " + 176 + " > /sys/class/gpio/export\n" ); sys.Out( "echo out > /sys/class/gpio/gpio" + 176 + "/direction\n" ); } //Called when user touches our toggle button. function tgl_OnTouch( isChecked ) { if( isChecked ) sys.Out( "echo 1 > /sys/class/gpio/gpio" + 176 + "/value\n" ); else sys.Out( "echo 0 > /sys/class/gpio/gpio" + 176 + "/value\n" ); }