I have in hands the creation of a Warehouse management system. It's going to be a web application, it's supposed to run on desktops and 10' tablets.
I have never worked with barcode scanners, so my question is how do I interface a barcode scanner with my application?
It's going to be a Java EE 6 application, the web framework to use is still open.
Any experience with similar setups would be greatly appreciated.
Like Alex K. says, most scanners act like keyboards. So handling the input shouldn't be difficult.
I have seen this type of system implemented with an ActiveX control (Ewwww), but I'm assuming you would want this app to be cross-browser.
Java in the browser is as good as dead now, so an applet would most likely be out of the question.
If the scanner sends a key first you could easily bind an event listener using JavaScript to wait for that key and then take the input.
Related
I want some way of creating a dedicated browser window for a browser (chrom-e/ium or firefox). Its content needs to be controlled by a java application (a http call to localhost or better a more direct way of communicating). These two should be bundled together in some way.
A little Background
I want to write a java desktop app but don't want to use Swing or javaFX for the UI. The UI should be written like a one page app and may be ported (at least partially) to the web. I have taken a look at the javafx WebView but would rather have a full fledged browser on my hands. It would also be nice to have a little more control over said browser to send files and read files in a more desktopish way. The only real requirement is that there has to be some java backend behind it and that is has to work offline.
Is something like this possible at all or is it just a pipe dream?
I am very almost a year late for the party, but:
There are a few (that I know) technologies that can help you:
Electron. It is basically what you want, you can use web
technologies to "forge" a desktop app, it's quite well known, I never used it but for what I have read that you can stick almost anything to it's "backend".
JavaFxWebView. There are some really nice ways to use it, you can
even use bootstrap and AngularJs, here is a example (not by me)
Yes it's possible and not all that unusual. Your app can open a default browser as described here -
https://stackoverflow.com/a/10967469/5087125
And then proceed to respond to http requests to your app.
I'm trying to find a developer to write a desktop program that has a pretty basic function. It will notify users, via some dialog (or alert) that some program is about to access the web cam. It could be skype or facetime, or whatever it is, the program should be aware of when the OS's camera is going to be accessed and notify the user. Yes, even if the user is initiating the camera themselves via Skype, the notification would still appear.
My question is this. If I need this program written in Java, is it possible? Obviously I am trying to get it done in Java so it would run on Windows and Mac.
If it is not possible, then it seems as though I'd have to write 2 separate programs on Windows and Mac.
I've come here to get suggestions so that I can connect with the right developers. If you have any suggestions, I'd be happy to hear them. Thanks!
No, you can't write this in Java. Whatever approach you take will be very system-specific (and will probably require enhanced privileges). You could write a JNI library and a Java interface, but it'd probably be about the same amount of trouble to write programs to the native UI libraries.
We have a web application that uses (java/Java EE, Struts, Hibernate) running on Apache tomcat using MySQL as the DB. It has been up and running for quite a few years, so we have a very large pool of data (millions of row).
We need to convert this web app to a mobile application (cross platform, ios, Android), so we've decided to use the Titanium Appcelerator.
I have quite a few concerns before implementation:
I've heard that titanium gives you very good gui, but what about the functionality? What happens when a user clicks a buttons (sending/retrieving data from db)?
Can I use java to handle this??
I have seen examples of interacting through database, but approx all are using PHP as as a server side language, but nobody knows PHP here.
Though our team has some android exp(all sort of JSON, small client app), I am not sure whether it would be helpful.
Out goal is to convert a huge CRUD web app to a cross platform mobile app (I dont want to lose java on the server). Can Titanium appcelerator handle this?
See the App as something separate. It doesn't matter what is on the other end, as long as you get either JSON or XML (or something else if you prefer).
Titanium Appcelerator is a JavaScript tool that can handle (both build-in) JSON and XML.
To answer your questions:
1: Functionality is really good. It cannot be done by Java, but you'll get events (in JavaScript) which handles click/swipe/press/doubleclick etc. Events are always defined in the Documentation. In your case, the button. You can see what events it can handle there, and what properties you can set.
An example from the docs page adding a button, and having the click event.
var button = Titanium.UI.createButton({
title: 'Hello',
top: 10,
width: 100,
height: 50
});
button.addEventListener('click',function(e)
{
Titanium.API.info("You clicked the button");
});
2: Whatever server side language you use, as long as you export usable content (JSON/XML) it is useable by Titanium. It acts like a client. No need to worry there.
3: as answered above, you can do everything with it you want. On server side you only need to write an API which can handle everything.
I hope this will take away your concerns. If you need more help on other questions, just enter a new question on SO and I'll see them pass by.
As already stated by Topener, Titanium is able to handle your requirements. I'd like to point out something more fundamental:
We need to convert this web app to a mobile application (..), so we've decided to use the Titanium Appcelerator.
I'm somewhat surprised by this reasoning, kinda "We needed a car, so we decided to buy a Nissan." Why not a Ford, a Holden or a Porsche?
There are in fact well over 30 technologies claiming to be able to do cross-platform mobile development. I took a deep look at 16 of them during the course of last year for my master's thesis.
I'd suggest you have a look two other technologies as well. Why? You are converting a web app to a mobile app. Why not consider a framework that allows you to write your app's UI using web technologies? You might be able to port some of the existing UI-code, after all.
PhoneGap (free, now owned by Adobe): You implement the entire app in JavaScript, basically as a WebApp, but you get a native, installable binary that can be distributed using the AppStores. Easy to combine with a SenchaTouch HTML5-UI.
Rhodes (free, now owned by Motorola Systems): You implement the UI in HTML5 and the logic in Ruby. Rhodes provides a really good Object-Mapper and Sync capabilities. As you seem to have quite a bit of data to handle, this could provide a significant advantage over Titanium's SQLite Database. Learning the bits of ruby should not cost you more than a week or so.
If you definitely need a native UI, then the AQUA-Framework might be worth a look... but I havn't tested that one.
I’d like to write a simple program that reads a barcode, and makes a note of the barcode as well as the time it was scanned in. Unfortunately I cannot guarantee that the program will have focus when the code is scanned. My understanding is that most barcode scanners act like a keyboard so if the program does not have focus I will have issues. What are the ways to deal with this? Note I’d prefer to code this in Java but I can use .net if the libraries make it easier. I also don’t have a specific scanner in mind so if one model will work better for this that info would be appreciated. I’ve sceen this question but it assumes the app has focus.
Most barcode scanners behave like a keyboard, hence requiring the processing application to have input focus. There are however also barcode scanners, which connect to the serial port or are connected to the USB and offer a virtual serial port interface.
These scanners must be accessed through the real or virtual serial port. For Java, you will need to use the Java Communications API or any other 3rd party library offering access to the serial ports, since this is not possible with the standard Java API.
Most keyboard wedge barcode scanners can be configured (via configuration barcodes) to emulate a keypress of a function key before sending the barcode data. The Windows API includes a RegisterHotkey function to define system-wide hotkeys. When the hotkey is pressed, you could give focus to your program's window to read the barcode.
A Google search reveals a library to register system-wide hotkeys from Java. There's also a question on this site about it, which seems to suggest that there isn't a publicly available library to do so in Mac OS X, though one of the answerers posted a link to such a library he was developing.
After some research on this I implemented as jarnbjo mentioned with a virtual serial port, an example is here (see my answer).
I need some genius advice on this one.
I have a Java Swing application that needs to launch a word processor in order to allow the user to complete some work, and then retrieve the output of that work and evaluate it later.
In my head I am thinking my application can look in the normal places for Open Office or Word executables to see if one of those programs is installed, and then create a process and block the Swing window until that process returns. Is this really the best way to go? Also, how can I pass data back and forth?
I looked into the Open office java bean already, but alas I do not think there is Mac/Linux support.
So, to sum up my question:
is creating a process for the word processor the best way to do this?
how can I pass info between my app and the word processor (more specifically, when they have finished creating their document, how can the Swing app get it)
Thanks,
Ben
Use the open office sdk, which is available for Linux. You might want to use open office in server mode.
You could integrate docx4all (Swing based docx word processor) into your app.