Jaime Rodriguez On Windows Phone, Windows Presentation Foundation, Silverlight and Windows 7
For those of us who have multiple machines or re-install often and don’t like to download every time using the web installer, there is an ISO image for the Windows Phone Developer tools
Download using this link.. http://go.microsoft.com/fwlink/?LinkId=201927. This is the RTM version ( so what we released around 9/15). Don’t forget to install the October update for the tools after you have installed the tools from this iso.
Also, if you are a VB developer, you will have to get the VB tools support that RTMed yesterday
Happy Windows Phone coding!
As you know, Silverlight does not have native support for decoding gif images. That is downer, but not a showstopper since several 3rd party, opensource libraries for decoding Gifs.
The Twitter for Windows Phone team used the ImageTools project from Codeplex to decode gifs. It worked well, but when we implemented there were two things that bothered me a little:
I knew there were other libraries and partners were using these (for example, the GifDecoder library shared a long while ago by Joe Stegman). Today, I finally compared these two libs side-by-side. I used ~400 images. 25% came from a list of Gifs that had known issues. The other 75% was a random selection by looking at a Twitter user, and downloading his followers and filtering for the ones that used gifs.
The results: Decoding wise, these two libraries are pretty much the same code. I should have started by comparing that before I wrote my test. Instead, I found it by accident as I dived in to fix the infinite loop above. The results are pretty inline with our original ~90% assessment. My tests are a bit lower but again it is because I spiked the test. The codeplex library is getting updated a lot more, and is growing and getting fixes, so that is what I am sticking with for my projects. They have done a lot of work on their AnimatedImage control (which supports animated gifs, looks pretty neat (though I have to say animated gifs feels like going back in time). If you need to decode Gifs, I do recommend you use this library. It is better than nothing. Please do make sure you:
I am sure the library will improve over time, I pinged the folks with my tests and my results in case it helps improve. Source for my little test, and source for the libraries I used (with small changes) are in skydrive
Kevan Hutson (or some one in his team) created this great ‘aggregation’ of reviews of different Windows Phone models.It is a bit US-centric, because it aimed at helping the MS-based US Employees order their phones now that Windows Phone is launched in the US. Still think it might be useful to many of the people reading this blog.. and if not, it can influence others to share better links, or even their own reviews.. So, with Kevan’s permission, sharing his internal list. Take it with three grains of salt; I did not read all the reviews, this is very unofficial, and I am sure not comprehensive.. Still, it did help me, so I thought was worth sharing..
Samsung Focus | AT&T
Consumer Reports: Samsung Focus is sharp, with a few dull spots The Samsung Focus looks like a winning smart phone, thanks to its gorgeous display and the efficient and attractive operating system behind it.
Gizmodo: The first Windows phone that matters [Samsung Focus is] the thinnest and lightest Windows Phone, and its Super AMOLED display is the best screen too. If you're going to get a Windows Phone, this is the one to stare at the hardest.
PCMag.com The Samsung Focus plays up Windows Phone 7's strengths and plays down its weaknesses for a great Windows Phone experience.
Engadget The Focus is kind of the everyman of the Windows Phone 7 line. It doesn't really have any fancy features and isn't especially stylish... but it gets the job done.
MobileBurn: Windows Phone 7 and great hardware The build quality on the Focus is amazing. It is a very solid and rich-feeling device. That it is good looking and features the best looking display on the market, in my opinion, certainly doesn't hurt.
LG Quantum | AT&T
Full QWERTY Keyboard 16 GB Internal Memory Play To (DLNA) Support
Engadget: LG Quantum first hands-on! We're very torn on the LG Quantum. From the outside you've got a design that can only be named as "frumpy," with wasteful curves and rubberized edges, along with the smallest screen of the AT&T bunch. Still, slide this puppy open and you're treated with one of the best QWERTY keyboards in the business.
ZDNet The Quantum takes a stand as it is the only Windows Phone 7-based device with a slide-out full QWERTY keyboard.
PCMag The LG Quantum could be a quantum of trouble. The first Windows Phone 7 device with a full keyboard that will be sold through U.S. carrier stores, it has a balky sliding mechanism and a really bizarre keyboard layout that could kill its appeal.
HTC Surround | AT&T
Slide-out speakers w/ kickstand SRS Dolby Mobile Surround Sound 16 GB internal memory
MobileTechReview.com It's business as usual for HTC: attractive and understated finishes that avoid looking plasticky, a solid feel in the hand and considerable heft thanks to the slider design.
PCMag.com The HTC Surround promises a big entertainment experience with its kickstand and huge slide-out speaker, but Windows Phone 7 just isn't up to the task.
Engadget The Surround needed to bring a lot to the table in order to justify being bigger and heavier than the Samsung Focus while lacking the QWERTY keyboard of the LG Quantum, and we just don't think a pair of average speakers and a kickstand provides that justification
Gear Live The HTC Surround is a good phone, and its the one we'd recommend if watching movies and listening to music is your jam.
HTC HD7 | T-Mobile
Largest 4.3” Screen T-Mobile TV built-in
CNET The hardware could use a bit of updating, but the HTC HD7 for T-Mobile combines the power of Windows Phone 7 with a large touch screen and delivers satisfying performance.
PCMag.com The T-Mobile HD7 is a good-looking phone that's a fine canvas for Windows Phone's services, but it's not at the top of its class.
Gizmodo Overall, the HD7 is not a bad phone, and it's a perfect serviceable vehicle for Windows Phone 7. It's just not a great phone.
Boy Genius Report The Windows Phone 7 OS on HTC’s HD7 is absolutely fantastic in many respects, and yet in other areas, it is an OS filled with almosts.
Engadget The reason we like the HD7 is that it seems to be just about the perfect size for us. It trades little in the way of added bulk for an awful lot in added real estate and general usability.
SlashGear The HD7′s large display, responsive interface and our generally positive feelings about Windows Phone 7 all stand in its favor, but there are still niggling flaws and frustrations that mar the overall experience.
Dell Venue Pro | T-Mobile
Vertical QWERTY Keyboard Scratch & Shatter Resistant Screen Available on T-Mobile, sold through Dell
Engadget: Dell Venue Pro (aka Lightning) first hands-on! No matter what you call Dell's Windows Phone 7 portrait slider, it's downright awesome.
CNET The smartphone feels very solid in the hand. In addition to the slide-out QWERTY keyboard, the Venue Pro also offers a 4.1-inch WVGA AMOLED touch screen, which was both sharp and responsive in our brief hands-on time with the device.
Gizmodo The Venue Pro has a bit more heft than some of the other WP7 devices launching today, but it's not overly bulky. It just feels solid, durable.
PCMag.com: Windows Phone 7's dark horse? Hands on I want to love the Dell Venue Pro. This is the Windows Phone 7 with a keyboard that might actually work. But it's from Dell, and even T-Mobile doesn't seem to have complete faith in the phone.
Additional reviews worth reading: CNET - First impressions: HTC HD7, Dell Venue Pro Engadget - Windows Phone 7 in review: the good, the bad, and the Surround InformationWeek - Review: AT&T's Windows Phone 7 handsets tested Maximum PC - Windows Phone 7 impressions: The first 24 hours PhysOrg - Review: Microsoft hits refresh on smartphones ZDNet - Hands-on with the HTC Surround and Samsung Focus WP7 smartphones
Additional Model Reviews - EU and APAC LG Optimus 7 E900 review (Stuff Magazine) Samsung Omni Review (Telegraph) Trophy (TechRadar) Mozart (Pocketlint)
Yesterday, I saw a few posts, tweets and personal emails from smart, professional developers who are building great windows phone apps and did not appreciate getting caught in the recent slew of press and marketing exchange around Windows Phone perf. I am going to share my personal experiences to try to clarify the likely misinterpretation..
At first glance, the stories are in partial conflict.. and the developers get caught in the middle (since they are not in the conversation that is getting reported), so I have to share my personal experience as a developer collaborating with partners and developers to build build good and great Windows phone apps(disclaimer, I still work for Microsoft so I am biased, and all that, but I also like to tell it like it is so read on and decide).
Answer or state of the union: Every platform always needs performance improvement. Users will always demand more. Engineers will always aim to provide more. I know our Windows Phone engineering team has improvements and fixes coming into the platform to make things better/faster… At the same time, the journalist question around “fixing the performance in the platform” is a loaded question and implies “it is broken”. Every platform has small bugs and short-falls so the question is whether this is a systemic problem or a big hole that really qualifies ours as “broken”. I can’t speak for every developer but my experience has been that there is a very reasonable (low) number of bugs as expected, and the platform works and performs well with-in user expectations, so I can understand why MS marketing folks are responding with the “it is not broken, we just need to advise developers to get the most out of their apps”.
So, why do they say that? I won't speak for all developers, but I can share that 100% of the apps I have been involved with, can use performance improvements that developers can make today but simply need more time to implement or did not understand a month ago; these are new apps, new usage patterns, etc.. There is also changes that will (eventually) come for free to the platform as improvements (you can call them bug fixes if you want but I would call them optimizations) that will make existing apps better (with out neding changes). On my partner’s projects, we had to balance between features, optimizations, and polish within the constraints we had to get us to launch – biggest constraint being time, beta of the platform was shipped ~3 months from RTM, most apps were built in this time-frame. As developers and engineers, we discover new characteristics or niche scenarios in the platform every day. We are are thriving with all these great new lessons or lessons that others are sharing, and we are improving the apps, lots of these apps are already released their first or second update, and I am sure every one of these is better than their previous release.
That is why Microsoft is emphasizing education and broad sharing. It is not blame, it is just a natural partnership for any brand new platform ..
When you hear MS marketing folks say “we are working to train and educate developers to improver performance on their apps” please don’t misinterpret as an insult or blame . What Microsoft folks are trying to say is “we have a great platform, but the hardware has been available only for a short time, the new amazing experiences we are seeing every day have never been built before on any platform. We know we have a strong foundation, but we learn new stuff every day, and we want to share it as guidance and education so you (developers) can leverage the tips can make your apps even better.
In my opinion, there is a lot to be proud of.. There is some amazing apps, and some great reviews. The fact that reviewers like Gizmodo are comparing the Windows Phone apps to apps that have been in other platforms for 18 months to 3 years, and we are comparing neutrally or favorably is pretty amazing. It has been ~8 months since developers even heard of our platform. It has been only four months since beta and only a few weeks of marketplace being open. What do we have to show for? Thousands of apps in the marketplace, tens of thousands of developers registered, over half a million downloads of the tools.. All-up, this is a great story… The read I get from peers at Microsoft is that we are very proud of the platform and the tools, and we are very impressed (often amazed) with some of the the apps that are getting in the marketplace. We are heavily invested in providing the best tools and the best guidance. When we say we are working on education, all that means is we are ready to partner with you (our developers). Your success is the pillar to our own platform’s success. Long-term, we will optimize the platform even further , and half of the issues that are annoying us today will be gone, but interim, we will have to work together to create great apps. We know the platform can do it since plenty of you devs already proved it.. Let’s keep rocking and don’t over analyze sensationalist titles to news stories.. That is my personal 2c. Back to my writing some good tips on my upcoming Windows Phone book ..
A few tips for those using GeoCoordinateWatcher in Windows Phone 7.
That should be all you need to really optimize your location-aware apps… Don’t forget to prompt the user before you use their location .. Feel free to beat me to the next part… you should know what that is..
Happy Windows Phone coding !!
I have uploaded my slides and demos from my teched sessions. Thanks for attending and staying awake
On my way to TechEd Europe today, and just found out there is a room available to host a Windows Phone XAPathon.. There was also room for T-shirts for first 12 XAPathon RSVPs. If you are at the event. Below is the likely places you will find me..
XAPAthons
What is a XAPathon? A casual short ( less than an hour unless schedule allows for more) meeting with a so-named Windows Phone expert (in this case me and/or Oren Nachman, a perf expert). You can do anything you want with the time:
How do I sign-up for a XAPathon ? Email me via the link on this blog post.. or contact me via twitter @jaimerodriguez or Just stop by at the Passau 4 room (yes, you have to be a registered attendee, sorry).
Break out sessions
Monday: 09:00 Windows Phone Pre-Conference ( a ~5 hour dive into building WIndows Phone apps.. Taught by yours truly. Still working on the timings for the session but slides and decks are done. It will flow like this:
[intro == 15 mins or less, and it is 200 level] , [pragmatic == 200 to 300 level intro+good practices] [deep dive == all you will ever have to know about it]
Tuesday:
Wednesday:
09:00 WPH310 - Giving your Windows Phone XNA Games Plenty of Whizz and Bang 12:00 -WPH311 - Microsoft Silverlight Performance on Windows Phone 16:30 -WPH214 - Understanding Marketplace and Making Money with Windows Phone 7 Applications 18:00 WPH315 - Developing for Windows Phone 7 - End to End
Friday: 09:00 WPH316 - Building Offline Experiences for Windows Phones and Other Devices using Sync Framework 10:30 WPH117-IS - Come and Meet the Windows Phone 7 Team 12:30 WPH318 - Developing Code for Windows Mobile and Windows Phone 7 Silverlight Focus groups
At TechEd Europe, the Microsoft Silverlight team will be conducting several focus groups (60-90 min) on-site November 11th, and the purpose is to solicit opinions about Rich Internet Applications (RIA) platforms. The team would love to learn more about your thought process when evaluating these technologies and about your experiences building applications with various solutions!
All focus group participants will be given a gratuity (Microsoft software) for their contribution.
To participate, please enter the URL below into your Web browser and fill out a brief form with your name, contact information, and your level familiarity with various RIA platforms, http://www.surveymonkey.com/s/GKG3RN6
Note: We will only use this information to schedule some time to talk with you while you are at the show, and will not add you to a mailing list or share your information with third parties.
Hope to c u there.. Happy WIndows Phone coding..
For Silverlight applications, Windows Phone does a good job at abstracting the keyboard from the platform. As a developer, you drop a TextBox any where in your app and whenever the textbox gets focus:
Again, all of the above comes for free, and is pretty convenient most of the time. Unfortunately, every now and then, you do run into a scene that maybe has a button underneath the textbox ( for example, a login window or a sign-up window with a button near the bottom). If you are in one of these situations, the news are not so great. There are no platform events or classes to tell you if a SIP is available and/or when it is shown or hidden. There is a “hack” that works most of the time:
When SIP is visible, and the screen has been translated, the transform is applied at the App.RootFrame (which is a PhoneApplicationFrame). The easiest way to get notified when this Transform changes (to avoid polling) is to data bind to it; using a DependencyProperty, you get free notifications when the property changes (which of course would happen if the SIP is visible. Here is a sample snippet, that sets an IsChecked property in a checkbox whenever we think the SIP is visible.
1: public partial class MainPage : PhoneApplicationPage
2: {
3: // Constructor
4: public MainPage()
5: {
6: InitializeComponent();
7: BeginListenForSIPChanged();
8:
9: }
10:
11: private void BeginListenForSIPChanged()
12: {
13: PhoneApplicationFrame frame = (App.Current as App).RootFrame;
14: Binding b = new Binding("Y");
15: b.Source = (frame.RenderTransform as TransformGroup).Children[0] as TranslateTransform;
16: SetBinding(RootFrameTransformProperty, b);
17: }
18:
19:
20: public static readonly DependencyProperty RootFrameTransformProperty = DependencyProperty.Register(
21: "RootFrameTransform",
22: typeof(double),
23: typeof(MainPage),
24: new PropertyMetadata(OnRootFrameTransformChanged));
25:
26: static void OnRootFrameTransformChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
27: {
28: double newvalue = (double) e.NewValue;
29: MainPage page = source as MainPage;
30: if ( newvalue < 0.0 )
31: {
32: page.IsSipVisibleGuess.IsChecked = true;
33: }
34: else if ( newvalue == 0.0 )
35: {
36: page.IsSipVisibleGuess.IsChecked = false ;
37: }
38:
39: #if DEBUG
40: else
41: System.Diagnostics.Debug.Assert ( false, "I assumed this would never happen, let me know if it does");
42: #endif
43:
44: }
45:
46: }
Full disclaimer, this post begins with guessing. it is not 100% fail-safe. The scenario where it fails is when you set focus on a textbox and SIP comes up, and then you open the hardware keyboard on the phone. The platform does not always apply the transform immediately. The snippet is still right, since the transform has not been removed, but it is annoying that hardware keyboard is readily working and transform is still there.
The snippet also does not tell you if the SIP is visible when the TextBox is so high enough on the scene that the rootframe does not get translated at all.
I would recommend you avoid using the trick when you can, the easiest way to avoid it is not to put buttons that can be covered by the SIP (so no buttons underneath the textbox). . Put the buttons either above the textbox, or on the ApplicationBar. The latter being my preferred approach.
If you want to try it, the source is here.
Happy Windows Phone coding.
Monday’s blog post on running under screen lock generated a couple of questions around media not playing when medialibrary is locked ( and Zune locking Media Library). So, today, I remind you about a recently announced tool that shipped with the Windows Phone Developer Tools October Update. The tool is called Windows Phone Connect Tool ( internally we know it as either WPDTConnect, or WPConnect, the latter is the final name of the exe as it made it out externally). Full instructions on running and troubleshooting WPConnect are here. My personalized version is below.
Requirements:
To run WPConnect: You simply need to run the WPConnect.exe. By default it will be installed at %ProgramFiles%\Microsoft SDKs\Windows Phone\v7.0\Tools\ or at %ProgramFiles(x86)%\Microsoft SDKs\Windows Phone\v7.0\Tools\WPConnect. The instructions on MSDN talk about opening a command prompt and navigating to that directory; that is Microsoft internal instructions. For the rest of the world that does not use DOS and command prompt as much as we do inside , you can do any of these and it will work equally well.
The really important stuff is to:
The results: What you will get is ability to debug applications that play Media on the phone without media library getting locked. You can also debug applications that interact with MediaLibrary.
A couple of FAQs and or known issues:
That should be all you need. Read the full instructions for more troubleshooting tips. Hope that helps.
Today, David Anson announced the second release of the Silverlight for Windows Phone toolkit. This release doubles the number of controls in the kit, includes page transitions, ListPicker, and the new Swiss Army style control for Windows Phone: LongListSelector.. I am still getting deep into LongListSelector and trying to fit into some apps, but the potential for it is so great, I am doing a preview post on it..
LongListSelector started as a list that would address the requirements for lists similar to the people hub list.. Headers and Footers that scrolls with the items in the list (see how the “new releases” header scrolls with the list items, this is great for panoramas )
,
It then morphed into grouping ( similar to Quick Jump Grid control )
And finally but still equally important as a very performant listbox where you have a lot of control on how items are virtualized, how fast the list scrolls, how big your bounces are, etc. LongListSelector uses a different scrolling mechanism ( animation on render thread ) and different virtualization strategy ( not a VirtualizingStackPanel) that results in better, smoother scrolling in most ListBoxes…
What are you waiting for??? Go download the toolkit from codeplex…
Happy Windows Phone Coding!
PS --- Test thoroughly.. With this high degree of customization and so many features into a single control, it is not too hard to make a mistake.. Make sure as you replace your standard listboxes with LongListSelector, you tune the knobs so it works just right for your app..
Last week, Microsoft published new Application content policies for Windows Phone 7 Apps. One of the changes that got attention was the ability to run applications under a locked screen. Refer to section 6.3 of the application certification requirements.
In reality, the change is pretty minor, the capability to run under lock screen has been there since RTM. Microsoft simply published some new ‘guidance’ on the expectations for applications that run under a locked screen. That said, the change was interpreted as Microsoft relaxing the guidelines, since now it is clear that running under locked screen is not going to be frowned upon as long as you meet the requirements.
Why run under a locked screen? What are the benefits? Many applications are expected to run under a locked screen: music players, run-tracking applications, map applications, etc. These applications will likely not change, as the certification guidelines had already approved these scenarios. The changes to the certification requirements are aimed at apps that want to avoid tombstoning. For applications that are slow to recover from tombstoning ( maybe they make network calls and download a lot of data at start-up), they now can avoid the overhead of recovering from tombstoning when the application goes under locked screen. You simply let the screen lock come on, and stay running quietly without consuming a lot of battery, and when the lock screen goes away, then you restore doing your business, but the gain to the end-user was they did not wait for a second or more while your app re-hydrated from a tombstone. Since your app was never killed, response time is immediate.
Before we go much further on this topic, I do want to emphasize that running under lock is not an excuse so developers do not implement a super-fast, comprehensive tombstoning strategy. There are plenty of valid reasons why an app tombstones ( Choosers, App switching, etc.) that can’t be avoided, so you should still work hard to get the absolutely best tombstoning you can implement.
Still, running under locked screen is a very nice to have for some apps, so I did a bit of digging and below are my tips, lessons learned, and even sample code, you can reuse to get your app to run under lock.
Running Under Locked Screen In short, to let your application run under locked screen, you must:
Getting all this to run was trivial, but required a few more lines of code than the four items above (to save settings, fire events, etc.) . I wrote this helper class called ApplicationIdleHelper.
The class is a Singleton. That is why the static Current property, so it can be shared throughout the app. The class supports change notification so you can bind to it.
That is all there is to it. Plus, a bit of glue and a sample app for you to see it in action.
About the sample app.
It is a very simple pivot app that plays music using MediaElement. You can toggle your preference to run under lock (or not to do that) by clicking the “Toggle current preference” button. You can play/stop music by pressing the Play/Stop button. The app will manage the settings for you. The UI under “Current settings” is data bounds to the ApplicationIdeleModeHelper so you can see it working. The events are fired properly too. Here are the behaviors you should see: If you are in the greedy pivot, and have chosen to Run under Lock, the music will continue playing under lock. If you are in the greedy pivot, but have not chosen to run under lock, the app will tombstone when the phone locks and there for the music will stop. If you are in the mellow pivot, even if you have chosen to Run Under Lock, the music will stop. The application is not tombstoned, but it stoppped doing the work. It listens to the Locked event and stops doing work then, and then listens to Unlocked event and resumes there. Again, without tombstoning. I just wanted to show you how you can “decrease” the work you do under lock, to avoid consuming battery.
It is a very simple pivot app that plays music using MediaElement. You can toggle your preference to run under lock (or not to do that) by clicking the “Toggle current preference” button. You can play/stop music by pressing the Play/Stop button. The app will manage the settings for you. The UI under “Current settings” is data bounds to the ApplicationIdeleModeHelper so you can see it working. The events are fired properly too.
Here are the behaviors you should see: If you are in the greedy pivot, and have chosen to Run under Lock, the music will continue playing under lock. If you are in the greedy pivot, but have not chosen to run under lock, the app will tombstone when the phone locks and there for the music will stop. If you are in the mellow pivot, even if you have chosen to Run Under Lock, the music will stop. The application is not tombstoned, but it stoppped doing the work. It listens to the Locked event and stops doing work then, and then listens to Unlocked event and resumes there. Again, without tombstoning. I just wanted to show you how you can “decrease” the work you do under lock, to avoid consuming battery.
NOTE: To exercise the app you will need a device, as I don’t think the emulator runs under lock or simulates lock. Also, when running this, make sure your device is not attached to Zune, as that will lock media library and prevent the app from playing music (and this sample does not throw error for that). The source for the app is on my Sky drive. Let me know if you find issues or have questions.
As my uncle used to say, “with great power comes great responsibility” .. Running under lock is pretty neat, but advanced feature, do not abuse it. Only use it for the kinds of apps that end-users would want to keep open even while locked.