Controlling a USB device from a web application - java

I would like to be able to control a USB device from a web application.
I was hoping to use Adobe Flex but I don't think that Flex can support access to USB devices.
Is this possible using Java applets, or a similar approach using .NET?
Thanks.

I don't think any web client platform will allow this. On purpose.
If you find one that does, I will uninstall from all my machines.

With .NET, you could
Create a WinForm control and host it in IE with an object tag. This requires security settings to be set using CASPOL or ActiveDirectory, but you would have full-trust to the machine after this
http://weblogs.asp.net/spano/archive/2007/09/19/hosting-a-windows-form-control-in-a-web-page.aspx
If there is already a COM object on the machine that does what you need, you can access it via Silverlight with elevated permissions.
http://www.silverlightshow.net/items/Silverlight-4-elevated-permissions.aspx
With Applets, you could do it with a trusted applet.
Using a lot of different technologies, you could create ActiveX objects, plugins or browser extensions to do it.

We successfully connected POS devices with a Flex UI... for this we created a bridge application with Merapi which connects Flex (either Air or Web) with Java, and left the connection with the devices to Java... this was for a controlled environment where we where sure that the client had the bridge configured...
Other option is to try Air 2.0 which allows to execute Native code (e.g. Java) to connect to the devices, and you could release your app in Air or develop a bridge this time in Air instead of Java to connect with the browser app
HTH
Gus

Your question is a little unclear because you did not say what computers the web application is running on, what computer the USB device is on, and what computer is yours.
Depending on the details, one possible solution would be to write a Chrome Packaged App and use Chrome USB API. The app would need to be installed on the computer that has the USB device and then it could present a UI to the user or just connect to a remote server and allow the device to be controlled remotely.

Related

Interacting with a usb smartcard reader/writer (NFC) from Flex

I would like to be able to use a usb SmartCard reader/writer (NFC) using Flex but I cannot find out how to do it.
I know this approach does not seem the most secure, but I know that, for example, you can use with Flex a usb webcam if the users accepts to give that permission to the web application.
To give you a little background info about why I would need this: We have developped a web application which would be deployed in a local network of an enterprise and which server-side part is developped in java and which client side is developped in Flex. I have managed to use the reader/writer from the java part but that obviously is not practical as we can only use the tag reader/writer attached to the physical server. What we need is to be able to give the client the possibility to use the reader/writer connected to his PC.
If needed, I would have total access to the client machines (if I need to give the application any kind of special permissions).
Thanks in advance for any clue you could give me!
You can't do anything in native Air, which would be the runtime that would expose such an API. You can do a native system app (Windows or Mac) and that app leverages two processes that communicate with eachother.
The main process would spawn two processes
Air client
Smart Card Reader writer
So the main app would work as a HUB between the two.
Maybe it's worth to look at a FlashPlayer app that runs in the browser and communicates with a Java Applet via ExternalInterface.

Java control Windows Media Player with Java

I have seen some Java servers which can control WMP with an Android device or such. But how do you make a server that controls WMP?
What do you need for it?
Windows Media Player supports UPnP for server discovering and DLNA for remote controlling.
Say if you want to create a client app (Android or whatsoever using Java) to remote control Windows Media Player:
Use UPnP to discover available WMP server on network with zero configuration.
Use DLNA to remote control available WMP server on network, for example, expose playlist, control volume and etc.
Java library implements UPnP/DLNA: Cling
Hope this make sense.

Mobile to Mobile Remote Access using Android

i am developing an APP in Android which share screen to all android mobile phone connected in a session.
i want to know that android provides any sdk which provides same service like desktop to dektop access as in team View ?
or any Idea, which SDK i have to used?
Thank you.
Smartphones can't directly connect to each others since they are running in different networks. The common way to solve this is an additional server component. All phones need to connect to the server and send their data. The server is pushing this data to other connected clients, probably by using push notifications. In Android Push Notifications are known as C2DM.
Android developers blog:
http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html
Here's another tutorial on the topic:
http://www.zylinc.com/blog-reader/items/c2dm-a-simple-introduction-using-a-java-server.html
I like 2X RDP a lot. It works very well on phone and tablet and connects to the regular Windows RDP server, so don’t have to install anything else on the server machine.

Can a web page access data being sent to a computer via USB

What are the options (or is it possible at all) for a web page (running on a remote server, not localhost) to access a data stream (not video) coming in via the USB port of the local computer?
Ideally this would work cross-platform (Windows, Unix, Mac anyway) and the local computer would not have to download/install anything to make it work (beyond what you can reasonably expect a computer to have)
An embedded Java applet seems the only way, but I'm wondering if there's any other technologies that could do it.
If the restriction is lifted so that the user can install something (basic for non-techies, not setting up a local server running node.js for example) does that make more things possible (Flash?)
You can probably create an ActiveX component to do this. I am not sure if it can be portable on different OS.
I can think of one way that you can interact with the usb port: You would have to set up a socket server on the remote host which would redirect your network traffic to the serial / usb port and vice versa.
This doesn't completely fulfil the requirement, but I think it's the only way to do it in Actionscript

Questions about servers, databases, and android

Ok so I'm trying to develop a server for an android app that I'm developing.
Basically it's an application that needs to connect with other phones through a database system.
I was thinking of using an sql database to store the simple data I need to exchange.
What type of server should I be using?
What language should I be writing the database code in (if besides SQL)?
How do I get the android application to communicate and exchange information with the database?
Is there a type of virtual server I can use to test my app?
The server type and language choices very much depend on your skillset and environment. However, I'd suggest exposing queries to your database either through JSON or XML, and presenting through a web server.
PHP & MySQL are as good a choice as any, as you can run the same code on UNIX, Linux, Solaris, or MacOS servers. Of course, using a J2EE environment with JDBC drivers to a generic server is also a good choice, especially if you need to share any classes between Android and your server.
By 'virtual server' I assume you mean 'virtual handset', in which case the Android emulator in the SDK might be good enough (although it is painfully slow), or just use a real Android device plugged in to your development machine.
Hope this helps,
Phil Lello

Categories