I want to share the experience of developing an application on Windows Phone 7.5, migrating it to Windows Phone 8, and what I think about prospects in general. Information will be interesting first of all to novice developers, since I myself only recently switched from web development to mobile and I still have not very much experience.
Whatever you think, after reading the article that the development for Windows Phone (WP) is a hell, I will say right away:
The guys from Microsoft are great: an excellent SDK, an affordable pricing policy, a lot of documentation, an excellent community and # # - all this makes the development process enjoyable and exciting. I just want to talk about the difficulties that I faced.
')
A little about what I was doing. The task was extremely simple:
There is a successful application on Iphone, Android, Ipad, Mac os, Windows (
who is interested ) and it was necessary to transfer it to WP. I started developing at the time when Windows Phone 7.5 was at the forefront of the Microsoft phone market and Windows Phone 8 was about to appear. After clarifying the problem, the next thing that had to be done was to decide on what to write and how to write. If there were no questions to write about, then I had to think about how to write. The fact is that I already wrote an application for the WP7 platform, but it was simple and did not require any complex design patterns. Having read about the coolness of the
MVVM pattern, I decided to try it and began to look for frameworks for its implementation. Most of all I liked the
Mvvm Light toolkit for its simplicity and easy entry threshold. Thanks to the use of MVVM, the migration process on WP8, and then on Windows 8, has become much simpler.
Design
With the design, we carried very long. For us, this experience was the first and there were a lot of subtleties. In addition, not everything that looks beautiful will quickly work on the phone (for example, the choice between Pivot and Panorama). Since we immediately decided to support the light and dark themes, we spent a long time with the selection of backround pages for pages, but did not come up with the option that would suit us (a separate Hello ApplicationBar, which is like a eyesore). I advise you to immediately think through all the menus in the application and what you will have in the ApplicationBar (there is only the most necessary: ​​save, delete, cancel, add.). Think about how you will use
accent colors and how it will look in different themes. We tried the
grid and we did not succeed. It was the first time when I learned what a half-pixel is 8) (in the appendix it sometimes pops up to this day 8)). Minimalism is good, but making something that stands out is really difficult.
And what about the components and controls?
All necessary components and controls are there, but not all of them work as they should. I started by using the
Windows Phone Toolkit . Everything worked well, but when it came to the subtleties, it was necessary to take on the file, especially when it came to performance and usability. Most of all I was driven crazy braked LongListSelector. At one of the conferences I heard about
RadControls , having tried I could not work with others anymore. They are not expensive, but they will save a lot of time, and even standard elements, for example TextBox, PasswordBox, are much more pleasant to use (basic animation, clear button, opening asterisks in PasswordBox). The incident happened to Multiselect ListPicker, which completely refused to work with Two-way databinding and had to be a little shaman.
In addition, several things were crazy:
- Virtual keyboard when appearing overlaps the lower part of the form. With this feature, I fought on every page and did not completely win. I had to wrap each form in a ScrollViewer and add a Margin from the bottom when the keyboard appeared. I really do not understand why it does not work as in the Iphone.
- The transition by pressing the ↲ button on the virtual keyboard does not transfer the focus to another element, you need to handle it yourself. For such a simple operation I used a tricky
helper
- Changing the focus of the element, with the virtual keyboard open, causes the sleep element to be transferred to the focus, will be under the keyboard. (I changed the focus from Title to Original Title by clicking)
- As long as the focus does not leave the two-way DataBinding field does not occur. For example, if in the situation shown in the picture above, click on the save button on the AppBar, then all that will be in the Original Title field in the ViewModel will not come. This had to be bypassed with code.
private void UpdateSource()
{
object focusObj = FocusManager.GetFocusedElement();
if (focusObj != null && focusObj is TextBox)
{
var binding = (focusObj as TextBox).GetBindingExpression(TextBox.TextProperty);
binding.UpdateSource();
}
if (focusObj != null && focusObj is Telerik.Windows.Controls.RadTextBox)
{
var binding = (focusObj as Telerik.Windows.Controls.RadTextBox).GetBindingExpression(Telerik.Windows.Controls.RadTextBox.TextProperty);
binding.UpdateSource();
}
}
- ApplicationBar does not work with commands and can be localized only programmatically. In addition, to make a dynamic ApplicationBar (for example, each Pivot Item has its own ApplicationBar) is still a crutch. I had to use
BindableApplicationBar , which is very bad friends with Expression Blend.
- If you want to show a large amount of text on the page, you will find disappointment in the form of a restriction, and all that does not fit 2048x2048 pixels will be absorbed by the black hole of Microsoft, and only this
article will help you.
- how easy it is to work with pictures so that they look on different screens equally well, I did not understand and used
multi resolution image
Database
With the database turned out the biggest hitch, I would even say the real Fuck up. Version WP7.5 (as well as the subsequent ones) has its own built-in DBMS - SQL CE. The first version of the program was implemented on this DBMS. I must say that the program for Iphone, Ipad, Android and the rest of the OS was written using SQlite. But for WP7, at that time, there were no official drivers (as there are none now, they appeared only from the Windows Phone 8 version), but I didn’t want to get involved with the unofficial one. For the client, this turned out to be a little shock, but with a creak we ported the already ready sqlite database to SQL CE, created models, described relations, indices, etc.
When working with small amounts of data, the database worked without problems, but when the number of records passed for a couple of thousand, tangible brakes began. I tried to optimize the work with the database for a long time, but nothing came of it. In addition, I have a free version of the studio and it was a bit problematic to work with the database, the viewer was not installed for it and I had to search for a program for working with sdf files for a long time.
Then it was decided to start developing for Windows 8 \ RT and what a general surprise it was when it turned out that SQL CE was not supported in Windows 8 \ RT and they recommend using sqlite (by that time the versions of the sqlite driver for Windows 8 \ Windows were already released) Phone 8).
It was a shock. Spitting on everything, we decided to look for options for working with sqlite on Windows 7.5. After spending a lot of time, I found an outdated library. Fortunately, there was support for transactions in it, without which we could not work. A small helper was written to work with the library (I can give the suffering). And everything seemed to work, but I still shovel the shoals in it to this day. In addition, it works very poorly with UTF8.
Personally, I concluded: if you need to work with the database, then only sqlite and only starting with Windows Phone 8.
Work with the server
Working with the server was not very difficult. The RestSharp library (Simple REST and HTTP API Client for .NET)
http://restsharp.org/ helped me ease the work with the API. The only difficulty was the execution of synchronous requests. In WP7, this can be done using delegates. True, at times it seemed to me that I was completely confused in the cobwebs of Kolbeks and had to refactor.
In addition, working with SSL turned out
to be
impossible and this is very sad. But in general, everything is not as scary as working with a database.
Localization
There were no special problems with localization. In the first version of the program, it was decided to support 12 languages. Translations were made using the
http://www.icanlocalize.com service. I can’t say anything bad about the work of the service, but there is one BUT: it works only with Iphone \ Android and I had to write a converter to convert XML to resx and back (if you need someone, I can give it). And again, there is a slight incompatibility of localization files between Windows Phone and Windows 8 \ RT (Microsoft is so soft). Small difficulties have arisen with the localization of AppBar, but they are easily bypassed.
“Hurray”: New Windows
While the development was moving, the news that there will be a new WP8 has been heard all the time. After the presentation of Windows Phone 8 in June 2012, it became clear that Windows Phone 7.5 phones will not work with WP8, but will receive their defective update. For us, this turned out to be quite unpleasant news. Spoon of honey was that the programs written for WP7.5, will work on phones with WP8, but will not be able to use all the features of the new OS. We thought: well, ok, we, like, they and to anything. But the phone booked.
When the phone came, I had to install a new studio 2012. Then, in addition to the studio, I would buy a new laptop (
because I need a processor above i3 with support for SLAT technology ). And of course, Windows 8 (where without it ...). In general, the transition was very costly, both in time and in money. We installed what we did on WP8, wept and wondered what to do next. Of course, it was not all that awful, but it became clear that it was impossible to go out like this. The main problem was in pictures, splash screens, icons, but some components refused to work. The article
http://developer.nokia.com helped solve this problem.
you can see
her
Making separate projects for each version in one solution, I was always glad that I decided to use the MVVM pattern from the very beginning.
In MARKETplace
Since the application already had its own community (for me it was a revelation that so many people have phones on different platforms at the same time), we decided to do
Betta Testing , and it's great that the platform allows you to do this. Inviting people from the forum with WP phones began testing. It took about two months to correct the errors, at the same time they changed the design and increased the functionality (all for the client). We came to the release already confident, many thanks to those people who participated in the testing.
Downloading the application to the store was quick, certification took 8 days and passed the first time. The only trouble was with the preparation of screenshots, since it is necessary for each language to make its own set of screenshots, and we have 12 languages. Sales began, and soon one bug emerged, which needed to be urgently fixed. I fixed it in 10 minutes and sent the update for certification. We created a ticket to Microsoft with a description of what happened and a request to speed up certification. No response was received, as well as acceleration - 7 working days 8 (and, taking into account weekends, 9. 9 days of unrest and self-flagellation. I am sure that they need to have a separate certification mechanism for such cases, because check for what and what has changed from the previous one versions cannot take so much time, at least for critical errors, because this is their money too.
Placed advertising in social networks, on the site and made a newsletter. The start of sales was vyalenky and the client immediately wilted, since he already had experience running this application on other platforms. Naturally, after the peak of downloads and purchases at startup, a slow decline in sales began. To date, sales are in average 10 applications per day, which is a very low indicator compared to other platforms (50 purchases per day for Android and 150 for Iphone)
Download statistics look like this:
Well, in comparison with the Iphone and Android
It is very frustrating not that sales are so low, but because with such low sales, we were in the ratings of Top Paid apps:
- Italy, Sweden, Norway: 40 place
- USA: 70 place
- Shvetsariya: 16th place.
- Czech Republic: 6th place
- France: 50th place
And in the inside of its category in the first / second places! and it is with such low purchases !!!
We can assume that the applications in the tops are doing a little bit better.
Of course, you need a competent promotion, but even if sales doubled, we will not catch up with Android and will not pay for the further development of the application.
Today, unfortunately, the customer decides whether to continue supporting the application for the WP platform, and I think about whether it is worth contacting this platform in the future.