Top Apps Coming to Windows Phone 8

One of the biggest complaints against Windows Phone 7 I have heard is that the top apps are missing and the ones that are on the platform too way to long to appear. It’s obviously been tough for Microsoft to get people to think of it as a day one requirement to support the platform but they now seem to be making progress. The Windows Phone Marketplace now has over 120.000 apps and Microsoft announcing new “top apps” coming to the platform. Earlier today Microsoft announced Pandora as a great new comer to the Windows Phone Store plus it comes with a 1-year of free music

Microsoft has also announced other big name apps apps and games that will be coming soon to the Marketplace. These include the brand new Angry Birds Star Wars, Temple Run, and Asphalt 7, Cut the Rope, Where’s my Water/Perry games.

Microsoft has also improved the Facebook and Twitter apps on Windows Phone to be able to take advantage of the “live apps” feature and show you updates on the new lock screen.

Personally I think this could be MS turning a corning. Supporting the standard game engines and making it easy to port apps and games between Xbox, Windows 8 and Windows Phone 8 will hopefully make it a first class platform for new apps to support.

Advertisements
Posted in Uncategorized | Leave a comment

Microsoft Surface

So the Microsoft Surface has launched with Windows 8 now and a lot of people have posted reviews of it. I have been in a Microsoft Store in Seattle all morning playing with one and looking at all the new touch screen all in ones and laptops and tablets and stuff that are there.

I can honestly say that I am very impressed with this move by Microsoft. I know a lot of people are dissecting the hardware and are comparing things based on the RAM and the disk space but I am impressed on a different level to that.

I think the Surface really represents a wholesale change in the way Microsoft is thinking about its technology. The device itself is fantastic to hold and use and the new Start screen begs to be touched. The screen is responsive and the software is fluid.

The fact that Microsoft has designed all the hardware from scratch and though about how people are going to use shows a total shift from the way they seemed to operate before. I think the build quality of the device and the beauty of the Windows 8 UI is really going to impress “normal people”. Microsoft has also attracted developers and there were plenty of business people running Windows XP Tablet Edition back in the day but it’s this shift to attracting the masses that will make a difference to the company .

Its getting people like my mother to use it and to have people talk about it and show it off to their friends. Not just the people who always talk about tech but people outside of the normal circles of chatting about it. I think the $1.5 billion they have supposedly spent on advertising should help accomplish this.

I think they really have brought out a winning platform here and people who get windows Surface, Windows 8 PCs and Windows Phone 8 devices will be really happy with them. They will talk about them and this will become a winning platform combination.

Let me know what you think about the platform

Posted in Uncategorized | Leave a comment

From comment spam to reCAPTCHA

So I have now added reCAPTCHA to the comment section of my blog. I apologize to people who have to take this extra step to post comments when they have something valid to say.

I made the decision to go this route this morning while going through 319 new comments and marking them all as spam.

Hopefully it would upset you especially when you know that you are actually contributing to something

Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Sorting for an ObservableCollection

I am porting my Live Countdown app to Windows 8 in order to help my learn Windows 8 and to spread the goodness to more people ūüôā

However one problem I had was sorting an ObservableCollection without causing it to reset. I got round this issue by implementing the QuickSort algorithm as an extension method so I could do in place sorting on the collection.

Continue reading

Posted in Utility, windows8 | Tagged , , , | Leave a comment

Live Countdown for Windows Phone

I have released my latest app for Windows Phone. Its Live Countdown available from the Marketplace at http://windowsphone.com/s?appid=2c04be67-e60e-49dc-a40a-1a77d7471254

Here is the blurb from Marketplace:

The LIVE COUNTDOWN app gives you exactly that! Whatever event is happening in your life, whether it‚Äôs a new baby, your birthday, wedding, or your summer vacation, you can now have it counted down on your home screen. The number of days until your big day will be displayed on a LIVE TILE along with a picture of your choice to represent your day. Choose from an extensive catalogue of built in images, or choose you own from your image library or even take a new one especially for it. Don‚Äôt want money on “Due Date Counters” any more. Grab this amazing free app today and start looking forward to the great things this year

Posted in windows phone | Tagged , , , | Leave a comment

Creating a custom Windows Phone Live Tile

I’m writing a Windows Phone app and I want it to have Live Tiles. However I want it to show a Count on the front of the Live tile which is larger than 99. Currently any number larger than 99 shows 99 as the count. I wanted to show bigger numbers and therefore from what I can gather, I had to roll my own for this. I have done so by drawing my own Live Tile background image.

