All posts by onlyconnect

Nokia adopts Windows Phone 7: game on

Nokia and Microsoft have announced a strategic partnership in which Nokia is to adopt Windows Phone as its “principal smartphone strategy”.

imageimage

There is a smidgen of uncertainty. The release says “Nokia and Microsoft intend…” Still, I think we should assume it will go ahead.

The key elements of the agreement:

  • Nokia adopts Windows Phone for most of its smartphones. The word “principal” leaves space for others.
  • Nokia will contribute hardware design, language support, and “help bring Windows Phone to a larger range of price points”.
  • Nokia will adopt Bing search and use Microsoft adCenter.
  • Nokia Maps will be integrated with Microsoft’s mapping services.
  • Nokia’s app store will be integrated with Microsoft Marketplace.

A few observations.

  • First, this is what Windows Phone 7 needs. It is a decent mobile OS with potential for excellence, but needs better than the luke-warm support it has received so far from Microsoft’s hardware partners. I have thought in the past that Microsoft needs to make its own hardware, but this deal is better.
  • It also plays to Nokia’s strength in mobile hardware design. Recent high-end Nokia devices have had excellent hardware engineering spoilt by poor software.
  • Windows Phone 7 already has strong development tools; I have seen comments from developers that the same app takes less time to develop than on Apple’s iOS or Google Android. What it has lacked is a true mass market; this deal has the potential to change that. Windows Phone 7 is invisible in my local town centre, despite the presence of three specialist mobile phone retailers. That has to change for Microsoft’s OS to succeed.

Sounds good, but there are also reasons why this might not work out well.

  • Currently Apple iOS and Google Android are the Smartphone operating systems to beat. There is no guarantee that Nokia’s change of direction will move the market. After all, if Nokia’s current Smartphones underperform, its new Windows devices may underperform too.
  • A major change of direction is costly in both time and skills. Can Nokia deliver excellent Windows phones in time to claw back market share? In its press release, Nokia says:

    Nokia expects 2011 and 2012 to be transition years, as the company invests to build the planned winning ecosystem with Microsoft.

  • There is no tablet form factor for Windows Phone 7, and Microsoft seems resistant to the idea. Apple and Android exploit the potential of tablets and give app developers the benefit of two similar platforms for both small and medium size mobile devices.
  • Historically, Microsoft has proved a difficult partner. The tie-up with Palm for Windows Mobile a few years back did not save Palm. In mitigation, Nokia CEO Stephen Elop is ex-Microsoft, and if anyone knows how to make this work, he will do.
  • Nokia will have a tough job convincing its own people of the value of this deal – by which I mean employees as well as third-party developers and partners. It is discarding a huge amount of previous investment. This could be mitigated if Nokia is able to support Qt, its primary development platform, on Windows Phone 7; but I have not seen any hint of that yet. In my view Windows Phone 7 needs a native code development option, and Nokia should press to allow it.

Nevertheless, the battle for mobile has just become more interesting. This is a huge boost to Microsoft’s phone and many in the industry will now be taking it seriously for the first time.

Trying out MonoTouch – C# for Apple’s iPhone and iPad

I’ve posted an article on trying out MonoTouch, which builds on the open source Mono project to provide a means of developing apps for Apple’s iOS using C# and the .NET Framework.

It is easy to assume that since the .NET Framework is Microsoft’s technology, using a non-Microsoft implementation is risky. Then again, Mono is open source; and the more usage it gets, the better it becomes. MonoTouch is an important development for the project, since it is a commercial project which might actually be making some money for Novell/Attachmate. While it would be nice to get it for free, it is important that Mono makes business sense as well. MonoTouch has given the Mono project a significant boost.

Using SQLite 3 with Unicode in Delphi

I’ve updated my SQLite3 Delphi wrapper for Unicode in Delphi 2009 and higher. Previous versions of the wrapper ducked the issue by using Ansi strings throughout.

image

