WinPhone DevHub — the mobile app that should be on hand at each WP7 developer

Almost all WP7 developers use third party libraries controls. You, as a developer, and went through what would be to download the examples for the library, compile and install it on your phone? Was there a moments when you are looking for the right icon to ApplicationBar? How long did it take to find her? And, probably, wished to be informed of when new icons? And if you want, whatever that something else was collected in one app for Windows Phone? If Yes, then welcome to under the cat, where you will find a description of the app WinPhone DevHub and some technical details for its creation.

I am developing for Windows Phone and often have to put on the phone examples of controls from different libraries. It is not only long, it is necessary to download the library, compile it and run it on the phone but also reduces the number of available slots for development applications (now this number is ten). Such a waste of time I was terribly upset, because, for example, the company Telerik has a wonderful demo app in the Marketplace, which contains examples of how to use RadControls. I asked the developers of these libraries as Silverlight Phone toolkit, Coding4Fun toolkit, amCharts asked if they plan to release the app with examples for their libraries. All the developers replied that they do not see the point. Then in my head, the idea was to gather examples of popular libraries together and release it in the form of the application.

Pondering what else is useful for the developer can be added to the app, I came to the conclusion that the icons for the ApplicationBar is very popular, because it uses virtually every program.

Thus, for the first version of the application I decided to implement support for examples of controls several third-party libraries and add some popular icon sets.

I chose the following libraries controls:
the


When you select a library, download the corresponding demo.



It probably makes sense to add another library of controls but for the first version of the presented set is enough.

Among the icon sets I chose three:
the


As the development is on a desktop machine, and the examples are open on the phone, a very important feature, which is implemented in the app is the ability to obtain detailed information (including the download link) on any set of tools presented in the program. Invoke the context menu set on the main application page and send yourself an email with detailed information.



The app allows users to send suggestions using the Uservoice service (see the tab About or section Your last About Dialog).

Some technical aspects

All demo applications are taken in the form of projects in the respective libraries and are included in the solution application. The solution has the main application that displays links to navigate to the application library controls.
Initially, the application was written without compliance with the MVVM pattern: the main goal is took the demo application included these projects in your solution, brought links to the main pages of each demo app and all can enjoy! As shown, this approach allows you to make a one-time application, because to extend it is almost impossible, the code looks like a classic spaghetti-code, the implementation is a little bit difficult automation is difficult, etc. At the moment the application is rewritten using MVVM.

Of course, in the beginning at the home screen I placed the buttons with hard-coded paths, hardcoded demo applications. Had to register everything by hand, which was tedious and not convenient. In the end, laziness won and I created a xml file that made all the important settings for each library as the application name, icon path, the path to the main application file, etc. It is possible to implement an algorithm that reads xml file and creates the data source for the ListBox. If I come (and I know this will come!) the idea to add a new demo project, I will simply update the xml file, add this project to the solution and everything!

the
<ControlToolkits>
<ControlToolkit>
<Id>1</Id>
<Name>Coding4Fun Phone Toolkit</Name>
<Version></Version>
<MainPageUri>/Coding4Fun;component/MainPage.xaml</MainPageUri>
<About></About>
<Author>Coding4Fun</Author>
<ImageLogo > Images/Coding4FunLogo.png</ImageLogo>
<Background>#FFF09609</Background>
<ToolkitUrl>http://coding4fun.codeplex.com/</ToolkitUrl>
</ControlToolkit>
<ControlToolkit>
<Id>2</Id>
<Name>Silverlight Phone Toolkit</Name>
<Version></Version>
<MainPageUri>/SilverlightToolkit;component/MainPage.xaml</MainPageUri>
<About></About>
<Author>Microsoft</Author>
<ImageLogo > Images/SilverlightToolkitLogo.png</ImageLogo>
<Background>#FF1BA1E2</Background>
<ToolkitUrl>http://silverlight.codeplex.com/</ToolkitUrl>
</ControlToolkit>
....
</ControlToolkits>

C icons similar story, but laziness won me much faster, because the number of a lot more icons (over 700 at the moment), and I wanted to reach the next level of automation of its work: when you update any of the icon set, I have only to unpack the icons into the appropriate project folder in VisualStudio to see what new files have appeared and add them to the project. Compiling, launching applications and opening the appropriate set of icons, that's all we need to do to see the new icons on the screen. So I created a similar xml file where you specified the path to the folder where you stored the icons of the library, author, description and so on Reading data from xml file using Linq-To-Xml.

