A weekend of models and bondage?
I know it is Friday, but has taken five days to recover enough to talk about that weekend. Too bad it sounds more exciting than it was. I spent the weekend trying to understand data binding and data models.
I have been working on my next Windows Phone app and ran into a problem. For some reason, the text was being clipped. It appears that there is a size limit on objects on the phone. Thanks to mSpot and the Microsoft forums, we were able to find a workaround. Rather than a single TextBlock, I replaced it with a horizontal StackPanel of a collection of TextBlocks. With a bit of reworking I was able to create a working demo. Unfortunately, the values were hardcoded, but did not update properly when variables were used. This led me to the fun weekend of exploring bonding, views and models.
The first task was a bit of research that showed that other than being a palindrome, there were several spins on what MVVM really is. At one point I was expecting a version by Hans Christian Andersen (Emperor’s New Clothes). There is a lot of praise for it, but little substance and when there is it appears to be a lot of smoke and mirrors. Why do people try to inflate their importance by making things more complex that they really are. Why not keep it simple like Iris Classon does. I would love to hear her spin on ViewModels and MVVM.
I like the idea behind MVVM, it is simple and the division of labour makes sense. I just do not understand MVVM lite or why I would need it.
As part of the MVVM journey I also took at iCommand (was this Apple approved?) For the time being, I have put it aside, but it appeared that it was implemented as a series of inter-related code segments. I have a strong feeling that I would have better luck following the pea in a shell game than following the logic behind some of the iCommand implementations I have seen.
Anyway, time to get back to finishing that app and try and see if it actually makes money.
John Marshall… Visio MVP Visio.MVPs.org
Understanding the Stack Trace
Coding is like riding a bike. At some point you are going to crash. So what happens if you do crash your WP7 app and get a Stack Trace?
When you open the report in Excel, the results are in a bit of a mess, so the first hing to do is to apply a bit of formatting. The actual stack trace is multiline and appears in a single cell, so the first thing to do is apply wrap text to the entire sheet and while the sheet is selected, click on the edge of the cells in the border to resize the hieght and width of the cell. Set the vertical alignment to top of cell. This will make for a more readable result.
If you want to print the results, you may want to delete the first few columns or combine them into a single column. The one column I hoped would be useful, App Version, always ends up being blank. So was the crash due to a new bug or because the user has not upgraded?
The crashes are grouped by type, so the last entry is not always the last crash. Trying to narrow down the field by using the data range on the crash down page will give the appearance you have narrowed down the selection, but when you download, you get all the crashes.
So know that you ave a pretty picture of what happened, what next? The Stack Trace will show you what happened before the crash and what happened as it cleaned up, so your focus should not be on the first or last entry. Look around the middle and identify any line that matches one of your methods. The line before it should show the error that occured and you have the fun job of determining where in that method that that error occured. Sounds like a good reason to keep your methods short.
Though in
I have published my phone app, now what??
So you have survived the development process and were able to get you phone app on the marketplace, what is the next step?
Ignoring the market aspect, the main thing is to keep testing, enhancing and updating. Just because you were successful, it does not mean there are no bugs. I found out after my second app was certified that though I restricted entry to a numeric keyboard, I needed to ad extra logic to make sure my number only had one decimal place. The certification process can only test so much. Of course, they are always adding new tests. Even the certification team does not sit back and say they are finished.
Make the user part of the solution. Provide the user with means to provide feedback.
When you do provide updates, be honest and provide an explanation of what has changed. I have two apps on my phone that do basically the same thing, adult versions of a Pokemon game. The apps are Foursquare and 4th and Mayor. Both have gone through updates, but only Jeff Wilcox’s 4th and Mayor lets you know what is in the updates.
Most users will explore a new app and set up mental warning signs if there are problems. Too many warnings, the app gets uninstalled and you have lost a user. Without clues as to what has changed on the update, the user will not explore areas that they have mentally blocked off. Update notes will let the user that it is safe to explore that area.
So, I have an app submitted to the marketplace, so I will add to this blog when I find out more.
John Marshall… Visio MVP Visio.MVPs.org
WP7 – Raising the Bar
The Application Bar is more than four static buttons. It can be dynamic. Initially I tried to change the visibility of the buttons, but that was not an option. The best I could do within XAML was to disable a button. The methods I have seen seem to involve creating a button in XAML and then do a RemoveAt if the button is noin code t needed. The next issue was trying to support multiple languages. Using Binding does not appear to work. So to support multiple languages code behind was needed to do the binding.
So given these limitations, how can you make the process tolerable? The strategy appears to be to limit the amount of work done by XAML and use code beyond to determine if a button should be added rather than trying to remove it.
var button = (ApplicationBarIconButton)ApplicationBar.Buttons[0]; button.Text = AppResources.lblChallenge; button = (ApplicationBarIconButton)ApplicationBar.Buttons[1]; button.Text = AppResources.lblLdrBoard; button = (ApplicationBarIconButton)ApplicationBar.Buttons[2]; button.Text = AppResources.lblHelp; // and now for the AppBar menus var menuitem = (ApplicationBarMenuItem)ApplicationBar.MenuItems[0]; menuitem.Text = AppResources.lblOptions; menuitem = (ApplicationBarMenuItem)ApplicationBar.MenuItems[1]; menuitem.Text = AppResources.lblNewEvent;
Depending on the name you use for the app, you may want to customize the tiles. Peter Tihanyi has a good explanation here http://engine-designs.com/wp7-appreslib-dll-generator.html .
Hopefully this has revealed some of the secrets behind the Magic Happens part of adding languages to a WP7 app. This is a work in progress and I will be adding to it as I continue to implement the languages.
Update: The current method for creating an AppBar is to do it all in code behind.
John Marshall… Visio MVP Visio.MVPs.org
WP7 The Trials of making money!
So far, not a lot of luck making money with apps. So the quest continues. One suggestion to make money was to create a Trial version. Of course, if you are not planning on making money, no Trial is needed. The process seems simple, but somehow I do not have a lot of confidence in how the current mechanism works. They do provide a method, but I find the logic it uses is backwards.
You call a method and it returns a positive if the app is in trial mode. It is left up to the developer to infer that a negative means that the app is paid for. The problem is that a non positive is not necessarily a negative. There may be other reasons the method does not return a positive. What if the service determining the status can not be run? It is the same logic used to imply someone is innocent if they could not be found guilty. Just because something can be proved does not mean the inverse is true.
It would be nice if the logic was improved, but there are many legacy apps using the current model, so there needs to be an alternate method that returns a positive value if the app is paid. Then the inference is on whether the app is a Trial. My preference is to return a token that indicates a given id for the app or an indication that the determination could not be made.
The next step is to work out what to do when you know the app is a Trial. Reduced functionality is one technique another is to add ads. If you are not making money from purchases, you might as well make them from ads. Of course, I would love to have the problem where the ads made more money than purchases.
John Marshall… Visio MVP Visio.MVPs.org
Survey Says… It is your turn to help out.
The IT Pro team at Microsoft Canada is focused on ensuring that they help set you up for success by providing the information and tools you need in order to be get the most out of Microsoft based solutions, at home and at work.
Twice a year, Microsoft sends out the Global Relationship Study (GRS for short); it’s a survey that Microsoft uses to collect your feedback and help inform their planning. If you receive emails from Microsoft, subscribe to their newsletters‚ or you’ve attended any of their events you may receive the survey.
The important details:
- Timing – March 4th to April 12th 2013
- Sent From – “Microsoft Feedback”
- Email Alias – “feedback@e–mail.microsoft.com”
- Subject Line – “Help Microsoft Focus on Customers and Partners”
Many of you already read the Microsoft Canada IT Pro team’s blogs‚ connect with them on LinkedIn and have attended their events in the last year or so. So you may already know that you’re their top priority. So they want to hear from you.
The Microsoft IT Pro team use the GRS results to shape what they do, how they do it and if it’s resonating with you. Tell them what you need to be the “go-to” guy (or gal) and what you need to grow your career. They want you to be completely satisfied with Microsoft Canada.
This year, the team has delivered 30 IT Camps and counting across the country. Giving you the opportunity to get hands on and learn how to get the most value for your organization. They have a few more events planned this year, so keep an eye on their plancast feed for events near you. Based on your feedback, topics they’re planning to cover will include:
- Windows 8
- Windows Server 2012
- System Center 2012
- Private Cloud
- BYOD – Management and Security
That’s not all. They’ve heard you loud and clear so in addition to hands on events, they’re also delivering more technical content online via the IT Pro Connection Blog. Windows 8 continues to be a big area of focus for them. They covered a lot of great content at launch and they’ve complimented that with new content like:
In addition to this, there are some valuable online resources you can use like Microsoft Virtual Academy, Microsoft’s no-cost online training portal. Or software evaluations (free trials) on TechNet that allow you to build your own labs to try out what you’ve learned.
Regardless of how you engage with the team at Microsoft Canada‚ you’d probably agree that they hear you. They’d also encourage you to continue to provide that great feedback. They thrive on it‚ they relish it‚ they wallow in it and most importantly of all‚ they action it. So please keep connecting with them and keep it coming! The team is listening.
If you do not recieve an invitation to take the survey, drop a note to them on their blog or LinkedIn and let them know if they are on the right track and how they can improve.
Resources, Tools and Training
- Tim Horton’s Gift Card Contest– Microsoft Canada is giving away 350 Tim Horton’s gift cards, all you have to do to qualify is download a free qualifying software evaluation (trial). Download all three for more chances to win, but hurry, the contest closes soon.*
- Windows 8 Resource Guide - Download a printable, one-page guide to the top resources that will help you explore, plan for, deploy, manage, and support Windows 8 as part of your IT infrastructure.
- Windows Server 2012 Evaluation – Get hands on with Windows Server 2012 and explore the scale and performance possibilities for your server virtualization.
- Microsoft Support - Get help with products‚ specific errors‚ virus detection and removal and more.
- Microsoft Licensing -Visit the Volume Licensing Portal today to ask questions about volume licensing‚ get a quote‚ activate a product or find the right program for your organization.
*No purchase necessary. Contest open to residents of Canada, excluding Quebec. Contest closes April 11, 2013 at 11:59:59 p.m. ET. Three-Hundred-and-Fifty (350) prizes are available to be won: (i) $10 CDN Tim Horton’s gift card. Skill-testing question required. Odds of winning depend on the number of eligible entries. For full rules, including entry, eligibility requirements and complete prize description, review the full terms and Conditions.
John Marshall… Visio MVP Visio.MVPs.org
The Wallenda Factor
Programming for the Windows phone is easy. Getting a simple app up and running is a simple task because of all the hidden power behind XAML. The problem is, trying to tap in to that power to bring your app to a new level. For some, creating a simple app is fine, but most of us want to open that secret door to find out what magic it can release.
Most people trying to promote the environment say that it is a simple twenty foot stroll from point A to point B on a sunny day in the park. To help, they will even place down a string connecting the two points to make it easy for you to follow. As you start the journey, it starts to get darker and the person encourage you on the walk is now wearing a police uniform. He is conducting a DUI test and your anxiety builds. Your steps become uneasy. Was the bread in that sandwich you just ate going off and fermenting? How many slices of bread does it take to fail the test. A crowd has gathered and now you are getting a bit of performance anxiety. Point B is quickly fading in to the distance. Suddenly the ground drops away and the string you were on turns into a rope and the crowd is yelling Wallenda! Wallenda!…
That is what it sometimes feels like when using XAML. As long as you keep it simple, no problem, but when you get adventurous, it can be a long fall and you freeze rather than go forward. Google/Bing have always been a good way to lessen the anxiety, but more than likely, the results just indicate that what you were looking for was just mentioned and the link has no relevance. Unfortunately, there is also a lack of relevant of information dealing with the new features in WP7/8 and the errors that are generated are way off in left field and have nothing to do with the problem. You create a problem that is passed to a XAML routine that interprets it and passes it to another XAML routine that puts its spin on the request. This continues until the system just gives up and raises a white flag. As in the children’s game where you whisper a message around a circle, the final message has no resemblance to the original message. You may have a car crash in Halifax, but the message you receive is that you won the lottery in Vancouver.
Luckily, the Canadian team at https://www.developermovement.ca/ is trying to encourage established developers to help out as mentors. They will not be able to make phone development a walk in the park, but they will be able to fill in the potholes that prevent you from getting to pointB.
John Marshall… Visio MVP Visio.MVPs.org
