Welcome to MSDN Blogs Sign in | Join | Help
Welcome back from the Holidays :)

You know, it’s always this time of year I either feel refreshed from having a nice little vaca and enjoying the Christmas Season, or I feel like it’s a race to the end of the fiscal.  This year, it’s kinda both.

Things here at Microsoft are busy as ever.  In many respects, with SO MANY products shipping between the end of 2009 and the end of 2010 (calendar years), it really IS a race.  A race to get that feature implemented, a race to kick off a campaign in a region, a race to simply find time in your calendar to think.

But when I do get a chance to think, I often come across some very interesting things (both internally and externally).  This morning, I was perusing the wires at about 7am my time (don’t get me started; the days start earlier and earlier for me), I came across this piece in the NY Times.  It’s actually an interesting piece that made me think that maybe, maybe, all of the virtues that we espouse as great things that embody the internet age are actually sapping some of the creativity out of the system.

Well, that’s my deep thought.  Hope everyone is glad to be back at it…even though for many of us, it seems like we never left :)

Hegenderfer

Microsoft OneApp – what is that thing?

Okay, so this is officially my second week in the OneApp team, and I must say I am really impressed with the group…sharp cookies one and all.  I am definitely bringing down the bell curve here :)

But I am equally as jazzed around the opportunities that OneApp will bring to mobile developers world wide.  The ability to reach MILLIONS of users with the EXACT SAME code base ACROSS DEVICES…that is cool!

Of course, the reason we can do this is because we have a CLR that runs above a VM on the device (and boy, it’s a tiny shim…very efficient).  So, you won’t be ‘going native’ with OneApp to the metal (so to speak), but you can create some extremely cool apps.

Best of all, for you folks out there that like to tinker, the platform supports free apps and a free tool chain…when I say free, I mean free.  As in really free.  As in, no cost (aside from your valuable time, of course).  I’ll have more info to share in the coming weeks and months, but it is very nice.

And the distribution model should be killer as well (remember the MILLIONS of users ACROSS DEVICES thing above…was that a gratuitous use of caps?).

We are still finalizing some pieces of the business models and such, so I can’t talk about those right now, but I will say that this is a different model…flat out.  I think you’ll like it :)

At any rate, as I dig in more, expect me to post more (like I used to); and as tools become available, I’ll try to let you all know about ‘em ASAP!

In the words of my friend John Smith (Xbox team)…peace.

Hegenderfer

Microsoft OneApp…here I come :)

For those of you who know me, you know I’ve been in the mobile space for awhile and have spent much of my time in Windows Mobile.  I will be branching out a bit into another mobile endeavor at MS…OneApp.

Over the next few weeks, I hope to get acclimated with this technology, and then start posting some of my findings.  I’m really looking forward to it, as the business model seems pretty unique and the technology is interesting; plus, it spans across phones (primarily feature phones right now, though), giving devs one platform to use across devices.

So, sorry I have been quiet for a while, but expect more postings from me around OneApp moving forward!

Want to take your UI to the next level?

Many of the developers at Mobile Incubation Week wanted to make sure their UIs were as cool as the ideas they represent.  You mean the standard NETCF controls aren’t sexy enough? <insert giggles here>

image

There are many alternative UI controls out there that can give your Windows Mobile application a facelift. Here are a few resources to get started.  Most of this has been posted before by other bloggers, so I’m just going to link their work (credit where credit is due).

Frank Prengel blogged about some alternative UI libraries you can use here.

Alex Yakhnin has been showing off some cool work in this area for some time.
UI Framework for .NET Compact Framework 3.5
http://msdn.microsoft.com/en-us/library/dd630622.aspx

Don’t forget AlphaMobileControls or Alphablending with NETCF

If you guys know of other cool control libraries, please… feel free to tag on to this post.  Just because your application is all business, doesn’t mean your UI has to be. =)

Cheers,
Reed

Some IE Mobile Tidbits…

Short and sweet… there are a couple of tidbits that caught my eye this week related to developing with IE Mobile and the WebBrowser control.

If you are using the WebBrowser control and NETCF 3.5, you might want to check out the new hotfix and KB article just published here.

Raffaele Limosani wrote a comprehensive blog article on the issues.  Check out his blog.

