Yep, that video above shows my HTC HD2 running Android Gingerbread (v2.3.4)! I came back home, and not having much to do thought I’ll give android another try. Sometime back I had tried running android from SD card but it didn’t work, later I found out that it was because of an older radio version on my device, so I had to update the radio version to fix it but it all looked like too much trouble and I put the HD2 back in its box. This was 6 months ago.
Today I thought I should take it for another spin. But this time we go all in, erase Windows Mobile 6 and flash the ROM with all the android goodness! It is pretty simple really, all you need is some patience to read all those articles on XDA a little carefully :)
The basic steps I followed are,
Check your radio version and update to 2.08.50 (if you’re running an older version)
Install MAGLDR 1.13 on your phone
Install Clockwork Mod on your device
Select an android ROM of your choice and flash. I chose the stock android gingerbread ROM version 2.3.4.
Here are the posts on XDA I referred to androidify my hd2,
This is going to be a quick post. Just over 2 weeks ago I got the Windows Phone Mango invite I was waiting for; my HD7 has been running mango in full glory since then. The installation took a long time but went pretty smoothly, backing the data up takes most of the time. I am really liking the Mango update, this is what windows phone should have been when it launched. Multitasking, IE9, better facebook integration in people’s hub and a plethora of other features. The voice command integration in mango is exceptional, and I find myself using it quite often. Being able to listen to an incoming message, compose a reply and send it, all using only your voice, is really amazing (or magical, as some might call it) and works really well.
Strangely, I am not using the multitasking feature all that much. Somehow I have an obsessive compulsion to keep the backstack clean all the time. Whenever I am done using the phone, I keep pressing the back button just to make sure there is nothing on the stack. I have a feeling I’m not alone.
In other news, AppHub gets some new features and Windows Phone is expanding to new markets. More importantly, Microsoft’s pubCenter, finally, will be available to developers outside of US of A. According to Todd Brix’s post, pubCenter should launch to new markets (including India!) before the end of 2011. I can’t wait to try out adCenter. You can read Todd’s post here,
I am still waiting for my invite. Looks like they are sending out invites starting from the list of supported countries, which unfortunately, India is not a part of. I’ll write when I get the invite and let you know how the installation goes on my HD7.
The consumer side of Windows Phone Mango was unveiled yesterday by Microsoft. It brings in some great new features like multitasking, IE9, fast application switching, maps, web marketplace etc to name a few. I was also impressed with enhancements to bing like local scout, bing vision and bing voice. With the NoDo update fiasco now behind us, I think the expectations are set just right for the ‘mango’ update which will be coming this fall ;) One thing that annoys me is the feature-market fragmentation that’s happening with Windows Phone. What’s the deal with making some features available only to a few markets! Just look at the way zune services and their features are split region-wise. It’s horrible and needs fixing.
Nothing was mentioned about Microsoft’s ad framework, PubCenter, and its expansion plans. It’s been close to 8 months since windows phone came out and PubCenter has expanded its market by zero, zilch, nada! There were talks a while back that it will be made available in europe, I don’t know how that’s working out. Hey you, make it global already! And show us some pay-per-impression love.
Got a mail today from the Windows Phone Marketplace team that application submission to Windows Mobile 6.x marketplace will be stopped effective July 15, 2011. Existing apps will stay on the marketplace, users (whatever remains) will be able to download your apps and more importantly developer payouts will continue to happen as usual.
Here is the complete text of the mail,
——————–
May 16, 2011 Dear Windows Marketplace for Mobile Developer,
We are excited about the momentum we have with Windows Phone. Since we launched Windows Phone last fall, technical reviews have been very positive and, most importantly, customer satisfaction has been extremely high. Moreover, our Windows Phone Marketplace continues to grow at a fast pace. It now features more than 15,000 apps and games and there are over 40,000 registered developers.
At MIX we announced that in May we will release the beta version of the Windows Phone Developer Tools for the next version of Windows Phone, code-named “Mango,” which we are still on track to do. The Mango release will be made available to users later this year, and it represents the next step in our continued focus on advancing the Windows Phone platform and expanding the opportunity for developers.
To innovate faster on the Windows Phone Marketplace, we are scaling back our investments in the Windows Marketplace for Mobile service. We are sharing this plan with you, in advance, so that you can make thoughtful plans and preparations.
App Submission and Management. On July 15, 2011, we will no longer be accepting new Windows Mobile 6.x applications or application updates. In addition, it will no longer be possible to modify prices, metadata, or other information. However, you will still be able to remove your apps by contacting support.
App Distribution. Even though app submission will stop on July 15, users will still be able to purchase and download your Windows Mobile 6.x applications through the Windows Marketplace for Mobile.
App Reporting. Sales and download reports will continue to be available for your Windows Mobile 6.x applications through the App Hub after July 15.
Developer Payouts. Developer payouts will continue to be processed in accordance with the provisions of the Windows Phone Marketplace Application Provider Agreement.
Additional information regarding the scaling back of our investment in the Windows Marketplace for Mobile will be shared over the coming months as plans become finalized.
We would like to thank you for being part of our Windows Marketplace for Mobile developer community, and we look forward to helping you build more Windows Phone applications.
For more information, please visit the App Hub Forum. For further assistance, please contact support directly.
Over 1500 new API’s have been added to the next version of Windows Phone, called Mango. And yes, all existing devices will be updated to Mango, the update can’t come soon enough :)
Like I mentioned in this post, if you installed the pre-NoDo update, the process would have required a fair amount of storage space on your primary drive depending on how much content you have on your phone. The Zune software takes a backup of your phone’s content before updating the OS on the device. This backed up data stays on your machine, here’s how to move the data to another location so you can free up some space on your primary drive.
On your machine navigate to the following location,
the folder AppData is hidden, so you’ll need to enable the option to show hidden folders. And depending on your configuration you may also need admin privileges to move stuff around. The Windows Phone Update folder contains the data backed up from your device,
All the data is present inside the RestorePoint folder. Move this folder to another location to free up space. Make sure you keep this backup of the backup safe, just in case something horribly bad happens to your windows phone 7 device.
One thing that was pending on my “todo” list from a long time was implementing the ‘Game Of Life’ on Windows Phone 7. I got the basic version running in a couple of hours and I’ve been thinking about improving it since and adding new features to it. Maybe I’ll submit it to the marketplace someday, who knows. I have also been reading about gestures, multi-touch, pinch-to-zoom and related topics and most importantly trying to understand the math behind each of those gestures, and the math is so elegant that it fascinates me!
Game Of Life Game Of Life is a simple cellular automaton in which you create a pattern in a world made of rectangular grids, start the evolution process and then watch the pattern change as the world evolves. The world is made up of dead cells initially, you create a pattern by selecting a few cells and giving them “life”. The world then evolves according to a set of rules (source: Wikipedia):
Any live cell with fewer than two live neighbours dies, as if caused by under-population.
Any live cell with two or three live neighbours lives on to the next generation.
Any live cell with more than three live neighbours dies, as if by overcrowding.
Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
It’s a fascinating concept and some very interesting patterns emerge out of it, read more about Game Of Life on Wikipedia here.
Gestures
Gestures like translation, scaling and rotation seemed complex to me at first, but they’re pretty simple once you understand the math that makes the magic happen. I came across two great articles that really dig deep into these concepts. Both articles use the Silverlight Toolkit for Windows Phone 7 and the gesture support that it provides. I was a little surprised to know that the silverlight toolkit actually uses XNA’s touch api’s to detect gestures. These are the articles that you must read:
Charles Petzolds’ implementation makes use of Matrix transforms. It took me some time to understand matrix transforms and realize their importance in 2D/3D graphics. The only time I used matrix multiplication was to solve silly linear equations in college. You’ll find many a articles on the internet about matrix transforms but the best resource I found again comes from Charles Petzold. Chapter 22 – From Gestures to Transforms in his free book Programming Windows Phone 7. Download it now if you haven’t already, it’s a great resource.
The two paths had to meet. Using gestures in Game Of Life was the best way to learn them.
In my first implementation of Game Of Life, I used the Manipulation Delta events to support pinch-to-zoom. In this I used the DeltaManipulation.Scale.X and DeltaManipulation.Scale.Y values in the ManipulationDeltaEventArgs class (passed to the ManipulationDelta event handler) to modify the ScaleX and ScaleY values of a Scale transform on the object to be scaled. If that sentence didn’t make sense, don’t worry, this is the easiest and the worst implementation of pinch-to-zoom. The scaling was not smooth or accurate. To understand what a perfect pinch-to-zoom should be read this – Pinch Zooming using XNA on WP7: Getting it right. The article explains this with reference to XNA but the concept remains the same everywhere.
In my second attempt I used the Silverlight Toolkit for Windows Phone and Francesco’s implementation of pinch-to-zoom. It was working pretty nicely with a few quirks here and there. Though the implementation is easy to understand, I felt there were too many variables used for storing state information and the code looked a bit messy, but it worked.
It is while tuning this implementation that the MSDN Magazine article was published. Charles Petzold’s implementation felt intuitive and was much cleaner. The only part I had to figure out was the matrix transforms he used. And that I’ll explain a bit here.
This is what the app looks like,
The rectangular grids are added programmatically to a canvas. Here is the XAML for the canvas,
So during the Drag Delta and Pinch Delta events the transforms under currentTransform are manipulated to achieve the desired effect and once the drag or pinch gestures are completed a function, TransferTransforms(), is called:
To understand what is happening here we need to look at the XAML first. The RenderTransform on the MainCanvas is a double-barrelled (term used by Charles in his article) transform. Basically, a transform group within a transform group. So the effective transform on MainCanvas is equal to the effect of previousTransform plus the effect of currentTransform. Well, it’s not exactly “plus”. First, previousTransform is applied on MainCanvas to change its state, and then currentTransform is applied on that state to change it further. If you download and look into Charles’ code, you’ll see that during drag delta and pinch delta events, only currentTransform values are modified. Once the drag or pinch gesture is complete, TransferTransform() is called to “transfer” the values of currentTransform to previousTransform. And this transfer happens by the way of matrix multiplication, which is what the function Mulitply() does. It’s not over yet. After the multiplication the values of currentTransform (i.e scaleTransform, rotateTransform and translateTransform) are reset. This is important because, as we discussed before, the effective transform on MainCanvas is effect of previousTransform “plus” the effect of currentTransform. Transferring the values of currentTransform to previousTransform and then resetting currentTransform keeps the effect same.
CacheMode and BitmapCache
Now I got the translation, scaling and rotation to work correctly, but the performance was not very great. There was a huge lag in pinching and dragging, and this is where BitmapCache comes in. Every UIElement has a property called CacheMode, which can be set to BitmapCache.
In XAML, CacheMode=”BitmapCache”
In code, uiElem.CacheMode = new BitmapCache();
When the CacheMode of a UIElement is set to BitmapCache, a snapshot of the UIElement is taken and is stored in the video memory. So the element is not redrawn every time, instead all the operations are performed on the cached bitmap. This is super fast and is particularly useful when working with transforms on controls. Change the MainCanvas element in the XAML to include CacheMode,
and this will have a dramatic effect on the performance as you will see in the video below.
Please leave a comment if you have anything else to add.
A quick post, about two days back I got a notification on my HD7 saying that there is a update available to be installed. Yes, it was the pre-nodo update that you might have read about on the windows phone blog. Just installed it, and it completed without any hitch. Reading several reports about some devices having trouble installing the update (particularly the Samsung ones) and some even getting bricked, I was wary at first. I waited two days and there were no reports of issues with any of the HTC devices. I went ahead and installed it today.
The only downside is that you might need a lot of space on your primary drive, close to 8GB for me, depending on how much data your phone contains. The update process backs up all the data in your phone, just in case something goes horribly wrong. The whole process took about 45 minutes, majority of the time for data backup. The OS version was updated from 7.0.7004.0 to 7.0.7008.0.
Well, the start screen disappears and all you see is the application list, which normally shows up when you scroll to the right. Pretty interesting I thought. So the start screen is basically a shortcuts screen on steroids, much nicer looking and with tile notifications.