Support for Windows Phone 8.1 WinRT for Coding4Fun

Earlier this year, I took the responsibility of ensuring that  Coding4Fun toolkit supported Windows Runtime apps on Windows Phone 8.1. I spent a good part of March / April porting major chunks of code without porting XAML.

Occasionally I was reminded of the pending work by both Clint Rutkas and others, namely Glenn Versweyveld. After another round this week, I decided to take advantage of the quiet time I am having to push this through.

I have created a fork of coding4fun repo on codeplex and so far this is what i have done

  • Coding4Fun.Toolkit updated to support universal apps (Win8.1 and WP8.1)
  • Coding4Fun.Toolkit.Audio updated to support universal apps (Win8.1 and WP8.1)
  • Coding4Fun.Toolkit.Storage updated to support universal apps.
  • Created Coding4Fun.Toolkit.Controls project to explicitly support WP8.1
  • Added Tile, ImageTile, SuperImage, ColorHexagonPicker, BubbleChat & BubbleChatTextBox controls

Once parity with existing Win8.1 lib has been achieved, the next version of toolkit will be released on Nuget.

Lumia 830 – The affordable flagship

About a month back, I received a Lumia 830 review device from @Connects team. Without them, I wouldn’t be able to review / play around with so many devices

The device itself ships in a new slim line package.. I am sure you don’t give a hoot about unboxing.. personally I don’t and like a child, I am eager to see what’s inside. Ripping the packaging open received a Lumia 930’s cousin. This one was orange unlike the 930 (which was green). The first thought on picking it up was my goodness it is light.

1Shot_20141020_122544 1Shot_20141020_122528

The hysteria of a ultra light device was rather short lived. I tried to find SIM slot and discovered the removable shell. Popping it open revealed the absence of battery and that explained the lack of weight. Silly me. It however is a 1 mm or so thinner than 930 and when holding the device it feels great.. slightly better than 930 if I may say so.

Like the 930, 830 takes Nano SIM (which is a shame) however it has micro SD slot so users can increase the memory. This is something most high-end Lumia devices lack and something I could never really explain why. All low end devices allowed SD cards yet high-end restricted users (except 1520) – not that those where particularly slim or lightweight (if that was ever the main reason).

1Shot_20141020_122714 1Shot_20141020_122756

The Lumia 830 also supports wireless charging and you can see the induction charging circuit on the back of the removable shell. Like others, I also noticed that when wireless charging the devices makes noise – if you use wireless charging.. don’t do it on your bedside table as you go sleep 🙂 it’s rather annoying.

Lumia 830

  • Quad core snapdragon S400
  • 1GB RAM
  • SD Card expansion
  • Nano SIM
  • 5 inch 720p display
  • 10 MP camera module

Lumia 930

  • Quad core snapdragon S800
  • 2GB RAM
  • Nano SIM
  • 5 inch 1080p display
  • 20 MP camera module

I distinctly remember that Lumia 930 warmed up substantially while I was setting it up and I experienced the same over the course of normal usage. This is something I have commented often and taken up with Microsoft Mobile.

With Lumia 830 it never warmed up. I used the device over 2 weeks as my main device and not once did I feel it as warm. Sure I reviewed 930 in summer and 830 in autumn 🙂

From a photo hobbyist perspective, I thoroughly enjoyed Lumia 830.. sure it doesn’t have the numbers that Lumia 1020, 1520 and 930 have but it took great day time and night-time pictures.

My 1shot app worked like a breeze and here are some of the samples are below. My only concern with Lumia 830 is the price. Its being marketed as affordable flagship. If I put on my ‘spec whore’ glasses on, it’s very midrange spec and not flagship spec. Don’t get me wrong it performs great but it’s not flagship spec. Another point is the price. Lumia 830 can be purchased for £265 or so on Lumia 930 on the other hand Lumia 930 costs £325.
Sure £60 is a difference but there is a big freaking difference in spec.

The Lumia 830 should be selling closer to the price range of Lumia 730 (£189).. different shape, size, design and similar price.. this device does not compete with high-end Lumia so why does it do so on price?

1Shot_20141022_074232 1Shot_20141022_122401 1Shot_20141101_162627 1Shot_20141101_181559 1Shot_20141101_182040 1Shot_20141101_182117 1Shot_20141101_193933 1Shot_20141101_193941 1Shot_20141103_095539 1Shot_20141103_115741