I actually used Embarcadero Delphi XE for the development, but I would expect it to work in Delphi 2009 and higher, since it was in that version that Delphi first properly supported Unicode. Converting older Delphi projects is meant to be seamless, except in cases where you are using pointers or doing interop with native DLLs; of course this wrapper does both.

The SQLite 3 API expects either UTF8 or Unicode strings. To be more precise, some functions have Unicode versions indicated with a “16” suffix, and some do not, in which case they expect UTF8 if they accept string values. Although UTF8 strings support Unicode characters, most characters generally occupy a single byte just as in Ansi strings, so one of the things I discovered was that I could not simply rely on PChar, Delphi’s null-terminated string type, which from Delphi 2009 is a Unicode type with double-byte characters. Instead, for cases where the SQLite 3 API expects a UTF8 string, I have used PAnsiChar as before.

It is all somewhat confusing, and there are a few cases where Delphi does not do quite what you would expect. I recommend Marco Cantu’s paper Delphi and Unicode [pdf], one of the best resources I found. This article by Nick Hodges on Unicodifying your code is handy too.

Finally, in the example I keep an object in memory and it is easy to end up with code paths that do not free it. I love this feature of Delphi (since at least 2007) which informs you of your mistake when the application closes:

image

I have uploaded the code and you can find it linked here.

Update: My assumption that Delphi 2010 would work the same way as Delphi XE was incorrect. I have some code that reads a blob field containing a UTF8 string and returns it as a string. I read the stream into a byte array and then cast it to a UTF8String:

str := UTF8String(bytes);

where str is a UTF8string variable. This worked in Delphi XE, but in Delphi 2010 I got garbage. I have modified the code to use a TStringStream and now it works in both.

Microsoft’s new President of Server and Tools–Satya Nadella, from Bing division

Microsoft has appointed a new President of Server and Tools to replace Bob Muglia. He is Satya Nadella, 43, and has been leading the Online Services Division, the bit in charge of Bing, MSN and adCenter. Before that, Nadella led Microsoft Business Solutions, focused on the Dynamics CRM application.

image

It is a big role, and no doubt it is significant that Nadella has a cloud-oriented background within Microsoft. In his first memo in the new role, Nadella says:

I like to have my head in the clouds and feet on the ground (something I learned from Qi).

I track Microsoft financials in a small way, and have observed that while Muglia’s Server and Tools has turned in stellar figures for several years, the Online Services Division by contrast has delivered large losses.

Then again, competing with Google in search is not easy, and Bing is perhaps doing as well as can be expected.

CEO Steve Ballmer has also announced that Amitabh Srivastava, the well-regarded senior vice president in the Server and Tools Business is leaving Microsoft.

Puzzling moves, which suggest to me significant strategy disagreements between Ballmer and the old Server and Tools leadership.

MeeGo NoGo: things look bad for the Intel/Nokia Linux project

A sad post yesterday from MeeGo contributor Andrew Wafaa suggests that MeeGo on netbooks may no longer happen:

Basically by all accounts MeeGo is stopping all work on the Netbook UX. Yup, all our hard work is now almost for nothing 🙁

This is remarkable. The original Moblin project, sponsored by Intel, was all about bringing an excellent user experience to Linux on netbooks. The first netbooks ran Linux, but met resistance from a general public familiar with Windows; yet Linux is more suitable for netbooks than Windows in its present form.

Moblin is different. It’s a friendly way to get the most out of your netbook. It doesn’t work like most other computers because it’s optimized for enjoying media, interacting with your social networks and the internet.

wrote Moblin Community Manager Paul Cooper back in 2009, when netbooks were hot.

The problem: tech trends sometimes outpace corporate planning. Moblin was a good idea in 2008, but nothing was delivered; and by the time it looked like it might be ready, the market seemed to want tablets – or Apple iPads – rather than netbooks; and whatever problem Moblin was addressing was already solved by Google Android.

image

