# Wednesday, July 20, 2005

How They Beta Test Mappoint Products

Ever wondered how Microsoft test their location products? I mean it's not like you can test them in every possible location. Well two guys in Great Britain are trying to come close by driving the length and breadth of Great Britain passing through key points as they go - They have already covered the furthest South, East and West already. You can track their progress on a special blog and win a copy of Autoroute with GPS receiver if you estimate their mileage.

Autoroute 2006 (European version of Streets & Trips) is due out in October, no details of features for the new release have been announced yet.

#    Comments [0] |
# Tuesday, July 19, 2005

Bluetooth v1.4

Today I gave a session at Slide5 on the latest version of the Bluetooth library - v1.4. Key changes for this release were some bug fixes to the samples, increased functionality for the desktop side (ability to bond devices) and service discovery (as yet XP only). I've also tidied up some of the code, in order to have just a single place to determine the platform at runtime. I'll post a version of the OBEX demo I did shortly, but I'll build it as a VS2003 project (the app used for the session demo was built with VS2005 Beta 2)

Downloads

#    Comments [7] |
# Thursday, July 14, 2005

Proximity Search With SQL 2000

The "Implementing a Proximity Search with SQL 2000" article describes how to create a local method of searching for nearby places on your own locally held data. However it makes a couple of assumptions, one being that you will import your data via Access.

It's quite likely that you may want to put your place data directly into SQL Server, you can then calculate the X, Y and Z co-ordinates using a stored proceedure. Firstly I'll assume you place the data into a table in your SQL database with fieldnames Latitude and Longitude storing the values in decimal degrees as a float type. You'll also need to add columns named XAxis, YAxis and ZAxis to your table, again with a float type. Then the following stored proceedure can be used to populate these fields.

UPDATE [tablename] SET XAxis = cos(RADIANS(Latitude)) * cos(RADIANS(Longitude)),
YAxis = cos(RADIANS(Latitude)) * sin(RADIANS(Longitude)),
ZAxis = sin(RADIANS(Latitude))
WHERE XAxis IS NULL;

Note that the where clause ensures it doesn't process rows you have already populated. You may choose to run this procedure manually when you add new data, or schedule it to run regularly. If your data is editable once it's in the database, you should ensure the X,Y,Z values are removed if the Latitude and Longitude are changed on a record. Once you've run this on your data you can use the FindNearby procedure described in the article.

#    Comments [1] |
# Monday, June 20, 2005

Retrieve IMEI Through TAPI

Earlier I posted to the newsgroup a description of using Alex Feinman's Tapi Wrapper to retrieve the IMEI of the phone device. When I checked again, the specific required method is not included in the wrapper, however as Alex has made the line handles accessible it's easy to tag functionality onto the library without re-inventing the wheel. I put together a VB example to P/Invoke the lineGetGeneralInfo method to retrieve information about the phone device. If you use this on a Smartphone device you may find it doesn't work - this is because many Smartphone devices require signing to access many of the TAPI methods. I tested this on a HTC Phone Edition device

TapiVBExample.zip (52.74 KB)

 

#    Comments [4] |
# Sunday, June 05, 2005

Interesting Bluetooth Project

One of our forum members posted about an open source social networking project which uses the Bluetooth.NET library. The project is created by Software Greenhouse which is a joint venture between Microsoft India and Cynapse.

Their initial prototype release and source code can be downloaded by registering at the Software Greenhouse site. The software will allow users of Windows Mobile devices to compare user profiles to look for shared interests and chat with other users. This is an interesting use of the technology and it will be interesting to see how the project evolves. Have you used the Bluetooth library in any projects? if so please leave a comment.

#    Comments [3] |
# Wednesday, June 01, 2005

No KnownColors In NETCF

A requested feature for NETCF is to retrieve a list of named colors. Fortunately this is easily done using reflection to read all the public statis properties of the Color class:-

System.Reflection.PropertyInfo[] colors = typeof(Color).GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
Color[] allcolors = new Color[colors.Length];


for(int i = 0; i < colors.Length; i++)
{
    allcolors[i] = (Color)colors[i].GetValue(null,null);
}

comboBox1.DataSource = allcolors;

 

In this example the full list is assigned to a ComboBox for display purposes.

#    Comments [0] |
# Sunday, May 29, 2005

Compiled Documentation for OpenNETCF Libraries

