Amadiere.com

Fourteen and a half crazy frog burpers

4th November 2010

HTC HD7 (Windows Phone 7) vs Apple iPhone 4 (iOS 4)

Filed under: Reviews,Windows Phone 7 — Tags: , , — Alex Holt @ 10:08 pm

4.3inches of beautyI’ve been a fan of the iPhone since the 3G came out and it’s been the first phone that I’ve actually enjoyed using throughout its entire lifespan. Upgrading to the iPhone 4 was something of a massive upgrade at the time as well – the speed difference alone is outstanding when compared to the 2 year old 3G! However, the one thing that’s always bugged me was the fact I needed an MacBook to develop on it. I can’t afford one basically, so that means I can’t develop on their platform. Fair enough, it’s their call and I’m not overly worried about it for now. However, when Microsoft announced that they would be launching themselves into the mobile phone operating systems market (and Windows Mobile 6.5 doesn’t count as “being in the market – I’m sorry) and that I’d be able to write apps written in Silverlight and C# – I was sold. I had to get one of the devices. I whittled down the time to launch by drinking coffee and occasionally leaving the house. Eventually, I managed to get hold of a device and begin to use it. I thought I’d write my observations down for anyone interested to know how they both compare.

Why did I get the HTC HD7:

There were a number of reasons. Primarily because the 4.3inch screen is great (it still fits in my pocket just fine) and more importantly, it had 16Gb of space. With none of the WP7 devices offering SD Card readers at launch (in the same way iPhone’s do not), space was at a premium. Having been limited by the iPhone 3G 8Gb before, I wasn’t going to make the same mistake again quite so lightly. All the reviews I’d read had given the device good reviews and it seemed like one of the best devices that I could have got at launch time.

How did they compare?

Screen Quality: You know, I really can’t find any differences between the two devices. Maybe it’s my untrained eyes, but the WP7 is definitely in the league with the iPhone 4 and it’s retina display. Touch wise, they both behave remarkably well and are extremely responsive. I haven’t found myself pressing harder because my gestures weren’t detected correctly.

Sound Quality: I was surprised about this one and I never actually thought about it too much in the run up to buying it, but the quality of the audio produced by the HD7 far outstrips that of the iPhone 4. I listed to a bunch of my songs, including Bat Out Of Hell (which I’ve listed to on countless different formats) and the richness of the sound is amazing. Coupled with the good use of surround sound, the HD7 made for a great listening experience. I didn’t particularly like the earphones that came with it though, but then, the same can be said about the iPhone ones… so Meh.

Maps: I think unfortunately, this might something odd with my location, but the HD7 picks up my location as 12 miles from where I’m actually sat. A touch inconvenient for a “where’s my nearest” feature. The Windows Phone 7 devices all use Bing maps and the iPhone uses Google maps. For the most part, they behave exactly as you’d expect them too and they are good for what they do. The iPhone really begins to excel again with it’s built-in street view.

App Store: Unsurprising I guess that iPhone would win this battle – it’s had almost 2 years of a headstart on the Windows Phone 7 market and in that time has amassed a horde of really amazing apps. As for the Marketplace itself, I think neither really excels at helping users find the applications that they might like. Genius in the Apple AppStore has never really given me much luck, and while the Microsoft version is currently an easily navigated setup, I fear that once content begins to flood in, some of the ease-of-use will quickly wash away.

App Development: As an ASP.NET and C# developer I’m going to be bias on this one. But I do consider the platform to be a much more simplistic way to develop. The pain of Objective-C is that the developers must delve quite low to the OS, performing their own garbage collection and other similar tasks. Silverlight, which is used by Windows Phone 7, is a very different experience indeed and you can spend the time concentrating on your App. Visual Studio 2010 – it really is awesome and to be able to have a truly awesome free development environment cannot be under estimated. And while Microsoft is untested in this water, it’s Application Acceptance Guidelines appear to be a lot more black and white than Apple’s which are a notorious issue.

Camera: To be honest, I’ve not really exausted the tests on the camera yet, but from what I can tell – the iPhone wins this battle. It’s HDR function is actually pretty nifty and as a result, the pictures seem to be some of the best I’ve seen from camera phones. The HD7 isn’t quite as good. Sure the pictures are ok, but inside, I’ve found things are a little grainier than the iPhone which has been frustrating.