On another note, if you are writing web apps for Windows Mobile, that late versions of IE Mobile do a pretty good job of rendering desktop content.  There were a few releases toward the end of WM5 and early releases of WM 6 that can be a challenge.  I blogged about those here.

 image

If you are using ASP.NET to develop content to target WM browsers across the board, please be sure and check out this article that demonstrates how to add in support for IE6.  It may save you a lot of time trying to figure out why server control content is rendered differently on some of these devices.

Cheers,
Reed

Why Windows Mobile as a Business Platform?

 

I’ve said it before that Mobile Developers were going to change the world.  I still feel this way.  There are a lot of cool technologies changing our lives, but nothing compares to having a little computer in your pocket that can effectively do everything your PC does and more.  The players are all out there now and the potential has only increased in scope.  iPhone, Android, and Palm Pre have all got their game on.  Mobile Operators are drafting new guys and cutting dead weight.   

As a Windows Mobile developer, the question I often get (more now than ever) is “why should I choose Windows Mobile”?

I’m not a marketing guy, but I view this question from two sides… consumer and business.  Let’s put aside the consumer space for a moment and talk about getting work done.  Many businesses are still figuring out that mobilizing a workforce is a competitive advantage.  It’s not just about employees getting email… you have to think about Line of Business (LOB) applications, access to workplace documents, systems integration, use of existing knowledge, security, device management, etc.  It’s a big powerful mix of possibilities that can only happen when you have the tools in place to execute on all these things.  In other words, it’s not just about the device… it’s about the technologies in place to support business on a device.

So why is Windows Mobile right for your business compared to all these other guys?   I see it this way…

 

1.     Windows Mobile offers the widest range of device hardware to meet any type of user preference… or location.  If you want a small , low-end phone or a full featured computing device… we have it.  If you want a device with a keyboard, we have those.  Need a ruggedize device with a barcode scanner that can take abuse, no problem.    Flip phones, slide phones, high DPI phones… we have them.  You need it to work in multiple countries, no problem.  Nobody gives you more options of available devices to mobilize your business and accommodate preferences.  Your phone should suite you, not the other way around.

2.     A secure platform above all others – We’re FIPS compliant.  We provide support for IRM secured email, remote wipe of lost devices by user or admin, enforceable password and PIN policies, Storage Card encryption, encrypted SQLCE databases, Crypto APIs for developers, configurable security policies to enforce signed code or lockdown to only corporate signed apps if you want to go that route.

3.     Device Management – Talk to any IT shop and they will tell you that if they can’t secure it, they will not manage it.  Out of the box management support is provided via Exchange to control remote wipe, password policies, etc.  This means if you have Exchange as your corporate email platform, you get basic device management capabilities with no extra investment.   For more comprehensive device management needs, we offer Systems Center Mobile Device Manager (access your corp resources via VPN, configuration, deployment, disabling of device features like camera, Bluetooth, etc.) .

4.     Business Integration – Windows Mobile devices provide out of box support for integration with a variety of Microsoft products like Exchange, SQL Server (merge/RDA data replication), Word/Excel/Powerpoint documents, and Sharepoint.  If you are using these products in your organization already, then you extend those capabilities to mobile devices when you equip en employee with a Windows Mobile phone.   There is no middle-man in our email model and you don’t pay for NOC services.  Bottom line… if you are already using Microsoft technologies in your company, you are reaping your investment by taking advantage of key integration features that are already present and waiting for you.  Windows Mobile integrates with the systems you already have.

5.     Flexible Application Architecture – Some programs run well as web applications (until you lose connectivity).  Some application need to run locally on the device (with an option to connect as permissible).  Maybe you need multiple apps running at the same time.  Whether you need to run concurrent, web, client, or rich internet applications – Windows Mobile supports all the scenarios.  We let you decide which architecture is right for you. 

6.     The best develop tools on the planet – Visual Studio is the best development IDE on the planet for almost any type of application development.  If you already use it to write desktop or server apps, guess what?  You have what you need to build mobile applications.  Just download the free emulators/SDK off the web and go for it   No applications to fill out, no approval process to get started.   You don’t even need a device to get started… use the emulators with all their amazing features.  No need to go through an approval process just to run code on a real device.  By the way, the development community rocks.  There are samples out there for just about anything you want to do.  If you can’t find it on MSDN, you can find it in the community sites. 

