Lockdown Template - Custom HTML \ Javascript

D
DanT
DHL Supply Chain Management GmbH

Hi, 

Could someone let me know what app the lockdown template opens in? 

I was looking at running some custom HTML and javascript (within <script>... </script>) but it doesn't seem to execute. 

I can run the code in the chrome browser on the mobile device (Samsung tablet) but would prefer to use the lockdown template so  I can utilise the built-in functionality e.g, allowed apps, access to % attributes. 

Appreciate any thoughts. 

Thanks

5 years ago
Android
ANSWERS
MD
Matt Dermody Diamond Contributor
5 years ago

My understanding is that the lockdown is launching an in app WebView generated by whatever is configured as the System WebView implementation. On newer GMS Android devices the System WebView implementation is normally Chrome, but it technically can be configured to be the Android default WebView if Chrome is blacklisted. 

RC
Raymond Chan Diamond Contributor
5 years ago (edited 5 years ago)

Javascripts enclosed within <script>... </script> in kiosk html template work perfectly fine for all the devices I tested in the last few years.  Please check if your problem is specific to particular device model(s)/firmware(s).  If your script fail in all cases, the problem may likely be related to what is in your script and how you call it in your html template.

D
DanT
4 years ago

Hi Raymond, 

Apologies for the delay in responding. 

As I mentioned, in Chrome it works, but using the lockdown template it does not. 

As an example;

- Create an HTML page with the following code;

<!doctype html>
<html>
<head>
<title>JavaScript Text File Download Demo</title>
</head>
<body>
<a href="" id="download">Download</a>
<script>
var fileName = 'myfile.txt';
var fileContent = 'Page content...';
var myFile = new Blob([fileContent], {type: 'text/plain'});

window.URL = window.URL || window.webkitURL;
document.getElementById('download').setAttribute('href', window.URL.createObjectURL(myFile));
document.getElementById('download').setAttribute('download', fileName);
</script>
</body>
</html>

- Copy this file to the device and open in Chrome.  I suspect when you click the download link you will see a file downloaded called 'myfile.txt' in the default download location of the device. 

- If you use the same code in the lockdown template, nothing happens. 

I would like to get this type of scripting working in the lockdown template.   The lockdown template provides easy access to the device information (%imei%, %serial% etc) and still allows to provide limited access to apps. 

Thanks

RC
Raymond Chan Diamond Contributor
4 years ago

html, CSS and javascript have lots of features, and one can easily find many 500+ page books on each area in no time.   Also, they are evolving wth time and implementations.  E.g. an html5 api may work in this version of chrome and not in earlier version or in another browser.

So, using the standard and stable feaures that have been around for many long time has a higher chance of success in your MobiControl kiosk template.  Please remember that MobiControl kiosk template is meant for implementing a secure launcher, not a general-purpose browser. 

Your example code is not a particular good one because it involves WRITING out file to the LOCAL file system, which is always a security concern.   I don't know which Webkit version is being chosen by Soti to implement the kiosk.  That may vary with devices or firmware versions.  But security is always a concern. 

If I were you, I wouldn't waste time to investigate or use this controversial feature.  Instead, I would look for quick, simple and secure workaround.  MobiControl supports using file-sync rule or .pcg package to securely deploy template/data files to local device directory, so I don't think there is no a real need to use code similar to your example in an app launcher in the MobiControl kiosk.  For dynamic kiosk, one can use javascript to READ the deployed template/data files and dynamically change the kiosk layout to be rendered. 

Be prepared to spend countless hours of trial and error on different devices/firmware version to get the know-how.  To make things fit togehter in MobiControl kiosk, you need someone more than a web/graphics designer, as expertise in ever-improving MobiControl and Android is also required.  

Similar Discussions