Two years later, in February 2010, Moblin merged with Nokia’s Maemo, creating a new project called MeeGo. The new focus would be tablets and smartphones:

The power and capability of handhelds has reached astounding levels – netbooks have been a runaway success – and connected TVs, tablets, in-vehicle infotainment, and media phones are fast growing new markets for devices with unheard of performance. Our goal is to develop the best software to go with these devices.

said Intel’s Imad Sousou.

So where are the MeeGo smartphones? Well, maybe we will see one at Mobile World Congress next week. But Nokia is in disarray. According to a leaked memo from new CEO Stephen Elop:

The first iPhone shipped in 2007, and we still don’t have a product that is close to their experience. Android came on the scene just over 2 years ago, and this week they took our leadership position in smartphone volumes. Unbelievable.

We have some brilliant sources of innovation inside Nokia, but we are not bringing it to market fast enough. We thought MeeGo would be a platform for winning high-end smartphones. However, at this rate, by the end of 2011, we might have only one MeeGo product in the market.

Perhaps Nokia will progress MeeGo smartphones with renewed vigour; but what looks more likely is that Nokia will embrace a rival platform, maybe Google Android or Microsoft’s Windows Phone 7.

That might well be alongside MeeGo, rather than replacing it, but Nokia needs to focus its energy and I would guess that MeeGo will lose out.

It may be the beginning of the end for a promising project that has progressed too slowly.

Update: Reuters is reporting that “two industry sources close to the company” say Nokia has ended development of its first MeeGo smartphone

Restoring an old Small Business Server 2008 backup: beware expired Active Directory

Seemingly tricky problems sometimes have simple solutions – but you have to find them first.

So it was with this one. I was asked to recover some emails from Small Business Server, from a backup that was about six months old. This SBS runs on Hyper-V using a proven backup system and I decided to restore onto a test system just to recover the emails. All went well until the first boot. The restored SBS went into a reboot cycle. Trying safe mode revealed the error:

STOP: c00002e2 Directory Services could not start because of the following error: A device attached to the system is not functioning. Error Status: 0xc0000001

The suggested fix for this is to boot into Directory Services Restore Mode. In my case this was not possible, because after the first failure the VM booted into Windows Error Recovery mode which does not offer Directory Services Restore Mode. Rather than try to get round this, I simply restored the server again, and took a snapshot before the first boot so I would not have to do so again.

I could now get into Directory Services Restore Mode, though note that you need to log on as .\administrator using the password set when SBS 2008 was installed. I tried some of the steps here with little success. The suggested ntdsutil commands did not work. I had to activate an instance, which by the way is ntds, and then got a message saying the operation failed because the system was in Directory Services Restore Mode and to try rebooting. I knew what the result would be.

In other words, I was getting nowhere. Then I found a user with a similar problem. The reason: Active Directory will not restore if it is older than the “tombstone lifetime”. This is nicely explained here. It is to do replication. Active Directory is designed to replicate between domain controllers, which means it has to keep a record of deleted items. If a particular instance is older than the tombstone lifetime, it could not replicate safely, hence the error message.

Well, kind-of. Note that the error message says, “A device attached to the system is not functioning”. If only it could have said, “Active Directory is too old”, that would have saved some time. Note also that SBS is often the sole domain controller, making the problem irrelevant. Note further that in my case I did not care a jot about replication, since all I needed was some emails.

Still, it gave me an easy solution. Just set the date back in Hyper-V and reboot. Everything worked fine.

In the end it did not cost me too much time, and doing this stuff in Hyper-V while getting on with your work during the slow bits is a lot more fun than when using real systems.

I do find it interesting though how these simple problems can surface as bewildering errors that lead you through a maze of obscure technical documents before you find the simple solution.

Nokia plus Windows Phone 7 – would that be a smart move?

The rumour is that Nokia’s CEO, ex-Microsoft Stephen Elop, is planning a major strategy announcement on Friday February 11. The obvious move would be to embrace a new Smartphone platform, since neither Symbian nor MeeGo look likely to catch up with frontrunners Google Android or Apple iPhone. Could Elop be planning to partner with his former company and embrace Windows Phone 7?