7.     Flexible Deployment – Deployment should not be complicated.  Once your app is done, just build a CAB (deployment package) and optionally sign it in Visual Studio.   You can deploy your application any way you can get that CAB file to a device.  Copy it to the device via ActiveSync/WMDC, via Storage Card, deploy over the air (via email or management software), put the CAB on your web site and let users browse to it, etc.  You can even install to a desktop via any desktop management software and have the CAB pushed out the next time the device is connected.  If you are using SCMDM, you can push out any software updates, remove software, or inventory installed software.   Windows Mobile 6.5 brings Marketplace to every device to create an easy sales and deployment channel for ISVs.  Don’t jump through hoops…  Pick the deployment mechanism that makes sense for you.

8.     Use what you already know – You can develop Windows Mobile applications using either native (C++) or managed code (.NET/C#/VB.NET).    The native API set is basically Win32 (CE OS).   The Compact Framework is basically a scaled down version of the full .NET framework (same APIs but fewer to pick from).  If you already know how to do Windows develop, then you take all that knowledge to Windows Mobile.   You could re-use what you already know and save money/time or you could re-train all your developers some of those other platforms – learning new languages, new tools, buying a new computer/OS’s to do it.  You already have what you need to develop for Windows Mobile.

9.     Bells and Whistles? – Consumers love the “bling” and marketing plays this angle for everything its worth.  I still can’t help but chuckle a bit when I see out competitors trumpeting *new* features like “Copy & Paste”, “Voice Activation”, and ”Integrated Mapping”.  He do need to talk about this more…   Um, the absence of Cut & Paste should be considered a bug… not a feature.  We’ve had Voice Command for years (just you phone to play music or call your friend by name), and anyone who has not tried Bing Mobile (formerly Live Search) is just missing out.  Map your location and find attractions using your *voice*.    Have you seen TellMe?  My point is that there are so many cool apps out there… take your pick.  Windows Mobile device are available with other forms of hardware bling…. accelerometers, light sensors, etc.  No, we don’t have multi-touch… which critical business app were you using that in?  Bling is pretty, but at the end of the day it’s about getting the work done and working well with others.  Pick from any of thousands of 3rd party products and application to support your efforts.

10.                        Never Underestimate Synergy –The Windows Mobile model combines Microsoft’s CE OS with clever device makers and with strategic mobile operators all over the world to produce a global mobile phone platform.  Everyone has different ideas about how to win in this market and it makes for some super tough decisions and creative collaboration.   Is it easy?  No.   Do we have more device options, a rich and accessible platform, and a global model that scales with you as a result?  Yes.

Business guys… don’t take my word for it.  Go shopping and compare all the platforms out there.  I hope the list above will make it easier for you to ask the right questions.  You will not find a better partner than Windows Mobile to mobilize your business.

Consumer guys… this may need to be another blog post, but I’ll just quickly say that we’re going to bring some sexy back in Windows Mobile 6.5.  You are going to give you some UI love and we’re going to make it super easy to locate all those great apps right on the device with Marketplace.  Our hardware friends are going to deliver some great new devices and I think you are going to like what you see. 

Cheers,

Reed

 

Enterprise Data Synchronization with Microsoft SQL Server 2008 and SQL Server Compact 3.5

Back when I started writing windows applications, there was really only one book that mattered….Programming Windows by Charles Petzold.  It provided the essential clues to get started on just about any topic for budding Windows developers.  Information was scarce… and *good* information was golden.  This book was a “must have”.  How things have changed…

 

Query “Windows Development” on Amazon today and you can pick from almost 10,000 results.  Great books are harder and harder to find because the compete with so many mediocre titles.  Everyone is an author.  Blogs and online developer content proliferate the web.  The problem is not finding content… it’s finding the gold.  How do I filter the buzz and find the stuff that matters?

 

So here’s a shout for one that matters…Enterprise Data Synchronization with Microsoft SQL Server 2008 and SQL Server Compact 3.5 by Rob Tiffany.

 

Rob wrote this book from the trenches…hands on, real-world deployments.  Simply put, Rob is the guy Microsoft would drop-ship into the biggest, most strategic, and difficult SQLCE replication deployments out there with a directive to “make it succeed”.  This book is filled with prescriptive, real-world advice on how to do it right.

 

If you are doing replication with SQL Server Compact Edition (SQLCE), this will be the best $20 you will ever spend.

 

You can read Rob’s own summary about what went into it here.

 

" I wrote this book on airplanes and in hotels as I travelled the globe helping some of the world’s greatest companies mobilize their workforces with SQL Server, Merge Replication, .NET and SQL Server Compact."

Available on Amazon: http://www.amazon.com/Enterprise-Synchronization-Microsoft-Compact-Replication/dp/0979891213/ref=sr_1_4?ie=UTF8&s=books&qid=1248893911&sr=1-4

Cheers,
Reed

 

Application Verifier Tip - “EnableShimEngine”

I’ve been seeing a number of reports from developers taking their first lap with Application Verifier related to a common error, “Unable to enable shim engine on device”.   While there are a few different reasons this problem occurs, the most common one is a mismatch in test tool components.  When you download Application Verifier for Windows Mobile 5.0, it’s really easy to overlook a couple of instructions in the download link that tell you to copy the Windows Mobile bits over the CETK bits.

 

For systems that have never installed Platform Builder, complete the following additional steps:

1. Install the Windows CE 5.0 Stand Alone CETK (this provides connection libraries needed).

2. Replace the Application verifier binaries in the processor folder for the device type. For example, replace C:\Program Files\Windows CE platform builder\5.00\CEPB\wcetk\DDTK\ARMV4I with C:\Program Files\Application Verifier for Mobile 5.0\Armv4i.

 

For retail devices you will also need to sign all of the application verifier binaries with the Privileged SDK certificate.

 

Eric also posted a blog on this issue along with a script to help.  While the App Verifier walk-through video talks about this, there whitepapers won’t remind you.  Be sure you are using the WM bits! =)

 

