Connecting to a remote server using RAS
As technology progresses, we see that the general direction is in mobile technologies. After all, the whole purpose of a Pocket PC is to perform mobile computing in the palm of your hand. With this in mind, we also need to take considerations in keeping our mobile data connected to the rest of the world.
Imagine a situation where a courier is out and about making deliveries. How can we keep an accurate track of what has been delivered and what needs to be delivered. After all, he’s probably in a van and nowhere near the depot. The solution is a simple one, allow him to access the main server and synchronise the data.
This concept is known as Remote Access Services (RAS) and has been around for quite a while now. But, being an eVB or VB.NET/C# developer for a Pocket PC, this can be somewhat of a difficult challenge to overcome.
A solution provided by Sapphire Solutions (http://www.sapphire-solutions.co.uk) has addressed this problem directly. The Pocket PC has many tools built in to allow phone book entries to be entered and managed. But since most of us have a hard enough time teaching end users how to use our program, teaching them how to configure their Pocket PC phone book as well isn’t an ideal situation.
The solution is to allow your application to manage the Pocket PC phone book entries and connect to the remote computer. You can make this an automatic process or have your user press the ‘Connect’ button. It’s up to you!
The Sapphire RAS Utility provided by Sapphire Solutions is a small DLL. You simply link the DLL into your application and have access to all the functions that perform the “task” specific operation. There is no need to spend endless hours trying to understand how it work, just plug it in and play.
There are many features available with the Sapphire RAS Utility. Below is a summary of such features:
Running the demo project
Sapphire have also provided an extensive demo project in both eMbedded Visual Basic and VB.NET that show how to use all the functions of the DLL. You get all the eVB and VB.NET source code which is not only great for experienced programmers to implement the utility, but also great for new programmers to see how the application has been approached.
The latest version of the Sapphire RAS Utility can be downloaded from their web site here:
Once you have downloaded the demo project and unzip it, you will have two versions of the demo project, one for eVB and the other for VB.NET. You will also have a folder containing the different DLLs compiled for the different devices.
Simply select the DLL that matches the device. If you are developing in eVB, then you will need to copy the DLL to the \Windows\ path. Alternatively, if you are developing in VB.NET or C#, you need to copy the DLL to the application path. Check the project settings to see where the demo project will deploy itself to.
Now you are ready to run the demo. Please note the following screenshots have been taken from the VB.NET demo project.
RAS Demo Menu
Dialing a connection
Dial Method Selection - Synchronous/Asynchronous
RAS Dial and Hangup Screen
Set the Dial-Up Configurations
Phone book settings
Set the Phone Book Entries
' Global Connection Handle, Passed Back to Disconnection and Status
Public lConnection As Integer
Public Function RASDialOnly() As Integer
' Set sConnectionEntry equal to your dial-up connection name
' Set SapphireRASLicence with your Licence Number unless Demo DLL
RASDialOnly = sRASDialOnly(sConnectionEntry, sUsername,
sPassword, sDomain, lConnection, SapphireRASLicence)
Public Function RASHangUp() As Integer
RASHangUp = sRASHangUp(lConnection)
Public Function RASStatus() As Integer
RASStatus = sRASStatus(lConnection)
Public Function RASCurrentConn() As String
Dim sConnName As String = Space(40)
RASCurrentConn = StripString(sConnName)
Sapphire Solutions also provide a comprehensive manual for all their utilities. It includes a definition of the DLL function calls, some sample code and FAQs to help with any troubleshooting.
Their manual documentation can be viewed online, downloaded as a HTML document for offline use and even a downloadable Windows help file. These can all be found on their web site at http://www.sapphire-solutions.co.uk/manual.
Licence of use
Sapphire Solutions provide an unlimited use demo version of the Sapphire RAS Utility. While the product will function as normal, the user will receive a popup message stating that it is a demo version. It is great for trying out the utility, checking device compatibility, building it into your application and selling the idea to your customer. Students can use it as well for their college or university projects without having to purchase it either.
Of course though, for commercial applications being developed you will need to get a licence for the utility to make it run without any pop-ups. The good thing about Sapphire’s pricing policy is that it is a one off fee and you or your company can use it as many times as you like for your projects royalty free. There are no royalties required for rolling out your application to your client.
With that you will also get 12 months support via email to their experienced technical team. They also provide upgrades for the latest versions at discounted prices which also extend the 12 months support by a further 12 months.
|Copyright © 2004, CFVB.NET. All Right Reserved.|