How can I start a PC program from a hand held device?

G

Guest

I am using a device that uses Mobile 5 and a wireless connection to a PC via
an access point that connects to the network. My understanding is that
ActiveSync does not run over the wireless and thus I cannot use RAPI.

Is my only option to connect to a SQL Server database from the device and
somehow initiate a PC program from it?

Thanks for any help and guidance,

WayneM
 
P

Paul G. Tobey [eMVP]

So, what you're trying to do is sync or what? There's (it should be
obvious), no open hole in the desktop machine's security which would allow a
remote device to start programs on it! Give us the big picture. Not *how*
you think you need to do something, but *what* you actually are trying to do
(I'm baffled, for example, by your mention of SQL Server!).

Paul T.
 
G

Guest

Paul,

Sorry if my explanation was a bit mixed. I have a hand held scanner that
has WM5 as the OS and it has wireless connectivity to an access point which
give me access to the network. I am trying to set up some integration
between the scanner and the PC to, for example print something when a
specific condition occurs when the scanner program is running.

The scanner program is a VB.Net program that uses the Compact Framework. It
accesses SQL server on the PC, because it uses HTTP as a transport ( I guess)
otherwise there is no connectivity to the PC from the Device. Since I can
get to SQL Server, my thought was to try to execute an xp_cmdshell procedure
which will allow me to make calls to the OS on the PC. My understanding is
that ActiveSync does not run over a wireless connection, so I cannot use
anything that uses ActiveSync as a transport mechanism.

One function I am trying to achieve is to simply print something from the
Device when the user requests it. Of course if I was running in terminal
emulation mode, this would be no problem, but the app is actually running on
the device.

So, this is why I am trying to execute a program on the PC from the Device
to do this and more complex tasks that need to be done on the PC.

If there is a simple way to do this then I would be gratefully to any
suggestions.

Thanks,

Wayne
 
B

Bipin_Expert

Hi,
As per my knowledge MSSQL listen on TCP/IP port 1433. You can try
Socket Programming to perform any tasks on desktop. For this you will
need to create a socket server as Desktop Application which will listen
to a specific port and client will be your WM5 device (which will
connect to desktop socket server). You may send commands recognized by
your desktop socket server and secure communication between your
desktop app & WM5 client using encryption.

Best Regards,
Bipin Kesharwani
(Developer)

Palewar Techno Solutions
Windows Mobile & Palm Development
Nagpur, India

www.palewar.com
 
D

Dick Grier

Hi,

Three potential ways pop into my mind.

1. Create a Web Service on your server (this can access SQL if needed).
Call the Web service from your device.

2. Create a TCPListener program on the Server. Open a TCP/IP session
(System.Net.Sockets) from the device to send and receive data.

3. Execute a stored proceedure on SQL Server (not available on SQL
Express). Write the stored proc in SQL Server to do what you need (TSQL or
managed code written in VB .NET).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
G

Guest

Thank you all for your suggestions and input. I think I will write a sockets
program, as it would be general enough that I could reuse it.

WayneM
 
S

Simon Hart

I think you are over-complicating it by using a raw socket interface if you
have the option of using a Web Service running under a Web Server.
There is an enormous amount of work required to get a socket server
application running well and secure.

The only reasons you would ever want to use sockets over Web Services is for
the following reasons:

1. Control - you can control the packet sizes more easilly than web
services - very usful if your comms is via a slow and cost per packet type
network such as GSM/GPRS etc.
2. Handshaking, much more difficult with Web Services, easy with TCP
sockets.
3. Messages are server driven, so authentication is not quite as important -
in your case they are client driven so security is much more important. Web
Services is easy to implement user authentication.

They are just a few points to consider when making a choice.

Regards
Simon.
 
B

Bipin_Expert

Hi,
As per above discussion, if you are willing to use socket
programming. A quick trick to secure authentication can be to use
encryption and to authenticate unique device user by sending device id
of your WM5 handheld to desktop socket server.
Best Regards,
Bipin Kesharwani
(Developer)

Palewar Techno Solutions
Windows Mobile & Palm Development
Nagpur, India

www.palewar.com
 
R

Rüdiger Kardel

Wayne,
One function I am trying to achieve is to simply print something from the
Device when the user requests it. Of course if I was running in terminal
emulation mode, this would be no problem, but the app is actually running
on
the device.

that's how we solved mobile printing in an network environment:
we have a print-demon running as a service on one (or even some) of the
servers.
The mobile device inserts a new row in a printjob-table, providing
query-information, target printqueue, reportfilename.
The print-demon is scanning the table periodically and prints all new jobs.
done.

Ruediger
 
D

Dick Grier

Hi,

As Simon suggests, a web service is easiest. As you note, TCP/IP is
versatile (it can be done "peer-to-peer," without a server). However,
socket programming will be quite a bit more work.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top