Cheers,

-Reed

Windows Mobile 6.5 Walkthru

Guess I don't have to do this now :)

Most of you have probably already seen this video, but if not, it's a good Windows Mobile 6.5 walkthru.  I've been using this for quite a while now, and I must say that I really DO enjoy 6.5 over previous revs.

Of course, the hardware is getting better all of the time as well :)

FITC Mobile in Canada - are you going to be there?

There will be some good mobile sessions, including some around Windows Mobile development from Mark Arteaga :) 

If you plan on going, click this link to get a discount to the event!

Microsoft Hopper Test Tool for Windows Mobile 6.0, 6.1, and 6.5

Hopper for 6.5 is live!

Hopper is a software test tool that simulates random user input on mobile devices providing a sometimes meaningful mean time to failure (MTTF) number. It is designed to find bugs and is not intended to run scenario tests or do "specific user things" - it is completely random. Hopper stresses the entire device and will execute anything accessible through the UI many, many times. It has no knowledge of where it is at any time and has limited ability to detect poor system health. Hopper executes randomly, thus different bugs might be encountered each time the tool runs. Fixing enough bugs to impact MTTF may take many runs. Reproducing specific runs and/or finding the particular bug that caused any specific failure can prove to be difficult. While Hopper excels at finding system stability bugs quickly, it was never designed to debug or diagnose the source of any particular problem. It utilizes a "system snapshot" log at regular intervals which can help you understand fault. Determining device MTTF via stress testing and debugging is a simple process: run a stress tool until the device fails, diagnose the failure, fix the bug, and re-start the stress tool. In theory, each time a bug gets fixed, MTTF increases because the tool runs longer without a failure.
 
 
Thinking about my next blog post... what do you guys/gals want to hear about? 
 
Cheers,
Reed
WM 6.0 and 6.1 Support in Windows Marketplace for Mobile

If you haven't heard the news already, we will be supporting WM6.0/6.1/6.5 in the Windows Marketplace for Mobile.  This is great news for app devs, as it gives you all over 30 million sockets that are already existing world wide :)

Here is Todd Brix's blog entry around the announce.

Windows Mobile Developer Camp

We're excited to announce the first in a series of barcamp-style events for the upcoming Microsoft Windows Mobile 6.5 OS

So, WHAT is WinMoDevCamp? Glad you asked!

WinMoDevCamp is a series of upcoming not-for-profit gatherings to develop applications for the upcoming release of the Microsoft Windows Mobile 6.5 O/S. The event is currently being planned in 6 cities around the world. Our first Windows Mobile Developer Camp event has been scheduled for August 19 in Redmond, Washington at the Microsoft Campus. This is where you register. Dates will soon be announced for the following additional cities: Austin, London, New York, San Francisco, and Singapore. We will also encourage other mobile developers to host their own events on the same dates. The soon-to-be-released http://winmodevcamp.org website will have facilities for local events to organize as well.

