I’m doing another SmartPhone Session next month in Germany at Rainer’s German FoxPro DevCon and I had to revisit my demo TimeTrakker application with the latest VS.NET release candidate. It looks like some problems that I had with Beta 2 with the Emulator have been addressed. For one the RC got me online without any special configuration using Internet Explorer, which is a big improvement over what was happening in Beta 2 where connections were incredibly flaky.

 

Unfortunately I still have major problems with connectivity from within my applications. My application is an online offline app that connects to a Web Service on demand and when first starting up to get initial list data. I’m unable to get the damn emulator to connect to the live Web Service on the Web. It does – maddeningly – work against my local machine. This means I can test it at least, but it’s a mystery why it can’t make the live connection, when IE can both connect to the Web and my local machine. I suspect that the problem is some sort of connection configuration, but I can’t tell WHAT actually fails. I get an incredibly useful WebException which has no error information other than that’s a Connect Failure. Thanks…

 

The other problem is that Emulator is DOG. So much so it’s practically unusable. I was complaining about this in Beta 2 and while performance has improved some it’s still ridiculously slow. Any sort of IO operation while debugging takes a life time while you’re twiddling your thumbs. Example: Starting this small app takes around 30-40 seconds in the Emulator. Granted it does a few things that are expensive in terms of a SmartPhone Application – it tries to access a Web Service or read data from a tiny DataSet (which is the only remotely parsable built-in API that SmartPhone 1.0 has) and retrieves settings and a list of customers. It’s quite pathetic, especially when compared to operation on a real phone which does the same thing in 10 seconds incuding a connection that actually works…

 

Sure starting a Hello World app is much faster, but any real world app likely needs to load some sort of state and data, and this is apparently what’s so slow. Any IO bound operation drags on and on. Part of the problem appears to be the JIT compilation of code. Some things are pretty expensive there, like trying loading an XML file – even if tiny - into a DataSet. The app churns and churns apparently while .NET is loading and compiling the .NET libraries. After initial load the app actually run pretty quick. For example, a first Web Service Load on the phone takes 15-20 seconds (regardless of whether it’s local machine or Web). A subsequent call to the Web Service takes 2-3 seconds. So startup speed is a huge a issue…

 

But to give credit where credit is due the Emulator also has a few high points including full support for ActiveSync which means you can test synching scenarios and you can use the ActiveSync manager application to access the Emulator. One very important feature that wasn’t in the VS2003 Emulator was the inability to access files on the device because the non-OEM versions of Mobile Windows that the Emulator runs doesn’t have a File Manager (who was the genius who thought of leaving out a way to manage files out of the base OS???). With the ActiveSync manager you can now browse the device’s file system and drag and drop files onto it. The new DMA transport also is supposed to make network access much more consistent and on first blush – Web Service problems aside – this seems to be the case given that IE immediately fired up and sees both local and online Webs.

Forget the Emulator

After fighting with the Emulator some more today I think this thing is an unworkable solution for development unless you have the patience of a Zen Master. I try – but was ready to launch the laptop into the wall a few times today. Sorry, but I rely on a debug/run cycle and with the Emulator this is just not reasonable with anything beyond a Hello World application.

 

It’s truly a mystery to me how Microsoft could build a new Emulator that has such horrible performance – especially compared to the emulator that was in VS 2003. Granted there are many feature enhancements, but the new emulator is a PIG. If it’s too slow to efficiently develop and debug an application it doesn’t matter how many new features there are. It’s slow and takes a shitload of memory ( it runs 120 megs and chews 90% of the my CPU even when idle). It’s no wonder this platform isn’t going nowhere when the tools are this crappy.

 

To move forward I tested on my actual AudioVox SMT5600 phone and this actually works much better. Performance is still not exactly stellar but compared to the emulator it’s much better – I’d say it’s easily 3 times faster.

 

Here’s another thing I didn’t know: You can get the live phone connect to your local machine when it’s connected via ActiveSync. The phone is seeing my machine by NetBios name so I can call my Web Service locally. Not sure how I missed this before, but I sort of assumed there was no way the live phone could do that.  This setup works well for testing locally, but apparently the phone can’t deal with making a true Internet connection while connected through ActiveSync. As soon as I try to connect to my Web Service ActiveSync disconnects and with it of course the viewer application. So, there’s still no way for me to run my live Web Service in debug mode… but I guess I can live with that at least for development.

 

Pocket-Controller to the rescue

The big issue for me though is that I need to present this stuff. I ran into a very cool third party tool called Pocket-Controller that allows you to view the Phone’s screen and manipulate the UI through your desktop computer. This things been around for a while – I heard about it before but I didn’t quite make the full connection. Being fed up with the Emulator I downloaded and installed it today and used it for a few hours debugging my app. It works very well for this environment.


When connected I can use either my desktop or the phone to navigate and the screen is echoed back into the viewer. Any button clicks you make on this viewer are transferred to the phone or you can control the phone directly and have the view monitored on your PC screen. It’s $30 utility, but if you use your phone a bit for development this will pay back for itself in no time. Another cool thing about this thing is that it’s a great way to enter information into you phone with your keyboard instead of going into T9 key contortions.

 

This tool has a number of other cool features like the ability to capture screen shots and record video right off the device. There is also external File Manager, that lets you browse on the desktop and then launch files on the device.

 

This is very cool – I now have a much more reliable environment for working on my apps. BTW, it works with Pocket PC devices as well.

 

So I’ll still need the emulator for my Mobile Web Control demos, but for that the Emulator actually works properly both against local and remote machines.