{"id":3115,"date":"2020-11-30T11:55:50","date_gmt":"2020-11-30T19:55:50","guid":{"rendered":"https:\/\/portal.staylinked.com\/sl\/kb\/?post_type=ht_kb&#038;p=3115"},"modified":"2021-07-13T16:08:24","modified_gmt":"2021-07-13T23:08:24","slug":"running-third-party-programs","status":"publish","type":"ht_kb","link":"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/running-third-party-programs\/","title":{"rendered":"Running Third Party-Programs"},"content":{"rendered":"\n<p>During the use of an emulation client, it may be important to open another application. This can be anything from calculator to signature capture programs. The most common methods of calling these programs include: use a \u2018program call\u2019 from the StayLinked server, from the connections list as a \u2018remote program\u2019, using a screen formatted to invoke API 12, or within screen recognition under the APIs tab. The format for these programs can vary based on the operating system and their default path.<\/p>\n\n\n\n<h2>Launching and Interacting with Third Party Applications using the SmartTE Client for Android<\/h2>\n\n\n\n<h3>How to call programs on the Android device using SmartTE:<\/h3>\n\n\n\n<p><strong>FROM THE SERVER:<\/strong><\/p>\n\n\n\n<ol type=\"a\"><li>Administrator \u2014&gt; Connection List \u2014&gt; Right-Click \u2014&gt; Commands \u2014&gt; Execute Remote Program\/Command<\/li><li>Configure up to three \u2018Program Calls\u2019 in the Device Group and use the [call#] mnemonic in keyboard maps or scripts.<\/li><li>Embedded StayLinked Host API<\/li><li>Screen Recognition Host API<\/li><li>Host Entry \u2014&gt; Emulation Type \u2014&gt; PGMCALL<\/li><\/ol>\n\n\n\n<p><strong>FROM THE CLIENT:<\/strong><\/p>\n\n\n\n<ol type=\"a\"><li>Use the [intent] mnemonic, from any Graphical scripting element.<\/li><li>Use the [broadcast] mnemonic from any Graphical scripting element.<\/li><li>Use the [execute_program] mnemonic from any Graphical scripting element to run the program configured in the execute_program Client Setting.<\/li><li>Press the configured keycode to run the program as configured in the execute_program Client Setting.<\/li><li>Scan a \u2018Scan2Command\u2019 barcode that contains [intent] or [broadcast] mnemonics.<\/li><\/ol>\n\n\n\n<h3>The four ways to interact with applications in Android<\/h3>\n\n\n\n<h4>You can launch Android Activities using the [intent] command<\/h4>\n\n\n\n<p><strong>What are Activities?<\/strong><\/p>\n\n\n\n<p>In the most simple terms, every screen in every Android application is called an \u2018Activity\u2019. Almost all Android applications have a \u2018Main Activity\u2019 which is the first screen that you see when you launch the application from the App Icon. Most Android applications have more than one Activity (screen) and some of these are also available to be launched.<\/p>\n\n\n\n<p><strong>What is the [intent] command?<\/strong><\/p>\n\n\n\n<p>You can send a command to the client using the [intent] syntax to launch an available Activity (screen) on the device. Using the [intent] command syntax, you can specify which Activity to launch and you can send extra data to the Activity.<\/p>\n\n\n\n<p><strong>What is the syntax for [intent]?<\/strong><\/p>\n\n\n\n<p>[intent], <em>package<\/em>,<em> class, [extra data]<\/em><\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<ul><li>package: This is the package containing the Activity that you want to launch.<\/li><\/ul>\n\n\n\n<ul><li>class: This is the class of the Activity that you want to launch.<\/li><\/ul>\n\n\n\n<ul><li>extra data: You can pass this optional extra data to an Activity that is expecting extra data.<\/li><\/ul>\n<\/div><\/div>\n\n\n\n<p><strong>How does the Activity access the [intent] Extra Data?<\/strong><\/p>\n\n\n\n<p>If the Activity that you are launching wants to access the extra data that is being passed, that Activity can use the Android <em>Intent.getData()<\/em> API to retrieve the extra data.<\/p>\n\n\n\n<p><strong>What Activities are available on my device?<\/strong><\/p>\n\n\n\n<p>As a convenience, the StayLinked SmartTE Client on Android will build for you a special file on first time startup. This special file is named \u2018activities.txt\u2019 and the Android Client will populate this file with all of the available Activities on your device.<\/p>\n\n\n\n<p>Even more convenient, each available Activity is listed with the appropriate [intent] command syntax that can be used to launch that Activity. You can literally cut-and-paste the listed [intent] command from the \u2018activities.txt\u2019 file for use in the product.<\/p>\n\n\n\n<p>If you install more Android Applications after the \u2018activities.txt\u2019 has been generated, then you can delete the \u2018activities.txt\u2019 file, force-close the StayLinked Client and when you relaunch the StayLinked Client, a fresh \u2018activities.txt\u2019 file will be created for you.<\/p>\n\n\n\n<p>Different makes and models of Android Devices will have different Activities installed. The [intent] <em>package<\/em> and <em>class<\/em> that works on some models may not work on other makes or models.<\/p>\n\n\n\n<p>You can view and\/or retrieve the \u2018activities.txt\u2019 file using the \u2018Administrator\u2014&gt;Connections List\u2014&gt;Right-Click\u2014&gt;View\u2014&gt;Remote File\u2019 and enter \u2018activities.txt\u2019 as the remote file name. Then, you can select the \u2018File\u2014&gt; Open Logs Folder\u2019 to access the file.<\/p>\n\n\n\n<p>Example [intent] commands that are available on a Zebra TC77 to launch Activities:<\/p>\n\n\n\n<ul><li>Calculator Activity: [intent],com.android.calculator2,com.android.calculator2.Calculator<\/li><\/ul>\n\n\n\n<ul><li>Camera Activity: [intent],org.codeaurora.snapcam,com.android.camera.CameraActivity<\/li><\/ul>\n\n\n\n<p>Zebra DataWedge Settings Activity: <\/p>\n\n\n\n<ul><li>[intent],com.symbol.datawedge,com.symbol.datawedge.dwSettings<\/li><\/ul>\n\n\n\n<p>Zebra StageNow Activity:<\/p>\n\n\n\n<ul><li>[intent],com.symbol.tool.stagenow,com.symbol.tool.stagenow.main.HomeScreen<\/li><\/ul>\n\n\n\n<p>Zebra Volume Control Configuration Activity: <\/p>\n\n\n\n<ul><li>[intent],com.symbol.zebravolumecontrol,com.symbol.zebravolumecontrol.VolumeControlUI<\/li><\/ul>\n\n\n\n<p><strong>How can I test launching Activities?<\/strong><\/p>\n\n\n\n<p>We recommend that you get your target Android Client connected to your StayLinked Server and into a live session.<\/p>\n\n\n\n<p>Then, use the StayLinked Administrator to access the Connections-&gt;All Connections listing and find your target device.<\/p>\n\n\n\n<p>Right-click on the target device in the Connections List and select the \u2018Commands\u2014&gt;Execute Remote Program\/Command\u2019 menu option.<\/p>\n\n\n\n<p>Type (or paste) the [intent] command syntax into the \u2018Execute Remote Program\/Command\u2019 dialog and press the \u2018Execute\u2019 button.<\/p>\n\n\n\n<p>Make sure your device is awake and in a live session when you follow these testing steps and you should see your desired Activity appear on the device screen.<\/p>\n\n\n\n<h4>You can broadcast Android Intents using the [broadcast] command<\/h4>\n\n\n\n<p><strong>What are Broadcast Intents?<\/strong><\/p>\n\n\n\n<p>Some activities are designed to run in the background on the device and offer services that are accessed by other applications. A common way for applications to access these services in background applications is to broadcast an \u2018intent\u2019 to that background application. The target application running in the background will implement a \u2018broadcast listener\u2019 which has been registered with the Android OS to receive specific intents that other applications can broadcast to it.<\/p>\n\n\n\n<p><strong>Why would I want to broadcast an intent to another background application?<\/strong><\/p>\n\n\n\n<p>Examples of services that are offered by other applications that could be accessed by broadcast intents are:<\/p>\n\n\n\n<ul><li>An application is running in the background which reads a scale. When that \u2018scale\u2019 application receives a specific broadcast intent, it will read the scale and send the weight to the keyboard buffer.<\/li><\/ul>\n\n\n\n<ul><li>An application is running in the background which controls the integrated barcode scanner. When that \u2018scanner\u2019 application receives a specific broadcast intent, it will light up the imager and read a barcode.<\/li><\/ul>\n\n\n\n<ul><li>An application is running in the background which takes and records photos of damaged goods. When that \u2018camera\u2019 application receives a specific broadcast intent, it will prompt the user to take a photo of the damaged goods and then record that photo with extra data that was included in the broadcast intent.<\/li><\/ul>\n\n\n\n<p><strong>What is the syntax for [broadcast]?<\/strong><\/p>\n\n\n\n<p>[broadcast],<em>category<\/em>,<em>action[<\/em>,<em>extra data name=value;extra data name=value;extra dataname=value\u2026]<\/em><\/p>\n\n\n\n<ul><li>category: The category could be a specific value used by the application for the desired service being requested. The application might use the default category of \"android.intent.category.DEFAULT\u201d. Sometimes the application does not use a category at all, so you would just put nothing between the commas. i.e; [broadcast],,<em>action<\/em><\/li><\/ul>\n\n\n\n<ul><li>action: The action will be a specific value used by the application for the desired service being requested.<\/li><\/ul>\n\n\n\n<ul><li>extra data: You can optionally pass one or more \u2018extra data\u2019 name=value pairs to an application that expects extra data for the service being provided.<\/li><\/ul>\n\n\n\n<p><strong>How do I know what Category, Action and Extra Data to broadcast to the Background Application?<\/strong><\/p>\n\n\n\n<p>Since the services provided by background applications using broadcast listeners are not required to be advertised to the Android OS, you will need to review the documentation for the background application to discover the services that are offered via broadcast intents. The documentation should specify the exact Category (if needed), Action and any required Extra Data that are used for the specific services offered.<\/p>\n\n\n\n<p><strong>Example [broadcast] commands that are available on a Zebra TC77 to access background application services:<\/strong><\/p>\n\n\n\n<ul><li>Light up the Zebra Scanner: [broadcast],,com.symbol.datawedge.api.ACTION_SOFTSCANTRIGGER,com.symbol.datawedge.api.EXTRA_PARAMETER=START_SCANNING<br><ul><li>Use the SmartTE Input API to send a Barcode Scan Input to the SmartTE Client: [broadcast],android.intent.category.DEFAULT,com.staylinked.smartte.api.INPUT,com.staylinked.smartte.api.extra.INPUT_TYPE=scan;com.staylinked.smartte.api.extra.DATA=ABC123<\/li><\/ul><\/li><\/ul>\n\n\n\n<p><strong>How can I test broadcasting intents?<\/strong><\/p>\n\n\n\n<p>We recommend that you get your target Android Client connected to your StayLinked Server and into a live session.<\/p>\n\n\n\n<p>Then, use the StayLinked Administrator to access the Connections-&gt;All Connections listing and find your target device.<\/p>\n\n\n\n<p>Right-click on the target device in the Connections List and select the \u2018Commands\u2014&gt;Execute Remote Program\/Command\u2019 menu option.<\/p>\n\n\n\n<ul><li>Type the [broadcast] command syntax into the \u2018Execute Remote Program\/Command\u2019 dialog and press the \u2018Execute\u2019 button.<ul><li>Make sure your device is awake and in a live session when you follow these testing steps and you should be able to see the results of your requested service.<\/li><\/ul><\/li><\/ul>\n\n\n\n<h4>You can use Android reserved action prefixes to launch common activities<\/h4>\n\n\n\n<ul><li>telprompt:&nbsp;&nbsp;&nbsp; Launch the phone dialer activity using a command with this format:<ul><li>telprompt:800-555-1212<\/li><\/ul><ul><li>mailto:&nbsp;&nbsp;&nbsp; Launch the already configured email client and pass the email address using this format:<ul><li>mailto:support@staylinked.com<\/li><\/ul><\/li><\/ul><ul><li>http:&nbsp;&nbsp;&nbsp; Launch the default browser and pass the desired URL using these formats:<ul><li>http:\\\\www.staylinked.com<\/li><\/ul><ul><li>http:www.staylinked.com<\/li><\/ul><\/li><\/ul><ul><li>https:&nbsp;&nbsp;&nbsp; Same as the http: reserved action except this action uses a secure HTTP request using this format:<ul><li>https:\\\\www.staylinked.com<\/li><\/ul><ul><li>https:www.staylinked.com<\/li><\/ul><\/li><\/ul><\/li><\/ul>\n\n\n\n<h4>You can run Android SHELL commands<\/h4>\n\n\n\n<p>Any other command syntax sent to the StayLinked SmartTE Client on Android will be treated as a SHELL command.<\/p>\n\n\n\n<p>SHELL commands on Android are subject to Android OS permissions restrictions and have limited usefulness.<\/p>\n\n\n\n<h2>Returning third-party program data into StayLinked<\/h2>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<p>These clients create a file called <strong>activities.txt<\/strong> when the client starts up. This is a list of the other applications on the device at that time. You must uninstall and reinstall the client to regenerate this file, though needed applications can be called even if they are not in the activities.txt on a particular device.<\/p>\n\n\n\n<p>You can view this file by gathering it from the Administrator\u2019s connections list and right clicking the device. Select View &gt; Remote File &gt; activities.txt to get that client\u2019s local copy.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<h2>Android<\/h2>\n\n\n\n<p><strong>Third-Party Intent Communication<\/strong><\/p>\n\n\n\n<p>Android client can now accept a third-party intent for inter-program communication. This API is an \u2018input\u2019 intent allowing the third-party to submit using one of our standard 5 input types: scan, key, touch\/tap, voice, command, and input.<\/p>\n\n\n\n<p>Action: com.staylinked.smartte.api.INPUT<br>Category: Intent.CATEGORY_DEFAULT<br>String Extra: com.staylinked.smartte.api.extra.INPUT_TYPE<\/p>\n\n\n\n<p>The Extra data String values for com.staylinked.smartte.api.extra.INPUT_TYPE would be one of the following:<\/p>\n\n\n\n<p>\u201cscan\u201d \u2013 Send a SCAN input to the SmartTE Server<br>\u2013 String Extra: com.staylinked.smartte.api.extra.DATA = Barcode Data<br>\u2013 Integer Extra: com.staylinked.smartte.api.extra.SYMBOLOGY = eSP Symbology ID<\/p>\n\n\n\n<p>\u201ckey\u201d \u2013 Send a KEY input to the SmartTE Server<br>\u2013 String Extra: com.staylinked.smartte.api.extra.KEYCODE = 6-digit keycode<\/p>\n\n\n\n<p>\u201cvoice\u201d \u2013 Send a VOICE script to the SmartTE Server<br>\u2013 String Extra: com.staylinked.smartte.api.extra.DATA = Voice Script<\/p>\n\n\n\n<p>\u201ccommand\u201d \u2013 Send a Mnemonic COMMAND to the SmartTE Server<br>\u2013 String Extra: com.staylinked.smartte.api.extra.DATA = Command Script<\/p>\n\n\n\n<p>\u201ctouch\u201d \u2013 Send a Mouse TOUCH Event to the SmartTE Server<br>\u2013 Integer Extra: com.staylinked.smartte.api.extra.ROW = Touched Row<br>\u2013 Integer Extra: com.staylinked.smartte.api.extra.COLUMN = Touched Column<\/p>\n<\/div><\/div>\n\n\n\n<h2>iOS<\/h2>\n\n\n\n<p>Apple uses URL schemes. For example, <a href=\"tel:1-123-123-1234\">tel:1-123-123-1234<\/a> would open the phone and automatically dial the phone number in the link. More information for iOS URL schemes can be found <a href=\"https:\/\/developer.apple.com\/library\/content\/featuredarticles\/iPhoneURLScheme_Reference\/Introduction\/Introduction.html\">online<\/a>.<\/p>\n\n\n\n<h2>Windows<\/h2>\n\n\n\n<p>Windows clients also allow the configuration of one application to be executed from the StayLinked client. This application, is configured by adding a line to the staylink.ini file similar to the example below:<\/p>\n\n\n\n<p>execute_program=000000,[c:\\windows\\myprogram.exe]<\/p>\n\n\n\n<p>For this feature to operate, the device must have the application lockdown feature enabled. The 6 digit key code can be determined using the keyboard test features, and will cause the corresponding key stroke to execute the program specified in the square brackets.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During the use of an emulation client, it may be important to open another application. This can be anything from calculator to signature capture programs. The most common methods of calling these programs include: use a \u2018program call\u2019 from the StayLinked server, from the connections list as a \u2018remote program\u2019,&#8230;<\/p>\n","protected":false},"author":7,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[37],"ht-kb-tag":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Running Third Party-Programs &ndash; StayLinked<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.staylinked.com\/knowledge-base\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Running Third Party-Programs &ndash; StayLinked\" \/>\n<meta property=\"og:description\" content=\"During the use of an emulation client, it may be important to open another application. This can be anything from calculator to signature capture programs. The most common methods of calling these programs include: use a \u2018program call\u2019 from the StayLinked server, from the connections list as a \u2018remote program\u2019,...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/running-third-party-programs\/\" \/>\n<meta property=\"og:site_name\" content=\"StayLinked\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-13T23:08:24+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/#website\",\"url\":\"https:\/\/portal.staylinked.com\/sl\/kb\/\",\"name\":\"StayLinked Knowledge Base\",\"description\":\"Partner Portal Resources and Support\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/portal.staylinked.com\/sl\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/running-third-party-programs\/#webpage\",\"url\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/running-third-party-programs\/\",\"name\":\"Running Third Party-Programs &ndash; StayLinked\",\"isPartOf\":{\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/#website\"},\"datePublished\":\"2020-11-30T19:55:50+00:00\",\"dateModified\":\"2021-07-13T23:08:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/running-third-party-programs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/running-third-party-programs\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/running-third-party-programs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/portal.staylinked.com\/sl\/kb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\/\/portal.staylinked.com\/sl\/kb\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Running Third Party-Programs\"}]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb\/3115"}],"collection":[{"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/comments?post=3115"}],"version-history":[{"count":2,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb\/3115\/revisions"}],"predecessor-version":[{"id":3652,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb\/3115\/revisions\/3652"}],"wp:attachment":[{"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/media?parent=3115"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=3115"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/portal.staylinked.com\/sl\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=3115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}