Is there a way to close/kill a running application with the help of MX?

M Michael Stjernborg 3 years 7 months ago
543 1 0

We are using stageNow in order to do various task on a MC18 Android (5.1.1).
One of the MX components we are using is Condition Manager.
If a certain condition is met we would like to close/kill an app. In this case Enterprise Browser 1.5.
Is there a way to close an app with mx? Intent?
 
/Michael

Please Register or Login to post a reply

1 Replies

E Efkan YILMAZ

I had a customer who also needed a way to exit EB.  In this case they needed to exit EB when they started another app from the SOTI launcher,  so we put together a SOTI script to trigger EB to exit when the user pressed the icon for the second app,  but the same method should work for you.  The idea is to use the EB Intent API as the trigger,  and we used DOM injection to add some javascript to the pages to make it work because they did not have the ability to change the existing web app.  If you can change the web app, you could skip the dom injection part and do that right on the webserver.  See the EB docs for details on these features
About Enterprise Browser 1.7 - Zebra Technologies TechDocs

In config.xml,  set up the Intent receiver like this:
           

Set up dom injection in config.xml like this:
myTags.txt and eb-exit.js go into the same folder as config.xml. ebapi-modules.js,eb.intent.js, and eb.application.js would also need to be copied to the device in the same folder as config.xml.  These files can be found on your PC in C:\EnterpriseBrowser\JavaScriptFiles\EnterpriseBrowser\Android

content of myTags.txt below.  This will inject these 4 javacscript files into every page that EB navigates to:

Content of eb-exit.js below.  This sets up the intent API to start listening and the callback will quit EB if EB receives the intent it is looking for.
function intentCB(data){
if(data.action=="Intent.QUITEB"){
EB.Application.quit();
}
}
EB.Intent.startListening(intentCB)

If the above is all configured properly,  you should see EB exit if you send a broadcast intent with the action "Intent.QUITEB".

CONTACT
Can’t find what you’re looking for?