the
<IconSets>
<IconSet>
<Id>3</Id>
<Name>Templarian Pack</Name>
<Version>1</Version>
<Path>/Icons/Templarian/</Path>
<About>This is a project started a few months ago to supply creative commons licensed icons to Windows Phone developers.
If you found these useful feel free to buy me a beer with the donate button in the footer.</About>
<Author>Austin Andrews</Author>
<Background>#FF00ABA9</Background>
<PanoramaBackgroundPath>Images/PanoramaBackground4.jpg</PanoramaBackgroundPath>
<Url>http://templarian.com/project_windows_phone_icons/</Url>
</IconSet>
....
</IconSets>

Then I was in for a nasty surprise, because I can't get the resource list that are stored in my project path. The only option is to flag such resources as Embedded Resource, and then filter the desired icons. On the other hand, the icons that are marked as Embedded Resource cannot participate in binding (Data binding) that makes writing extra code. The decision came suddenly — I can generate any files based on the metadata of the current project (files, folders, their location, etc.) using such tools as T4 that is built into VisualStudio. A few lines of code and I have another xml file which contains the paths of all icons that I will display. Changing the attribute icons with the Embedded Resource to Content, I can use them in the binding process, which will improve the performance and simplify the code. The solution with code generation will be used in the next release of the application.
It should be noted that the approach of using xml files as data source to build the elements on the user interface used in the library Your Last About Dialog. You should only specify the source data (names, description, addresses, etc.), and the system will build the user interface by all the rules for Metro apps.

In this application I decided to try ready-made solutions for Analytics and tracking bugs.

Analytical information I decided to obtain through the service Flurry. This service provides a library for Windows Phone, connection is very simple — one line in the file App.xaml.cs, sending a particular event — even one line. Most importantly, think about what events you'd like to receive and what event parameters should be specified. In WPDevHub I keep track of which library controls and icons users visit, and a description of what libraries users send yourself in the mail.

For bug tracking I use the service bugsense (he's already mentioned on habré article about the creation of the application Kinopoisk). This service is also connected by adding a single line to the file App.xaml.cs. The service is very convenient and extremely useful, despite the limitations that are inherent in the free version account. A free account allows you to store an error on the server for 7 days (notified by mail about new bugs comes regularly), to no more than 500 bugs per month. The service provides detailed information about the error, including stacktrace, details of your phone, OS version, country, type of network connectivity, frequency error, etc. Very convenient feature is the ability to mark a bug as fixed if the bug has been fixed in code and should no longer send email notifications about it. But all cases the error will of course be taken into account in the reporting system.



It should be noted that the vast majority of errors was revealed in the demo projects. This is understandable, because these projects have not been tested with the rigour that is required when passing the stage of certification in the Marketplace. Bugsense has worked very well and I had a dozen bugs in the demo application, which should be corrected in the next release.

Bugsense provides an opportunity to use a premium plan for projects with opensource (for normal projects the cost of this plan is ~300 USD per month). I will not fail to take advantage of this offer and will soon release the project under an open license.

As a mechanism of monetization, I chose the display of advertising. I use Microsoft PubCenter as an adware provider, which has some of the highest prices for ads. Unfortunately (to my regret :P) AdControl is hidden and does not show advertisements if the user's regional settings correspond to those countries which are not supported by these advertising providers. For example, Belarus and Russia are not supported. In one of the following versions I plan to move to Windows Phone 7 Ad Rotator, which allows you to use several ad providers and, thereby, to maximize revenue.

In next releases I plan to redo the design of the main page, I'd like to add a new entity and new opportunities. For example, I want to add a few cheatsheets (such as design guidlines, certification, checklist when you publish an application, etc.) that will be useful to the developers to add a new library of controls and icons, and something else.

I hope WinPhone DevHub will be required (handheld?) the app for all developers under Windows Phone, and I will be able to satisfy all wishes to improve the app. If you have any ideas what else to add, please, date me know in any way.
If you download the application, do not be lazy to put in the Marketplace (with a bookmark About or from Your Last About Dialog).

Link the app in the Marketplace.
Link for the user tips and ideas.
Email for feedback.
online business card.

Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Why I left Google Zurich

2000 3000 icons ready — become a sponsor! (the table of orders)

New web-interface for statistics and listen to the calls for IP PBX Asterisk