Dates: Our first event will be held Seattle on 8/19
Venue: Microsoft Campus in Redmond, Washington in the Cascade Auditorium

WM 6.5 Gesture Documentation is live on MSDN

Windows Mobile 6.5 gesture documentation is live on MSDN now.    Gesture code samples are included with the 6.5 DTK.

Cheers,
Reed

Spotlight on Connection Manager

clip_image002

Windows Mobile provides a very powerful, but often misunderstood, abstraction layer called Connection Manager.  Connection Manager is responsible for managing all the possible networks a device may expose and transparently brokering them out to applications.  On a mobile device, connections come and go… and when they come, they do so various forms …cellular, WiFi, Desktop-Pass-Through (via USB or Bluetooth), etc.  The possibilities are vast because we have a very flexible platform and device makers are free to integrate all kinds of communication sources.  Even if we consider a single cellular network, there may be multiple network paths an application uses to make network requests…that’s where thing can get a little confusing and developers (as well as end users) often start asking questions.  Consider that an operator may use multiple APNs to secure or control communications… or that they may have a generic mobile portal for content that is filtered through a WAP proxy.  How does all this work transparently to a connected application like Internet Explorer or custom ISV application?  Developers shouldn’t have to write code to deal with all the scenarios… and that’s why we have Connection Manager.  In a perfect world, you never even know it’s there… it “just works”.

Connection Manager is too complex to cover in any single post, but I wanted to touch on a couple of things.  Marcus Perryman has written several excellent articles on the topic and blogs about it every so often.

My first experience with Connection Manager was like many developers.  I was utterly perplexed.  I came from the world of desktop/server computing where networks were fairly consistent.  I setup TCP/IP, maybe a proxy, and that was it.  Most desktop apps can now safely assume a connection is going to be there.  Mobile apps are not so lucky, but the good news is that Connection Manager does a lot of the work for you.

The more I thought through the connectivity challenges of a mobile device, the more I began to appreciate what CM provides.  How do you transparently broker a bunch of potential networks to applications?  One could assume that there may be multiple valid networks to get to an internet resources, so priority might be one approach.  Another factor might be that specific types of requests would need to be use specific networks… for instance, maybe all wap:// or mms:// requests would need to be bound to a specific operator network.  Another requirement might be that you would want to bind intranet requests to a local network and extranet requests to an external network.

To understand how CM approaches these problems on any specific device, you just have to look into the CM plumbing.  That’s all the configuration data that tells CM how to make decisions based on configured networks.  The problem… well, it’s mostly invisible.  Only a very small percentage of configuration info is exposed in the WM user interface (networks, proxies, etc.).  Most of the important stuff (mapping, plans, etc.) is only configured and exposed via CSPs.  I should emphasize that in most cases, you never need to know about how it all works.  Operators generally configure connection behavior of a device before it goes to market via Provisioning Connectivity Settings.  It would take a while to go through all of these and how they play into things, but there are a few key questions that come in development scenarios that will lead you into all of this…

·       How does the platform differentiate what routes to a “Work” connection vs. an “Internet” connection?

·       When do I have to establish a connection in my code vs. letting the platform do it?

·       Why can my application make a successful network request after I use Internet Explorer but fails otherwise?

·       When I configure a connection exception in the UI, what really happens?

·       Why does my internet application behave strangely and fail on some devices and operator networks?

·       How does WM prioritize networks?

I said earlier that Connection Manage is an abstraction layer, so it hides the physical network hardware from you and exposes everything via virtual networks, or “meta-networks”.  The Windows Mobile SDK provides quite a bit of documentation on Connection Manager.  It’s not terrible easy to read since it’s totally abstract, but it’s a start.  A few things you will want to look at to make sense of all this…

The CM_Networks CSP configures metanetworks, destination networks to which multiple connectivity objects and proxy or Virtual Private Network (VPN) connections can connect.  This is basically the end of the plumbing path for network requests on a WM device.  These represent the networks that are available to the device… everything else in the CM plumbing is designed to help your app get here easily and do so transparently.

 

