I am developing metro style app which should read data from external device using serial communication but unfortunately metro apps does not support "Serial and parallel port API ". So i thought to use hyperterminal to read data from serial port and use it in my metro application. Is there any way to access data directly from hyperterminal using c# in metro style app? If no is there any other way to access data from serial port in metro style app?
You cannot make this work with Hyperterminal either. The sandbox in which Store apps operate explicitly defeats any attempt a Store app might make to use a inter-process communication mechanism.
Do ask yourself if it makes sense to publish such an application in the Store. The odds that a user that visits the store will have the required hardware to make your app useful are extremely slim. These kind of apps will stay desktop apps for a long time to come. If the manufacturer of the device sees a market opportunity to get his device operating in store apps then he'll create a Store compatible driver for it. But that's up to them, you cannot do this yourself.
Related
I'm trying to make my store app communication with desktop app through websockets.
I know we can make metro app as a client and do WinRT way of communicating over.
For the desktop server part, i'm planning to write a dll that will contain server code and receive metro texts being sent over.
Can someone please tell if this is possible and how to write server code in a dll and if so should we be using winhttp for wbesockets in server side ?
Windows Store (WInRT) apps are executing in a sandbox which isolates them from network communication with other applications on the local machine (localhost). That being said, this protection can be disabled using CheckNetIsolation.exe. Visual Studio automatically does the same for debugging purposes, allowing you to call e.g. a web service on your local machine during development.
As for the desktop side; to communicate with web sockets client, you can make advantage of WinHTTP. There's a working example on MSDN.
Keep in mind, though, that any application communicating with localhost will not be certified for Windows Store and will require several additional steps to install it:
The Windows Store application package will need to be sideloaded since it won't be published in Windows Store.
Any desktop component it communicates with will need to be installed separately the same way as any other desktop application.
Using CheckNetIsolation.exe loopback exemption will need to be added for the Windows Store app.
If you can avoid it, I definitely suggest you don't try communicating directly with a desktop application from you Windows Store app.
I've been asked to work on a project for Windows 8 where I have to detect:
Type of device inserted to USB port (mass storage drive or android phone or windows phone etc.)
Port in which device was inserted. (if I have 4 USB ports in PC then identify which port received new device)
Detect when the device was ejected from the PC
Are there some managed C# API's that can be used to query or if there are some callbacks that can be subscribes to.
Any help or direction will be very useful.
Thanks
You don't specify whether you are writing a desktop app, or a Modern UI app. If it is the latter, I'm afraid you are going to be out of luck as this level of information is simply not passed down to the app's sandbox.
You may have better luck with a desktop app. I don't have any direct experience of doing what you ask for, but I do remember having read that it may be possible through .NET.
I have a traditional Win32 program which gets some data using WMI (and it cannot be fetched using API available to Metro apps). Now I want to make a tile with part of this information. As I've understood, it's impossible to simply send this data from Win32 program to the Metro application. What's the preferred way to do such thing?
There is no direct app to app communication method. What you want to do can be accomplished in several ways, however. Your Win32 app could write data to a location on the file system that a Metro style has access to. Also, you could synchronize your Win32 app with your Metro style app using the cloud. You need to be careful, however, as this might violate some of the app certification requirements.
If you are simply writing something for yourself (not concerned with publish your app), you might consider taking the functionality that currently have within your desktop app and encapsulating it within a wcf service running on localhost. Metro apps can call wcf services.
One option would be to have your Win32 program create the tile XML and deposit in Windows Azure storage (or really anything accessible via a URI) and then your Windows 8 Store application could subscribe to that tile via a Periodic Notification.
There are some constraints here which may or may not be relevant to your application - like the refresh rate of the tile (discrete periods from 30 minutes to 1 day) and the machine must be connected to the network when the poll from the URL is made.
You might be able to incorporate a background task to do something similar.
I have a local installation of Voxeo's Prophecy platform, and a voice xml application that runs on the voicexml browser of the platform. How can i call the application to listen to the message, without having a sip phone, and without using the voxeo's hosting capability? I just want to call the application at the local installation without using a phone. When i try this from the browser, i just get the xml file containing the dialog.
Why are you trying to start the application without a SIP phone? The developer version of Prophecy comes with a SIP phone that works great for testing and debugging. Are you trying to access the application from a regular telephone or POTS. If that is the case you will need additional hardware, such as a Cisco VoIP Gateway to translate the land-line signal to SIP. There are a number of VoIP Gateways available. Another option is to put Dialogic cards in your server and use a software that translates between SIP and the Dialogic API. If you purchase Prophecy from Voxeo as an appliance there are options they can sell you to achieve this. The advantage of getting this from Voxeo is that they will help configure it, which is not trivial depending upon the type type of telephone lines you are using and whether they are behind a PBX or not.
The telephony/communications interface to Prophecy is SIP so that is the only way to communicate with it. You could use any open source SIP stacks to develop something yourself, but the easiest thing to do is to use a software based SIP phone. It is not like you could just start talking and the VXML app would know what you intended, or if the if the voice input was really intended for the VXML app. You still need to maintain things like sessions and routing to the correct application which is easily handled by a SIP phone. Prophecy is designed for a telephony environment. If you are trying to use it for something like a home automation system, which some people have, I would think you would have to provide some type of SIP front end that is voice activated.
I am looking to use Adobe Air to visualize information coming from the Serial port. Is there a way to do this naively in Air? I'm assuming not.
If this is the case, would my best route be to create a native application that makes the serial port available via a TCP/IP connection then connect to it locally? or would a different socket type be available?
With this solution, is there a way to bundle a native app with an Air app so that the user would have a 1-step solution?
You can't access the serial port from AIR, but this thread links to a library that claims it will shuttle the data across a socket: http://www.extjs.com/forum/showthread.php?t=36825
You won't be able to bundle the native app with the AIR installer, you would have to bundle the AIR app with the native app. In other words -- write a native app, with a native installer that also installs the AIR app.
Once you've got a native app and an installer, you have to ask yourself what the benefit of using AIR is anymore. Especially now that you have to write a client and server to shuttle data back and forth between the two.
Unless there is some feature in AIR that you absolutely must have, you're probably better off with a cross-platform tool set like Mono or Qt that can handle accessing the serial port. (And if you don't need cross-platform, you've got even more options.)