Lumia 930 – 1 week on #ConnectsTrial

For good part of last 6 months, I ensured that I took a moment to bug @Connects team w.r.t Lumia 930. Of course it wasn’t available back then.. they knew it, I knew it but that had to be done. I even reminded them that they never sent me a 1520 to review 🙂 and I suppose it worked 🙂

On 14th of this month, I got an email stating that they have 930 and I could be the first one to get my hands on it.. quickly filled out the form.. bang bang.. they dispatch the device the next day. I patiently waited good part of the morning for DHL to bring it in… At noon, I get an email stating package awaiting to be collected!!

The packaging isn’t brick box like earlier Lumia models but a flatter version like the one for Lumia 630.. I suppose this is the packaging for gen 2 devices.
930-Pic1 930-Pic2 930-Pic3 930-Pic4

The device is striking.. even without switching it on that much is clear.. the screen reminds me of Lumia 800’s curved glass and it is ever so slightly curved. The aluminium and the back shell remind me of Lumia 925 but its significantly flatter.. in fact the dimensions of 930 are about the same as Nexus 5. The back is tapered to give a feeling of thinness. I am not a big fan of green but I’d take the green or orange models instead of white or black ones. The green gives a nice neon lightening effect on a white table.. it is remarkably pleasant.

The first thing I did after powering it on was restored a Lumia 1020 backup on it. The device did warm up during this time and while all Lumia devices do warm up, I think aluminium chassis aids heat flow. The AMOLED display is just gorgeous.. At 441 dpi, it is significant ahead of any other devices out there oh and its full HD – 1080p. The device use Snapdragon 800 chipset and comes with 2GB of RAM. The outcome, its snappy.

It comes with 20MP CMOS as opposed to 40MP CMOS in Lumia 1020 but the combination of faster SoC and smaller CMOS means that taking pictures is a pleasure.. Here is a test capture showing speed differences.. both 1020 and 930 are set on 10 second delay.. I have tried best to tap at same time

the lens in 930 is wide though not as much as that of 1020. min focus distance is similar to that of Lumia 1020. You can view some of the pictures I have uploaded and judge for yourself

The battery life is similar to that of Lumia 1020.. my usage gives me just enough to last through the day. I have occasionally seen it warming up but I think a firmware might be due to fix that issue. Another side note, on a white background, I have seen the screen flicker a bit.. again a firmware update should sort that out.

I did power my 1020 a few times and I find it offensively slow and laggy. except for the 40 MP sensor I don’t cant think of anything that would pull me back.. I would trade it all in for a Lumia 930. Infact I am seriously thinking how on earth are @Connects team planning to get this device back.. they really think I am joking.. sigh.. I suppose they are in for a surprise 🙂


Nokia Normandy – a cause for concern ?

A Nokia Android device would be mean a wet dream for many 🙂 Being a ‘softie at heart, I was very glad to have Nokia joining Microsoft as a Windows Phone Partner. Now and again I see examples of how they might have contributed to certain API

Of course I have read umpteen number of times that Nokia would have been better off had they gone with Android. Every 2nd person would tell you that they love Nokia’s industrial design and if offered a choice,  they would jump to Nokia’s android offering (if there was one). Enter Normandy – an extensively leaked device that has generated much marketing for Nokia – Metro UI skinned over Android. This has left many salivating…

So will Normandy see the light of the day and what happens when Microsoft completes the purchase of Nokia Devices division ? Is it really a Trojan horse like many would like to believe ?

The more I think about it, the more unlikely it seems – every decision whether its short term or long term is based on economics. Lets start with licensing

Licensing cost:

Google’s Android source is freely available and anyone can fork it and use it create a custom android distro. Most stock android apps are a part of Google services and that has to be licensed. While OS can be used freely, getting a forked distro at part requires considerable work.

Additionally from the approximately $220 million income, a guestimate mentioned something in the region of $200 million as patent related income from Android device manufacturers etc. If Microsoft itself adopts Android, I doubt it can continue to collect patent licensing fees – must read on reciprocal licensing terms of android later.

Its all about Services:

That is an interesting notion. Apple primarily makes money off device sales and all supporting services generally break even – even with multi billion downloads, the App Store and related income just breaks even. In Android world, Samsung makes more money from Android than Google primarily because its hardware margins that generate most revenue.