Drawing a custom image was pretty easy on Windows Mobile or on any other platform with GDI+ support. However in Windows Phone and Silverlight its a little harder. I found a  great tool called WriteableBitmapEx (http://writeablebitmapex.codeplex.com/). This great tool gives GDI+ style methods as extension methods on a Writeable Bitmap. I was then able to use this to draw the count like this:

// Define the filename for our tile. Take note that a tile image *must* be saved in /Shared/ShellContent
// or otherwise it won't display.
var tileImage = string.Format("/Shared/ShellContent/{0}.jpg", myUniqueTileId);

var source = new BitmapImage();
source.CreateOptions = BitmapCreateOptions.None;
var imageUri = new Uri(theEvent.ImagePath.Substring(1), UriKind.Relative);
System.Windows.Resources.StreamResourceInfo s = Application.GetResourceStream(imageUri);
source.SetSource(s.Stream);
bitmap = new WriteableBitmap(source);

//rectangle dimensions
int width = 50, left = 115, top = 10, height = 30, cornerRadius = 5, right = 10;

var fontFamily = new FontFamily("Segoe WP");
var fontForeground = new SolidColorBrush(Colors.White);

//Textblock to show the number
TextBlock tb = new TextBlock();
tb.Text = sleeps.ToString();
tb.Foreground = new SolidColorBrush(Colors.White);
tb.FontSize = 20;
tb.Foreground = fontForeground;
tb.FontFamily = fontFamily;
tb.Margin = new Thickness(12, 4, 12, 4);
tb.Measure(new Size(width - tb.Margin.Left - tb.Margin.Right, height - tb.Margin.Top - tb.Margin.Bottom));
tb.Width = tb.ActualWidth;
tb.Height = tb.ActualHeight;

Color rectColor = Colors.Black;

//workout where to put the black rectangle behind the number
width = (int)(tb.Width + tb.Margin.Left + tb.Margin.Right);
height = (int)(tb.Height + tb.Margin.Top + tb.Margin.Bottom);
left = 173 - (right + width);

//Draw the Rectangle
bitmap.FillRectangle(left + cornerRadius, top, left + width - cornerRadius, top + height + 1, rectColor);
bitmap.FillRectangle(left, top + cornerRadius, width + left + 1, top + height - cornerRadius, rectColor);

//Draw the rounded corners
bitmap.FillEllipse(left, top + height - (cornerRadius * 2), left + (cornerRadius * 2), top + height, rectColor);
bitmap.FillEllipse(left, top, left + (cornerRadius * 2), top + (cornerRadius * 2), rectColor);
bitmap.FillEllipse(left + width - (cornerRadius * 2), top, left + width, top + (cornerRadius * 2), rectColor);
bitmap.FillEllipse(left + width - (cornerRadius * 2), top + height - (cornerRadius * 2), left + width, top + height, rectColor);

//render the TextBlock over the top
bitmap.Render(tb, new TranslateTransform { X = left + (width / 2.0) - (tb.Width / 2), Y = top + (height / 2.0) - (tb.Height / 2) });

// Invalidate the bitmap to make it actually render.
bitmap.Invalidate();

// Create our bitmap, in our selected dimension.

if (store.FileExists(newPath)) store.DeleteFile(newPath);

// Create a stream to store our file in.
var stream = store.CreateFile(tileImage);

// Save it to our stream.
bitmap.WritePNG(stream);

stream.Flush();

// Close the stream, and by that saving the file to the ISF.
stream.Close();

This works pretty well for me. I have an Id for the thing the Live Tile relates to. If it was a weather app it could be the zip code or an Id for the town for example. This needs to be used to keep the tile images from being written over each other.

To use an IsolatedStorage file as a Live Tile it needs to be in the /Shared/ShellContent folder.

The Uri that you put as the background image for the tile needs to start isostore: so it ends up like:
isostore:/Shared/ShellContent/CustomImage1.png

This will then work as the tile image:

Live Tile Example

Posted in Uncategorized | Leave a comment

WriteableBitmap – Invalid Pointer from Constructor

I have had a really irritating issue with my windows phone app that I am currently working on. I am trying to create live tiles with numbers bigger than 99 shown for the Count property of the TileData.

To do this I have decided to draw my own images with the Count on them and then save them in Isolated Storage for the tile. There are many problems trying to get this done, but they all seem to stem from the fact that Windows Phone or Silverlight in general perhaps does all its image loading / rendering in a lazy or at least background fashion. The problem with this is loading an image and trying to do stuff straight away with it seems to sometimes mean the image isn’t loaded in time.

A common problem this causes and it certainly caused me was that from this code:

var source = new BitmapImage(new Uri(imagePath, UriKind.Relative));
bitmap = new WriteableBitmap(source);

I kept getting an Exception with the message “Invalid Pointer”. This irritating message seems to be that the Bitmap named ‘source’ hasn’t loaded the actual Bitmap data when the WriteableBitmap tries to use it.

The common suggestion was to set the CreateOptions on the Bitmap to None before you “use it”. However the actual fact is you have to set it before you set the source. In my code the source was being passed in as a Uri to the constructor. Therefore I figured I’d try setting the options first, then setting the Uri. However I still had the issue ONLY when doing the logic immediately on app startup. The actual solution that works is:

var source = new BitmapImage();
source.CreateOptions = BitmapCreateOptions.None;
var imageUri = new Uri(imagePath, UriKind.Relative);
System.Windows.Resources.StreamResourceInfo s = Application.GetResourceStream(imageUri);
source.SetSource(s.Stream);
bitmap = new WriteableBitmap(source);

Passing the stream is the ONLY thing that seems to work reliably.

That got me passed that little issue so I thought I’d post it here as most other places I found information it was for loading the image from Isolated Storage. I’ll post more info on that soon enough.

Posted in Uncategorized, windows phone | Tagged , , | 5 Comments