I must be getting old. I’ve been on the road for DevCon in Vegas and now at DevTeach in Montreal for a week and a half and I’m beat. Ok, today wasn’t the easiest of days with 3 back to back sessions. I was excited to see my SmartPhone session come off without much of a hitch. I had really been stressing about this session, since this was a brand new topic for me with so much pain that went into it struggling with the technology.
I had about 3/4 capacity room and there was plenty of interest – at 3pm nobody seemed to be falling asleep <g>. However, it was interesting doing a quick survey at the beginning of the session to see who had actually done any SmartPhone or even any PocketPC development. I got 1 hand for SmartPhone, and 2 more for PocketPc.
It looks like there’s a lot of interest in SmartPhone applications, but not a whole lot of takers in moving in on the technologies. I’m afraid my session probably didn’t help much in making any converts – although I demo’d some interesting stuff, the demos using the emulator in VS.NET 2005 also demonstrated also in what bad shape the new emulator and its performance is in. It’s sloooooow… Microsoft has been saying that the new emulator in VS.NET 2005 – which is ARM emulation rather than x86 emulation as in VS.NET 2003 – was supposed to provide significant performances gains, but unfortunately this is definitely not the case. I’d say that the new emulator is roughly 2 times slower than the already slow emulator in VS.NET 2003. We can only hope this gets better by the time VS.NET and the SP SDK for 2005 releases.
Beth Massi, Nick Landry and I were discussing Smartphones for a while over dinner yesterday and I think the core thought is that SmartPhone sounds like a really cool idea, but in practice it’s hard to really find a useful application. Beth and Nick are doing a tag team session here at DevTeach and Nick’s providing a SmartClient front end, but even so some of the smart client front ends seem contrived.
So, what is a good application for a Smartphone that actually runs on the phone? Yeah, games are likely a popular choice, but I’m talking about business scenarios? Can you think of good business scenarios?
The first scenario that I actually use now is a Web front end to my only West Wind Web Store application, which allows me to review and if necessary process and manage orders online. This is a pure Web front end with ASP.NET Mobile Controls. This is actually useful and was relatively easy to implement. It works well because it’s based on simple read-only interfaces with a few action operations that are fired via simple clicks. This works well, is useful but of course it’s not really a local app.
My actual phone application demo was something I needed and find useful, which is a simple time tracking application. The app is set up mostly as a demo rather than a full application at this point, mainly so I can pass it on, and it demonstrates a number of different features that I think are critical for SP apps.
The basic idea of the app is to punch in and punch out time entries for a list of customers that is downloaded from a Web Service. First time the app runs it downloads a list of customers from a Web Service and caches the customer data locally, so that it doesn’t have to be downloaded again unless the user explicitly asks to update the customer list in effect caching the customers. Entries are then displayed and can be punched out locally, which is also stored locally in a dataset. The punched out entries can then be synced with the Web Service on demand. It’s a basic online/offline application.
I had some issues with how to store the data here, because the actual server and WinForm applications use Entity objects to pass data back and forth between Web Service and Smart Client application. While this works fine to pass the data to the SmartPhone app, the SP app has no way to serialize the data since SP 2003 doesn’t support serialization. This means that I had to recreate my bus objects using – for simplicities sake – DataSets on the smartphone. DataSets are the only useful built in serialization mechanism for data storage. Note there’s also no SQL Server CE for SP 2003 (although Windows Mobile 5.0 for SP is suppose to support SQL CE).
The demo worked great and demonstrates a number of the data issues as well as the UI issues which required a lot of manual UI coding because the stock controls just don’t provide enough UI functionality to make a good looking or in some cases even useful application. But still I feel it’s a very unsatisfying demo for a number of reasons.
First it’s slow. Building SmartPhone applications that are fast is surely an art that I haven’t mastered. To really build decent apps that run fast I think you still going to need C++ or pure WinAPI code.
With .NET I opted for a nice looking UI with splash image and custom bitmaps for owner drawn controls, but I suspect this actually slowed the application down even further. Without that stuff though, the app was rendering so sloppy with controls painting that using the graphic images at least made the app look professional instead of slow and sloppy <g>…
The app might be somewhat useful once finished and plugged into a real application environment. Currently the Web Service on the server side just picks up the time entries and stores ‘em to SQL Server, but nothing further is done with them. Given that the app is so slow though I don’t think I would even bother using this app in real life either.
The app is rough, but if you want to check it out you can get it here with your phone:
http://www.west-wind.com/deploy/timetrakkersp.htm
It’s interesting that the app on the phone runs MUCH MUCH faster than on any of the emulators, but still it is slow. What’s really killing performance in my testing is:
App Startup (5-10 seconds)
First Web Service Invocation (10-20 seconds)
File access to data (3-4 seconds on first load)
I noticed a couple of issues where file access, web service access and image resource loading result in internal Exceptions in the .NET framework when it starts up and runs these operations. File access ends up with FileNotFound or AccessDenied Exceptions. Web Services with Uri not found exceptions. Image resource loading with Notauthorized exceptions. All of these are horrendously slow especially the first exception that fires as we all know how slow exceptions are on first access in a .NET application. All of the JIT compilation and stack unwinding is killing startup speed and these are exceptions that are fired in the bowels of the framework and aren’t actually failures that stop operation! Ugh.
Again, even for such a simple app, the platform is barely adequate to run an application like this.
Windows Mobile 5.0 may make programming easier for SmartPhone’s but I don’t think it’ll help much with the usability of applications coming out on the other end. Ultimately it seems that the .NET framework on SP needs more hardware to truly be useful – faster processors and most importantly more memory. My apps on the phone tend to start running with 2 megs free and can quite easily run out of memory. Ouch…
I think we need a few more rounds of hardware before this platform becomes viable. It’s possible to build applications and if you really have a need for this functionality it’s good that we can build it if truly needed. But I think the need for using this platform will be pretty small in the short term. especially if you have fat fingers like me <g>...