Of course google does have plenty of services and in addition to licensing them, Search is the only service that makes most contribution.

What would Nokia in the short term and Microsoft in intermediate term bring forward for Normandy ? Well Microsoft’s Bing and Xbox related services. Whilst Bing is great for English language results, I don’t know any non-English speakers who use Bing. Xbox Live doesn’t really work on Phones, Music / Videos are just that – they provide an option just like iTunes or Google Play. Office would be nice but again it doesn’t earn any money on devices.

Having Office and a few other core application would sweeten any Microsoft offering however would generate little revenue Oh and there’s Skype – it offers better products on iOS and Android than Windows Phone

Flood market with cheap device:

Normandy’s spec are very much like those of Lumia 520. While that is one of the most selling windows phone, I always advice people to buy 720 or better. One of the newest / cheapest Android Devices – Moto G has a substantially capable hardware. If Nokia / Microsoft take on Android, they will spend a good amount of time optimising runtime to make it run on poxy hardware. Again if the expectation is to win the market with low end devices, there is little money to be made from devices.

Final thoughts

I personally feel that all these considerations make it very unlikely that Microsoft will ever touch Normandy. Microsoft has agreed to purchase Devices division and both Asha and Lumia brands will come over to Microsoft. There is no mention of Normandy and that would have to be an additional consideration. I think Normandy was means to make Microsoft take Nokia seriously. Nokia itself (once transaction goes through) can only release anything mobile on 1st Jan 2016.

If you want me to speculate, i’d say there is a greater probability of Normandy staying hidden until 2016 – of course weird this have happened.

High Performance Touch Interface #wpdev #wp7dev

Every now and again i come across developer questions like why is manipulation delta slow etc. Let me tell you why.

UIElement Silverlight for #windowsphone exposes a few events like

Public eventSupported by Silverlight for Windows Phone ManipulationCompleted Occurs when a manipulation and inertia on the UIElement is complete.
Public eventSupported by Silverlight for Windows Phone ManipulationDelta Occurs when the input device changes position during a manipulation.
Public eventSupported by Silverlight for Windows Phone ManipulationStarted Occurs when an input device begins a manipulation on the UIElement.

These are high level touch interfaces and there is a significant overhead in reporting (and hence delay etc).

If you are say drawing on a bitmap or canvas, you dont want a min delta change before event is fired. For that lets look at low-level interface exposed in Silverlight.

Public eventStatic memberSupported by Silverlight for Windows Phone FrameReported Occurs when the input system promotes a Windows 7 touch message for Silverlight.

Touh.FrameReported is a low level method and has little overhead and is very very precise. Let me give you a code sample

Touch.FrameReported += Touch_FrameReported;

you can do above in Loaded event. Here’s the implementation of the Touch_FrameReported handler. WorkArea is Canvas in this. I have also used this in conjugation with WritableBitmap

private void Touch_FrameReported(object sender, TouchFrameEventArgs e)
        // Determine if finger / mouse is down
        point = e.GetPrimaryTouchPoint(this.workArea);
        if (point.Position.X < 0 || point.Position.Y < 0)
        if (point.Position.X > this.workArea.Width || point.Position.Y > this.workArea.Height)
        if (this.lbLetter.SelectedIndex == -1)
        switch (point.Action)
            case TouchAction.Down:
                draw = true;
                old_point = point;
                goto default;
            case TouchAction.Up:
                draw = false;
        MessageBox.Show("Application encountered error processing last request.");

I hope this is useful to #windowsphone developers out there.

Alarm Clock – Multi alarm supported added #WP #WindowsPhone

a few users asked me to provide my alarm clock app While it was not difficult it was a slightly complicated exercise that involved issues with user display and consuming underlying apis. Now i am storing user created alarm data by itself and using that to create underlying sytem alarm notifications.

I only have to finish localisation of the app since i hardcoded all the strings i needed. Will try to finish it off today evening

Cool Camera #WP #WindowsPhone @CoolCameraWP

Cool Camera has been udpated to 1.9. I just finished uploading the new XAP to marketplace. So whats changed ?
Well not much 🙂 I have been busy with DIY at home so this is a bug fix / UX enhancement release

1) Portrait pictures with zoom were not correctly cropped. Fixed
2) Reduce album view so show only 8 but larger thumbnails
3) Metro UX enhancement in Media viewer based on Dave Crawford’s suggestions. Hide instead of disabling controls and ensure fonts are readable 🙂