It is a fascinating proposition. Here is the case in favour. For both Nokia and Microsoft, Android is the key competition in this market. The momentum behind Android is deterring both phone manufacturers and operators from investing seriously in Windows Phone 7. Microsoft’s phone is well-regarded, but has made little impact on the general public. Nokia could change that; it could make beautiful Windows 7 phones and get them to the mass market.

Microsoft has also done a good job with the developer tools for Windows Phone 7, with Visual Studio 2010, Silverlight, XNA, and the .NET Framework.

On the other hand, if Nokia were to adopt Windows Phone 7 for its high-end phone platform, would it not alienate its own development community, which is oriented towards Linux and C/C++? I think it would, unless Nokia insisted that as part of its deal with Microsoft, Windows Phone 7 would also support native code development with Qt, Nokia’s cross-platform application framework. This would be great news for Microsoft as well, though it might not recognise it. Windows Phone 7 needs to allow native code development, and Qt is ideal for the purpose. Qt already supports Windows CE, which underlies Windows Phone 7. If Nokia could present Windows Phone 7 as just another platform for Qt, the deal would be palatable for existing Nokia developers.

If Nokia were to announce this, it would transform the prospects for Microsoft’s Smartphone OS as well as helping Nokia to make a renewed impact.

Now for the case against. I am not sure that Qt on Windows Phone 7 would be acceptable to Microsoft, which might prefer to keep developers locked to Visual Studio and .NET; and Nokia has an easy alternative, which is to adopt Android instead. Qt support is still an issue, but there is already an independent project to bring Qt to Android. The combination of the Android and Nokia brands has obvious appeal, whereas taking on Windows Phone 7 would be risky.

The biggest shadow over Windows Phone 7 is cast by Microsoft itself. I do not doubt the commitment of the team which builds it within Microsoft, nor the quality of the developer tools. I do question though whether Microsoft as a whole sees a long-term future for Windows Phone 7 and its “Metro” user interface. The strong hint at CES was that Windows 8, rather than Windows Phone 7, is the basis of Microsoft’s tablet strategy; and if that proves to be the case, then Windows Phone 7 may gradually be displaced. Another puzzle is how Microsoft intends to use “Jupiter”, a rumoured new user interface library for Windows that may well be designed with mobile and touch control in mind. Maybe full Windows with “Jupiter” is the future of Microsoft’s mobile platform, rather than Windows Phone 7? I discuss this in more detail here.

There is enough uncertainty around Windows Phone 7, and enough buzz around Android, that Google’s mobile platform looks to me more attractive than Microsoft’s from Nokia’s perspective. I do not dismiss the Windows Phone idea though; it would be a bold and interesting move.

I expect this post to be very out of date soon, if not by Friday, then certainly by early next week at Mobile World Congress.

Update: A Nokia and Microsoft partnership is looking more likely since Google’s Vic Gundotra tweeted:

#feb11 "Two turkeys do not make an Eagle".

Trying out copy and paste in Windows Phone 7

Microsoft has released an update to the Windows Phone 7 developer tools, which now include support for copy and paste in the TextBox and PasswordBox controls. You can try this in the emulator, though it is not yet available for actual devices.

If you single-click a word (or, I presume, tap) then it highlights. Drag corners appear to left and right of the highlighted word, which let you extend or reduce the selection – but only, as far as I can tell, to complete words.

image

Tap the Copy icon which appears above or over the selected words, and a new icon appears above the virtual keyboard indicating that Paste is available.

image

Now you can tap the Paste icon in the same or another application to insert what you have copied.

Curiously, the act of pasting seems to clear the clipboard. I suppose there are not many occasions when you want to paste the same words repeatedly, but it does happen. If you accidentally pasted into the wrong location, for example, you would have to go back, select and copy again.