The CM_Planner CSP sets/queries the “preferred” connections for Connection Manager.  Suppose you have multiple networks that can get you to a destination… CM_Planner configures criteria and sets the “default” selection to help CM make a good decision when there are several comparable paths.

 

The CM_Mappings CSP is how CM determine which types of request go to a specific network.  It does this by pattern matching the request string against a wildcard filter string that you attach to a network GUID.  This is how a device differentiates a “Work” request from an “Internet” request.  By default, anything with a “.” (dot) in it gets routes to the “Internet” GUID.  This is done by a mapping that is added for any string that matches the wildcard “*://*.*/*”.   This is also how we make decisions about which requests to route to the “Work”  meta-network…simply adding a mapping for “*://*/*” and mapping it to the “Work” GUID.  Sometimes a device make have a filters to route MMS, WSP, WAP, etc.  If you find a scenario where requests always seem to be routing to the a network you don’t expect, check the mappings.

CM_Mappings is also how CM handles network “exceptions”.  This comes up quite a bit when someone wants to use a device on a corporate intranet (typically the “Work” network) with fully qualified domain names.  Remember, by default, anything with a “.” in the name/URL gets sent to the Internet.  If you are using FQDNs on your intranet, then you won’t want that.  When you add “Work URL Exception”, you are actually adding a mapping for the fully qualified name to use the “Work” GUID.  For example if we queried the mappings for a device with a URL exception for “expenses.mycorp.com”, it might look like this:

 

clip_image004

The query

<wap-provisioningdoc>
<characteristic-query type="CM_Mappings" recursive="true"/> </wap-provisioningdoc>

 

The result

<wap-provisioningdoc>

  <characteristic type="CM_Mappings" recursive="true">

    <characteristic type="16777216">

      <parm name="Pattern" value="*://expenses.mycorp.com/*"/>

      <parm name="Network" value="{A1182988-0D73-439E-87AD-2A5B369F808B}"/>

    </characteristic>

    <characteristic type="536870912">

      <parm name="Pattern" value="wsp://*/*"/>

      <parm name="Network" value="{7022E968-5A97-4051-BC1C-C578E2FBA5D9}"/>

    </characteristic>

    <characteristic type="553648128">

      <parm name="Pattern" value="wsps://*/*"/>

      <parm name="Network" value="{F28D1F74-72BE-4394-A4A7-4E296219390C}"/>

    </characteristic>

    <characteristic type="570425344">

      <parm name="Pattern" value="*://*.*/*"/>

      <parm name="Network" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>

    </characteristic>

    <characteristic type="587202560">

      <parm name="Pattern" value="*://*/*"/>

      <parm name="Network" value="{A1182988-0D73-439E-87AD-2A5B369F808B}"/>

    </characteristic>

  </characteristic>

</wap-provisioningdoc>

You could take it a step further and query CM_Networks on the emulator to examine the available networks, we would see that the Work GUID matches the GUID we mapped the requests to in the mappings exceptions.  Similarly, you would see that the mapping for *.* (fully qualified domain names) maps to the Internet GUID.  All we’ve done is to map specific URL requests to specific networks.

<characteristic type="CM_Networks" recursive="true">

    <characteristic type="My Work Network">

      <parm name="DestId" value="{18AD9FBD-F716-ACB6-FD8A-1965DB95B814}"/>

      <parm name="Secure" value="0"/>

      <parm name="ReadOnly" value="0"/>

    </characteristic>

    <characteristic type="My ISP">

      <parm name="DestId" value="{ADB0B001-10B5-3F39-27C6-9742E785FCD4}"/>

      <parm name="Secure" value="0"/>

      <parm name="ReadOnly" value="0"/>

    </characteristic>

    <characteristic type="Work">

      <parm name="DestId" value="{A1182988-0D73-439E-87AD-2A5B369F808B}"/>

      <parm name="Secure" value="0"/>

      <parm name="ReadOnly" value="0"/>

    </characteristic>

    <characteristic type="Secure WAP Network">

      <parm name="DestId" value="{F28D1F74-72BE-4394-A4A7-4E296219390C}"/>

      <parm name="Secure" value="0"/>

      <parm name="ReadOnly" value="0"/>

    </characteristic>

    <characteristic type="The WAP Network">

      <parm name="DestId" value="{7022E968-5A97-4051-BC1C-C578E2FBA5D9}"/>

      <parm name="Secure" value="0"/>

      <parm name="ReadOnly" value="0"/>

    </characteristic>

    <characteristic type="The Internet">

      <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>

      <parm name="Secure" value="0"/>

      <parm name="ReadOnly" value="0"/>

    </characteristic>

  </characteristic>

 