With the release of the Smart Device Framework v1.3 the compiled help documentation was no longer included in the installer. I've built a standalone installer to install the full collection of documentation into your Visual Studio help. This release includes:-

  • OpenNETCF Smart Device Framework v1.3
  • OpenNETCF Application Blocks v1.0
  • OpenNETCF Desktop Communication
  • Microsoft.WindowsCE.Forms
  • The full package is approximately 5mb but once installed makes it much quicker to search than using the online version. It installs with either Visual Studio 2003 or Visual Studio 2005 Beta, Download it here.

    #    Comments [2] |
    # Saturday, May 28, 2005

    Using the Clipboard

    This is a very basic sample app to assist a thread in the newsgroup. Basically it shows a couple of approaches to working with the Clipboard, both using SDF v1.3.

    The first is the TextBoxEx class onto which I've added a ContextMenu with edit commands. The second is a plain TextBox and I've added buttons to call methods on the OpenNETCF.Windows.Forms.Clipboard class.

    In .NETCF v2.0 there will be basic functionality on the Clipboard class but it wont have the GetText and SetText shortcut methods. The OpenNETCF.Windows.Forms.Clipboard class follows the desktop v2.0 equivalent so should be fairly intuitive to use.

    The sample project was written and tested with a Pocket PC 2003. On brief testing with the 2002 emulator the context menu causes problems due to the way a tap and hold is handled and the control loses focus, thus the selection is removed, therefore no text is cut to the clipboard. I have yet to try on Pocket PC 2000/2002 device so I'd be interested in hearing if there are any problems encountered. It requires SDF v1.3 and I also recommend you are running the latest .NET Service Pack (SP3).

    ClipboardTest.zip (9.32 KB)
    #    Comments [0] |
    # Thursday, May 26, 2005

    Bluetooth v1.3

    Today I've completed the v1.3 release of Bluetooth. This pulls together the latest binaries, source code, samples and help documentation into a single package. There are few differences in the public interface from previous releases, notably the BluetoothSerialPort class has been fixed and re-introduced, also the BondedDevices property for retrieving previously bonded devices from the registry.

    I've also prepared a class-library diagram to accompany this release:-


    OpenNETCF.Net.Bluetooth.1.3.50525.png (136.1 KB)

    You can download the installation package from here.

    #    Comments [4] |
    # Monday, May 23, 2005

    Change Device Assigned to Outbound COM Port

    With the Microsoft Bluetooth stack a single outbound virtual COM port is supported, to set this up you have to bond with the device. If you want to switch between several devices at different times this is awkward. You can however alter the registry settings between connections to switch devices.

    1. Setup an Outbound COM port for the first device

    2. Bond with the other device(s) you wish to use

    3. Make a note of the bluetooth IDs of these bonded devices - see the subkeys of [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Bluetooth\Device] for details

    4. Before switching devices ensure you do not have the outbound virtual COM port opened (often COM 5 but check on your device).

    5. Replace the value of "OBBDaddr" in the key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Bluetooth\SerialPort] with the bluetooth address of your required device.

    6. Open the COM port - now connects to the device specified in the above registry key.

    #    Comments [0] |
    # Saturday, May 21, 2005

    SDF 1.3 Known Issues

    Firstly an apology to recent visitors to our website, we've just moved to a new server and are experiencing teething problems, so currently OpenNETCF forums and blogs are not working.

    This post is designed to highlight a few issues found with v1.3 and workarounds (if possible), I expect we will produce a refresh release shortly to resolve these:-

    • OpenNETCF.Configuration - in order to use these classes you'll need to replace the \windows\config\machine.config file with an amended version which correctly references the v1.3 runtimes (http://www.peterfoot.net/OpenNETCFConfigurationV13Workaround.aspx)
    • OpenNETCF.VisualBasic - This assembly is unusable in the compact framework as it references the desktop version of mscorlib.dll. No current workaround (other than using the functionality from elsewhere in the SDF since all of the methods here are wrappers to other parts of the SDF
    • OpenNETCF.WindowsCE.Forms - It appears this assembly is not correctly registered in the GAC on devices, this will cause a TypeLoadException when you reference a class from this library. To workaround this you can manually copy the assembly to your program folder on the device e.g. over activesync or add to your project as "Content" file
    • All assemblies appear as "Smart Device Framework" in the add reference dialog. If you scroll across (you may need to extend the columns) to the path you'll be able to determine the name of each assembly.
    • IDE Plugins for v1.3 may not correctly install on your machine. You may find the custom menu items don't do anything when clicked. You can still access all of the SDF and Application Blocks functionality by manually adding references to your project through the Add Reference dialog
    • (Update) Integrated help is not included in the v1.3 installer. However I've built a standalone installer with compiled help for all our libraries.

    Please use our bug submission tool if you encounter other errors, and try to give as much detail as possible. We will try and make arrangements for a refresh release shortly to overcome these issues, thanks for your patience.

    #    Comments [2] |
    # Friday, May 20, 2005

    Bluetooth Comparison

    Now that the dust has settled on MEDC, I'm thinking about how to move forward with the Bluetooth library. I had essentially put development on hold when I first heard that Microsoft were preparing their own source package prior to MEDC. When it was released, I was a little disappointed in their functionality (and compatibility) so I've decided to press on improving the Bluetooth.NET library. It's going to take a few weeks to put together the next version, one key aim is to synchronise the source, samples, documentation and binaries with this next release, some of the previous releases have been binary only.

    In the meantime here is a comparison of the functionality available today in the widely available Bluetooth libraries/SDKs:-

      Managed libraries Native code SDKs
      Bluetooth.NET Microsoft Windows Embedded Source Tools for Bluetooth Technology High-Point BTAccess Microsoft Windows CE SDK Broadcom SDK
    Bluetooth Functionality  
    Toggle Radio * *   *  
    Device Discovery *   * * *
    Service Discovery     * * *
    Client Sockets * * * * *
    Server Sockets * * * * *
    COM Port mapping *   * * *
    Bluetooth Stacks  
    Microsoft Stack * *   *  
    Broadcom Stack     *   *
    Runtimes  
    .NET v1 *      
    .NET v2 *    
    .NETCF v1 *   *
    .NETCF v2 * *  
    Platforms  
    Pocket PC 2002     *   *
    Windows CE.NET 4.2 *     *  
    Windows Mobile 2003 *   * * *
    Windows CE 5.0 * *   *  
    Windows Mobile 5.0 * *   *  
    Windows XP (SP1 and above) *     *
    Package features  
    Help documentation *   * * *
    Source code * *      
    Sample projects *     *  
    Price FREE FREE $750 FREE $1,395

    Obviously your feedback will help shape the library, so what are the key features you'd like to see added or improved?

    #    Comments [1] |

    ADOCE In The Hand v1.7 Completed

    The ADOCE wrapper is the first of our libraries to be updated with full support for Visual Studio 2005 Beta, integrating both the libraries and the help content.

    The main update is the v1.7 version of the COM Interop library which now has functionality for translating domain specific HResults into particular exception types, previously any ADO errors would result in a cryptic error code. I've also added some functionality to upsize databases from Pocket Access to Sql Server CE (.sdf).

    The v1.7 interop library shipped with the WindowsMobile community preview and will be used with the upcoming update of PocketOutlook In The Hand along with some further cool Windows Mobile stuff...

    #    Comments [1] |
    # Thursday, May 19, 2005

    OpenNETCF.Configuration v1.3 Workaround

    As I suspect many of you will be doing too, I'm recompiling one of our apps against the latest v1.3 release of the SDF. There is a minor bug in this release when using the OpenNETCF.Configuration classes due to the machine.config file which is installed with the SDF containing references to the v1.2 assemblies. The workaround is luckily quite straight-forward, simply replace your \windows\config\machine.config with an updated file referencing the v1.3 versions. You can use the version attached below:-

    machine.config.zip (1.72 KB)
    #    Comments [0] |
    # Tuesday, May 17, 2005

    Windows Mobile 5.0 "Old Skool" Start Menu

    Personally I like the new icons based start menu in Windows Mobile 5.0 Smartphone, however some people have asked if it's possible to revert to the old list view. The answer is yes, via a simple registry tweak. For this I'm using the Remote Registry Editor from VS2005. Locate the key

    HKEY_CURRENT_USER\Software\Microsoft\Shell\StartMenu

    Change the value "GridView" from 1 to 0. The change takes effect immediately when you next open the start menu. As with the large icons view the full 9 items are listed with the more option mapped to the left softkey. This always bugged me with SP2003 especially when a menu had 9 items with the 9th requiring a whole new page. You can change the value back to 1 for the new WM5 experience.

    #    Comments [0] |
    # Monday, May 16, 2005

    SDF v1.3 for Visual Studio 2005

    So, I've heard a few requests for VS2005 support for the SDF. The reason we don't have this fully integrated into VS2005 yet is because the extensibility model is significantly changed from VS2003, and since it's a Beta product is still changing. Therefore we'll have a fully integrated installer nearer to the release of VS2005.

    In the mean time you can pull the dlls off of a machine with VS2003 and SDF v1.3 installed, or grab them here in a zip file. These are the exact same dlls as you'll get in the v1.3 setup. Just to set your expectations you wont get automatic deployment of the SDF cab files (these are included in the zip for manual deployment). You also won't get the full designer experience - if you use any of our forms controls you'll have to add it through code.

    If you encounter any issues using this version from within VS2005, be sure to file a bug report, and make sure you tell us what version of the .NETCF you are targetting (1 or 2) and what platform type (Pocket PC 2003, Windows Mobile 5.0 Smartphone etc) and which version of VS2005, though I wouldn't recommend using anything prior to Beta 2 now it is available.

    #    Comments [0] |