Copy also works in the web browser.

image

It works and it will be useful, though it strikes me as a minimal and slightly annoying implementation.

Updated SQLite wrapper for Embarcadero Delphi (and Free Pascal)

A while back I worked on a Delphi wrapper for SQLite 3, which I published on this site as an open source project. Others amended it to support Free Pascal and Lazarus, so you can use it on Linux and on the Mac. I’ve not touched it for a couple of years; but recently received an email requesting support for the SQLite 3 backup API. There are only a few functions involved so I added them to the wrapper, and also updated the Sqlite DLL to version 3.7.5.

Although I used Delphi XE to work on the wrapper, I did the build for the repository with Delphi 7, running in a virtual machine, because I know this version still has plenty of use. The problem though is that Delphi 2009 introduced full Unicode support, causing compatibility issues. My wrapper is compromised because it uses the old AnsiString, so that it works with all Delphi versions. I have in mind to fix this so you get full Unicode support when I have time to do so.

There is no support for Delphi’s data binding, and the wrapper appeals to developers happy to code their own SQL. Of course it works like lightning.

Red Gate to charge for .NET Reflector, runs into storm of protest

Tools company Red Gate is to discontinue the free version of .NET Reflector, a popular tool for debugging and decompiling .NET code.

image

The tool itself is amazing. It takes advantage of the fact that .NET code is not compiled to native code until runtime. The code that is distributed is in .NET “intermediate language”, which means it can easily be decompiled. Reflector makes this as easy as opening a file. This is invaluable for debugging when you do not have the original source code, though a further implication is that if you want to protect your source code you need to obfuscate it.

Reflector was created by Lutz Roeder, who shared it freely with the community. In 2008 Roeder sold Reflector to Red Gate, stating:

Red Gate will continue to provide the free community version and is looking for your feedback and ideas for future versions.

Red Gate developed Visual Studio integration and some further features, offering a free version as well as a paid-for premium edition. Now it has decided this is no longer viable. Watch this video as distinctly uncomfortable CEO Simon Galbraith answers the question “Didn’t we promise that Reflector was always going to be free?”:

Right now owning Reflector doesn’t make commercial sense. Further development of Reflector doesn’t make commercial sense. Reflector’s a tool that needs to stay up to date. We need to spend money on it. At the moment we can’t do so in a commercially justifiable way.

We’re really regretful that we ever made such a statement that we were going to try not to charge for it. In hindsight we wish we hadn’t done that. It was never a promise by the way. Two years ago we thought we could make a success of it without having to charge for it, it turns out that wasn’t the case.

Galbraith says that Red Gate had expected two benefits from Reflector: sales of other tools to Reflector users, and up-sell to the premium version. Neither has really happened, he says, adding:

We know that people are going to be cross with us.

What has particularly annoyed users in the feedback forum is that the existing free version is time-bombed, and will expire on May 30th. So users will be forced to upgrade.

i have been a happy (paying) customer of red-gate for some time now – sql tools, .net tools.
i have told many other developers of your products – happy to explain how good they are and how awesome red-gate is.
i won’t be doing that any more. IMO you have managed to destroy your company reputation such that purely on principle i won’t be recommending you to anyone anymore.

says one user.

Reflector has actually been time-bombed for years. I have a download from 2008, and if I run it I get this message:

image

If I click Yes, I am told that automatic update is impossible and directed to the Red Gate download page. If I click No, the dialog closes. In either case, the Reflector executable deletes itself. This is not so bad if you can download another free version; but following the change of policy that will not be the case.

Red Gate might not have made money from Reflector, but now it has the opposite problem: bad PR because of withdrawing an existing and popular free tool.

The price for the new Reflector will be just $35.00; not much for such as useful tool. There is nothing wrong with a software company charging for its work. This is a difficult transition though, and the question is: would Red Gate have been better off releasing Reflector back to the community and ceasing its own investment, rather than making a renewed effort to make it a viable commercial product?