Connection Manager FAQs and “Gotchas”

 

How does the platform differentiate what routes to a “Work” connection vs. an “Internet” connection?

It’s just a URL mapping.  Anything with a “.” (dot) in it is considered an “Internet” request and will route to the Internet connection GUID.  Anything without a “.” (dot) is considered “Work” and routes to the Work connection GUID.  You can define exceptions to route FQDN request to the Work network.  This is all configured in the CM_Mapping CSP and is designed as a simple way to separate intranet traffic from internet traffic.

 

When do I have to explicitly setup a connection in my code?
Managed applications (e.g. - Compact Framework) generally setup connections for you if you use higher level classes like HttpWebRequest…just make your request.  This is not the case for lower level managed socket classes like TcpClient and UdpClient.  In those scenarios, you would need to P/Invoke to make it happen.  If you write a native application, you always need to make sure you establish a connection in your code to ensure connectivity.  Check out Jim Wilson’s How-Do-I series for managed apps with Connection Manager and see the CMHELPER SDK sample application for more guidance with native apps.

Why can my application make a successful network request after I use Internet Explorer but fails otherwise?
When any application successfully establishes a connection to a destination network using Connection Manager, the connection is typically kept alive for a period of time and made available to other applications.  Internet Explorer uses Connection Manager to establish its connection and that’s why other connected apps will be able to make network requests as long as this connection is still alive. 

When I configure a connection exception in the UI, what really happens?

You are just adding a mapping  for a specific URL to a specific destination network.

Keep in mind that URL Exceptions only appear in the user interface if the exception ID falls into a specific range.   This is documented in the WM SDK under “Using Connection Manager URL Mappings”.  16777216-16842751 Manually entered URL exceptions, sequentially numbered from 0x01000000. There can be up to 65536 entries.  Hidden mappings serve as a way to protect the config from end users.  This is useful in corporate environments to lock down devices, but tricky for developers who may not know they are there.  You can query the CSP to get a full listing of mappings.

Why does my internet application behave strangely and fail on some devices and operator networks?
In most cases, things should “just work”…however, I have seen several scenario where network communication was hampered by operator specific configurations.  Most notably, operators like to route all Internet communication through their WAP proxies which can create variety of communication issues if apps don’t expect to be limited.

A recent example….I helped a developer who was reporting a problem with a number of Windows Mobile phones by users attempting to sign in using Live ID on a major web portal.  The error?

JavaScript required to sign in

Windows Live ID requires JavaScript to sign in. This web browser either does not support JavaScript, or scripts are being blocked.

Clearly, WM supports Javascript so something else must be going on.  On the problem devices, a quick change to disable to WAP proxy instantly resolved the errors.  From Internet Explorer, go to Menu->Tools->Options->Connections and disable “Auto-Detect Network” and enable “The Internet”.    This tells IE to bypass the automatic mappings that were added by the operator to use WAP for internet requests and route directly to the Internet destination network instead. 

If you run into communication errors on a device, it’s always a good idea to test with the emulators first using a cradled connection.  This is a very simplistic, clean configuration and removes many of the operator and device variables from the mix.  If connections work in the emulator, you can start comparing some of the differences in the CM plumbing to see what is going on.

How does WM prioritize networks?

There are a number of factors that play into how one network is prioritized over another.  The greatest factor is probably the concept of security level.  In general, if multiple network paths are available, CM will use what it perceives as the “most secure”.  Desktop Pass-Through (DTPT) connections are considered the most secure connection, followed by NIC, WiFi, and then cellular network connections.  For more information, you can read up Connection Manager Security.

 

Can I tell my application to use a specific connection if I don’t want to CM make all the decisions?

Yes, see Configuring an Application to use a Specific Network

 

When I cradle my device on my desktop, it imports my desktop Proxy and messes up my connections.  How do I avoid that?

See Vik’s post here.


Do you have other Connection Manager questions?  Let me know…

Cheers,
Reed

 

More Posts Next page »
Page view tracker