Web Browsing: The experience is quite similar between the two browsers. Certainly both are able to pinch and zoom and scroll and throw themselves around the pages without too much hassle. But I have found that currently, a lot of websites (including Google Reader for example) treat the HD7 as a primitive mobile browser and show it a very reduced and scaled down browser experience. This isn’t an issue with the phone and given time, I’m sure that Google will update their detection mechanisms and there will be fully fledged Smart Phone RSS reading. Other than that, I would say that I’m a little disappointed with the limitation of the favourites (there appears to be no way of organising the list) and more specifically at O2 for making Yahoo! the default search engine when typing into the browser address bar (an horrific pain in the posterior given that Yahoo! don’t detect that it’s a decent phone either!).

Other things I’ve noticed about the HTC7:

  • The Calendar is great. In additon to putting things in your diary with alerts to remind you when they are about to happen – your events in general appear on your home screen, showing you today and tomorrow’s events. Giving me a fighting chance of remembering the cat’s vet appointment more than 15 minutes beforehand!
  • The ringtone’s couldn’t be changed, or at least, not that I could spot.
  • No iTunes means no stupid updates pestering me to install Safari or Mobile Me or other Apple products which I have absolutely no desire to use. iTunes is like the modern day equivalent of Real Player from a few years ago. Zune is a nice enough experience. I found being about to sync my phone with the music I wanted was a lot easier and less hassle than iTunes. The same with my Podcasts and Videos – a great step forward from the alternatives.
  • Facebook integrated with my contacts is fantastic – it makes the whole experience seemless. While I don’t frequent Facebook overly often, I have a good number of friends and with all this merged into my phone book, I can on a whim simply write on their wall as easily as sending them a text. You can of course, take the alternative route and only import Facebook contact information for the people you already have Contacts for – which might tickle the fancy of more people.
  • The context search is useful. One of the three touch buttons at the foot of the phone (“Back” and “Home” being the other two) is for search and depending on what you are doing at the time, it searches different things. E.g. when in your People Hub (phone book) is searches for a contact, or when in the browser, it searches the web. Useful.

Summary:

The bottom line is that currently, I’m missing all the Apps that I had on my iPhone. Plain and simple. For that reason alone, the Windows Phone 7 is second favourite at the moment. But as this is something that I imagine will change in time, I do think that the phone will get better and better. And I for one, am really looking forward to seeing if Microsoft can whip Android into a real challenge to the iPhone and more importantly, challenge the iPhone itself! More competition in a marketplace is often a great thing – and I that’ll be true here.

10th September 2010

Isolated Storage on Windows Phone 7

Filed under: C#,Databases,Windows Phone 7 — Tags: , , , — Alex Holt @ 9:30 pm

One of the most amazing omissions from the Windows Phone 7 OS is an SQL Server of some description that applications can use (I think there is a SQL Server Compact edition baked into the build, but it’s only exposed to the native apps). This leaves anyone familiar with doing all their storage via relational databases in a bit of a lurch.

Having a look around, there were a few work-arounds, namely third party libraries such as Perst & Sterling. These act as a layer of abstraction that allow you to use LINQ to access your objects and could be of benefit for some of the more complex applications. I found both of them to have their drawbacks.

Perst: From McObject is one alternative, but if you plan on doing a commercial application, you should bare in mind their licensing, of which, their FAQ says:

No, Perst is not free. McObject Perst is available under a dual license. Under the GPL, you may evaluate the source code free of charge and you may use Perst free of charge in an application for which the source code is also freely available. If you wish to use a Perst in an application but do not or cannot redistribute your application source code, you can use Perst under a commercial license.

Sterling: This seemed promising, but I had a number of issues getting the code to work (it was late, in fairness) I decided to give up.

In reality though, most applications that are going to be made don’t need any complicated database structure behind them. Database implementations are most likely going to be overkill. This is where I decided to do what probably the majority of WP7 developers have decided to do, and “Roll-Their-Own” database solution. Mine is based on a general accepted practice, using XML Serialisation to store my POCOs. While it might have limitations and performance issues later down the line, for now – it’s performing very admirably and there seemed no point in premature optimisation just yet.

My Solution

