Need to run the EB.BARCODE function from another application - browser

We need to run the EB.barcode function from another application. To test this, we built the tutorial provided by Zebra, barcode.html, which references ebapi-modules.js. We put this in a folder called ZebraScanner – just those two files.
When this folder is placed in the /Android/data/com.symbol.enterprisebrowser folder – and the Config.xml file is modified to set barcode.html as the start page – it works perfectly.
When this folder is placed in the /Download folder .. this popup appears:
{"method":"getDefaultID","params":
[],"_rhoClass":"Rho.Barcode","_rhoID
":"0","jsonrpc":"2.0","id":1}
_rhoNativeApiCall:prompt

You can only run the EB.Barcode function from within Zebra's Enterprise Browser. The webview exposed by that product exposes several addJavaScriptInterface calls that are required to execute the logic in ebapi-modules.js, hence why you are seeing that error. If you are trying to scan from within another browser such as Chrome or FireFox then a good approach is to use DataWedge with KeyPress & there is an article explaining how to do that at https://developer.zebra.com/blog/listening-keypress-events-datawedge

Related

Loading a js file valid throughout project Node.js

So, currently I am working on a project in Reactjs that displays a customised modal.
The configuration of the modal is fetched through a configurationLoader.js file.
Since, it is developed in React, my components are divided across different files.
Currently, what I am doing is, loading the full configuration file and extracting the relevant information when required.
What I find redundant is, I have to require the configuration file at the start of every .js file.
Is there a way, where I export my module once, and its valid globally? .i.e. I don't have to require it again and again?
Globals are registered in the window object for the browser and in the global object in node. So you could do:
window.myConfiguration = require('configurationLoader')
or
global.myConfiguration = require('configurationLoader')
depending on where your code will run. Then you should be able to access myConfiguration anywhere in your code without needing to require it.

Spotify Folder in "My Documents"

I'm trying to make an app for Spotify, but I can't get the first step to work. I have made a folder named 'Spotify' in 'My Documents' (I use Windows 7 64 Bit), and made a folder inside it named 'test'. In 'test' I put a file 'index.html' to test if I can open it in Spotify, but I can't. I have a developer account, so that can't be a problem. When I type 'spotify:app:test' in the search bar, I get something like this:
(Note, in the screenshot it says spotify:app:tutorial, but I get the exact same result as displayed when I type spotify:app:test, saying failed to load application)
Also, I use Spotify version 0.8.7.111.gaf8d06ed-245
Spotify cannot load an application unless it has a valid manifest file. The manifest documentation can be found here.
Alternatively, see the Spotify Apps Tutorial app for a working example of a valid manifest. Note that you at least need an identifier, version and name for a manifest to be considered valid.

Actionscript 3.0 Disable navigateToURL

A web game I play on that allows user uploaded content has been having a lot of issues with people using the navigateToURL function to send players to random websites. I was curious if there was a way to disable this function using Actionscript 2 or 3. I have seen a way to do it using the HTML embed but I do not have administrative access to the website.
After doing some more research, I have come up with a solid answer:
You should use a combination of PHP and an executable called swfdump on the server side to validate the user uploaded content.
swfdump is an exe file located in the bin folder of the Flex SDK. You can run it from PHP using exec.
It will read the bytecode of the swf and produce a report. From that you can easily locate which files contain navigateToURL() and reject the files.
I tested a file of my own using swfdump -abc -out myfilereport.swfx myfile.swf
and in that output I found this:
findpropstrict flash.net:navigateToURL
findpropstrict flash.net:URLRequest
pushstring "http://www.plasticsturgeon.com"
constructprop flash.net:URLRequest (1)
callproperty flash.net:navigateToURL (1)
The url I was using was "http://www.plasticsturgeon.com". But it would be far easuer to just eliminate any swf that includes flash.net.navigateToURL. Once you identify tha is present you can generate an error notice to your end user.
So using this method you can find and reject any swf that is using navigate to URL. You could even create a batch to run and invalidate any existing assert with this problem.
More information about using bytecode:
http://code.google.com/p/redtamarin/wiki/ABC
And about decompiling ASbytecode:
http://dougmccune.com/flex/FOTB_Decompiling_Doug_McCune.pdf

SignataureTool doesn't open in Blackberry

I have build an application in BB.It works fine on the simulator.Now i have to run it on device,so i bought keys from RIM,and installed them successfully.I can see three file (2 .csk file and one .db file) being created in the vmTool folder of eclipse.I copy those file in the respective bin folder of the particular OS.When i try to open the SignatureTool via command line,the SignatureTool opens and closes within a blink of an eye.Even i can't do code signing from eclipse,it shows at the bottom right "Packaging Project 99%" and after few seconds my eclipse freezes.So if anyone has encountered the same problem,kindly help.
Quote: http://supportforums.blackberry.com/t5/Java-Development/Cannot-completely-sign-files-Error-Packaging-Projects-99/td-p/1640957
maybe the signing server was not responding in time? check isthesigningserverdown.com and retry signing.

Launch Documents To Go app from third party Blackberry App

I was wondering if it's possible to open doc, xls, pdf, etc files using the "Documents To Go" app from a third party blackberry app.
If you want to open a specific document, since Docs ToGo registers to handle these extensions, you can use the Registry invocation and it will be handled for you. Take a look at the Registry and Invocation classes, the following code will open the document in the given path, Docs ToGo will take over through the Registry:
Invocation invocation = new Invocation(path);
Ragistry reg = = Registry.getRegistry("<your app namespace.class>");
reg.invoke(invocation);
If there is no registered handler for the file content type a ContentHandlerException will be thrown with error code ContentHandlerException.NO_REGISTERED_HANDLER.
Note: there's a small bug in Docs ToGo - closing the document or clicking the back button might not lead the user back to your application.
EDIT: The getRegistry function takes a class fully qualified name e.g. com.softartisans.SilverDust, where SilverDust is the class mane. You can find more info about the use of the Registry in this online book starting page 291 - Client use of Registry. I originally linked to the javax Registry, but it is more useful to look at the BlackBerry Registry docs.
You can use the ApplicationManager class to launch other applications, for example by looking up its descriptor and using runApplication(). You can also pass arguments in the descriptor and if the application looks at arguments passed into it, it may actually open the specified file.

Resources