I’ve also been testing my Alarm Clock app (supporting multiple alarms)

Navigate to selected Pivot Item #wpdev #wp7dev

I have come across a few instances where its desireable to navigate to a certain pivot item rather than landing on default and then finding your way around.

This is very easy. I tend to define some mechanism e.g. an enum for each pivot item. I create a static property (or you can choose whatever data passing mechanism you prefer). I set the property and navigate to pivot page and navigate to correct item.

Here’s how i do it. Itercept the OnNavigatedTo of the Pivot page and set the correct item as selected.

public enum PivotDef

public static PivotDef SelectedPivot;

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
   switch (SelectedPivot)
      case PivotDef.One:
         this.pvtControl.SelectedItem = this.pvt1;

      case PivotDef.Two:
         this.pvtControl.SelectedItem = this.pvt2;

      case PivotDef.Three:
         this.pvtControl.SelectedItem = this.pvt3;

      case PivotDef.Four:
         this.pvtControl.SelectedItem = this.pvt4;


sample project is available from

Lighten Darken Skin tone in C# and Silverlight for #windowsphone #wpdev

I started Cool Camera as a stop gap application trying to figure my way around SatNav app (which started while i was answering some posts on AppHub forums). Current availble version stands at 1.6 and 1.7 is with Microsoft.

It has come a long way since 1.0 – which only supported: Taking pictures and a camera style HUD. The picture viewer was very basic. Just display the image in Image control. Since then i have * added support for filters, added video recording and playback, added album viewer. I have worked a bit more on image processing and i am a bit better at image processing.

The first set of filters were added to app thanks to René Schulte – I remember coming across a while back and it provided very handy way to creating and applying effects to WriteableBitmaps. I used the few supplied to get stared however before long i was asked if i could provide a way of making images darker. The most common scenario is when you use flash and the images are too white – especially faces. As i started, i remembered face detection post by Rene.–Silverlight-4-Real-Time-Face-Detection.

I started with Rene’s YCbCr code and the first pass to detect whether color falls into skin tone range. The first pass for skin tone detection worked just fine, how search began on how to increase or decrease luminance of image. I came across HSLColor which had an ligthen / darken method but that did’t work so eventually, i used Lerp

public int[] Process(int[] inputPixels, int width, int height)
          var resultPixels = new int[inputPixels.Length];

          // Threshold every pixel
          for (int i = 0; i < inputPixels.Length; i++)
              int c = inputPixels[i];

              var ycbcr = YCbCrColor.FromArgbColori(c);
              if (ycbcr.Y >= LowerThreshold.Y && ycbcr.Y <= UpperThreshold.Y
               && ycbcr.Cb >= LowerThreshold.Cb && ycbcr.Cb <= UpperThreshold.Cb
               && ycbcr.Cr >= LowerThreshold.Cr && ycbcr.Cr <= UpperThreshold.Cr)
                  // skin tone match 
                  System.Windows.Media.Color sc = System.Windows.Media.Color.FromArgb((byte)(c >> 24), (byte)(c >> 16), (byte)(c >> 8), (byte)c);

                  Microsoft.Xna.Framework.Color xc = new Microsoft.Xna.Framework.Color(sc.R, sc.G, sc.B, sc.A);
                  xc = Color.Lerp(xc, Color, Amout);

                  c = (255 << 24) | ((byte)(xc.R > 255 ? 255 : xc.R) << 16) | ((byte)(xc.G > 255 ? 255 : xc.G) << 8) | (byte)(xc.B > 255 ? 255 : xc.B);
              resultPixels[i] = c;

          return resultPixels;

Now all you need to do is pass the amount to Lerp and the color. To Darken you pass Black, to lighten, you pass White.

Cool Camera 1.6 for #windowsphone #wp7 #wpdev #wp7dev

Cool Camera version 1.6 has been submitted to AppHub.
What are the changes ?

  1. Two dynamic filters with live preview. The filters are HSL and YCbCr filters (Hue, Saturation &Luminance and Luma & Chroma components – blue & red).
  2. Additional single color filter (Red only, Green only, Blue only and Yellow only). This keeps the single color and changes rest of image to grayscale.
  3. Upload of videos and pictures to SkyDrive
  4. Single album and media viewer for both Videos and Pictures.

Anyone interested in Upload to SkyDrive or filter codes ?