The main class I created (MyDataContext.cs) contains the functions for both saving and loading the data, as well as the ‘schema’ for the entire database.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using IsolatedExampleApp.Data.Models;
using System.IO.IsolatedStorage;
using System.IO;
using System.Xml.Serialization;
 
namespace IsolatedExampleApp.Data
{
  public class IsolatedDatabase
  {
    public IsolatedDatabase()
    {
      // For each model that is a list item, you need to add a initialising statement to the Constructor
      Albums = new List();
      Artists = new List();
    }
 
    // These properties effectively form the publicly viewable schema of the database.
    public List Albums { get; set; }
    public List Artists { get; set; }
    public Options Options { get; set; }
 
    public void Load()
    {
      using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
      using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream("IsolatedExampleApp.txt", FileMode.OpenOrCreate, FileAccess.Read, store))
      using (StreamReader reader = new StreamReader(stream))
      {
        XmlSerializer serializer = new XmlSerializer(typeof(IsolatedDatabase));
        var unserialized = reader.EndOfStream ? new IsolatedDatabase() : (IsolatedDatabase)serializer.Deserialize(reader);
 
        // Each schema is repopulated with information when the app is loaded.
        Albums = unserialized.Albums;
        Artists = unserialized.Artists;
        Options = unserialized.Options;
      }
    }
 
    public bool Save()
    {
      try
      {
        using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
        using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream("IsolatedExampleApp.txt", FileMode.Create, FileAccess.Write, store))
        {
          XmlSerializer serializer = new XmlSerializer(typeof(IsolatedDatabase));
          serializer.Serialize(stream, this);
        }
        return true;
      }
      catch (Exception ex)
      {
        return false;
      }
    }
  }
}

As you can see from the code above, as you develop more data stores, the code needs updating in multiple locations.

  • Properties need setting for each one (they are the publicly available access points for the data).
  • Any LISTS<> require their lists initialised by the Constructor method.
  • When the data is ‘Load()’ed, each property must have it’s values manually set.
  • All the Models still need defining elsewhere in your application (in my example above, they are in the IsolatedExampleApp.Data.Models namespace.

If you can overlook this repeated typing, then this seems to be a good starting point for persisting data in your Windows Phone 7 Application. To use it should then be fairly straight forward.

_db = new IsolatedDatabase();
_db.Load();
 
// Adding an album...
_db.Albums.Add(newAlbum);
_db.Save();
 
// Deleting an album...
_db.Albums.Remove(deleteAlbum);
_db.Save();
 
// Add or Update an album...
Album existingAlbum = _db.Albums.Where(x => x.ID == album.ID).FirstOrDefault();
if (existingAlbum != null)
{
  Delete(existingAlbum);
}
Add(album);
_db.Save();
 
// Or just getting a specific album...
IEnumerable albums = _db.Albums as IEnumerable;
return albums.Where(x => x.ID == id).FirstOrDefault();

Any feedback, thoughts, options and optimisations for the above code will be well received. Happy isolating!

30th August 2010

Windows Phone 7: Getting Started Link-dump

Filed under: Windows Phone 7 — Alex Holt @ 5:25 pm

Windows Phone 7As you’re probably aware, Microsoft is finally going to attempt to enter the Smart Phone OS market with it’s new Windows Phone 7 operating system /platform / ecosystem. It’s going to have a hard time getting started (Android and particularly the iPhone OS have a gigantic lead and devoted user-base), but I think it has a good chance. Looking at some of the reviews of the hardware and it’s performance with the new OS, things are looking promising for the big M, if that is, they can pull off the marketing and get enough hardware vendors on-board.

One of the things Microsoft will be hoping on is a massive uptake of application developers, and to try and encourage that they’ve released and helped circulate a bunch of things to the community! This post hopes to point to some of the articles, videos, blogs and other sites by both Microsoft and others to help you learn and get started with WP7.

Obviously, before you get started, you want to download the various developer tools. They are currently in Beta and downloadable here. It’s been announced that the full non-Beta set of tools on the 16 September 2010. The tools are free – the only bit you pay for is a subscription that allows you to post applications to the Marketplace. That’s currently being listed as £67 GBP

Links:

Videos & Labs

More resources:

Theme designed & built for Amadiere.com by Alex Holt. Powered by WordPress