Sunday, January 1, 2012

The need for a different Marketplace

My grandmother always said that in the first day of a new year you should do what you would like to do the rest of the year. Even if the last year I didn't had a lot of time to blog I always wanted to so here I am wanting to start the year with my blog.
So what is wrong with the current version of the Marketplace? I could say nothing really, but there is so much that could be improved/changed. I am referring here to the marketplace of all major mobile platforms: Android, iOS and Windows Phone. They are more or less the same. Right now I have experience as a developer with Windows Phone marketplace and as a customer/consumer with all three of them. The marketplace was/is one of the greatest marketing/selling instrument in the software industry. In theory it gives the opportunity to everyone to sell their ideas/software all over the world. I say in theory because it enables developers to do that, but it doesn't make it easy.
One of the biggest problems I see for the moment is the number of applications. I am looking at the Microsoft "race" to catch up with the number of applications in the marketplace. In this race the number is the priority and the quality comes second. The result of this race is that the marketplace get filled with "junk". It is the same situation on all the three platforms, but today the analysts judge the success of a platform by the number of apps in the marketplace. Let's face it there are 500.000 application in the Apple marketplace and, maybe, not even 10% are quality apps. When I say junk I say applications that don't bring any innovation, written as fast as possible and thrown into the wild just to have an application out there. From my experience (I have a small application in the marketplace) in order to have a decent application there is a lot of work to be done in developing and maintaining it. Having so many applications in the marketplace "kills" the opportunity marketplace gives you if you have a quality app because it makes it almost invisible. If today you have a quality app and you publish it will be there with (I will take the Windows Phone marketplace numbers published by http://wp7applist.com/en-US/stats/ today 01.01.2012) other 451 applications published the same day. Does you application stand any chance? Some will say yes, I would say the more apps are in the marketplace the harder will be. You can only count on the people that are trying new applications. So inevitable a quality app will go down (maybe a little bit slower ) with the others and you have to find other methods to get it "visible". Another consequence of having a lot of applications published every day without a quality check is the degrade in the service offered to developers. I remember that when I wrote this post: http://sviluppomobile.blogspot.com/2011/01/windows-phone-marketplace-more.html the quality of certification the service was great. Things changed a little in the last two months (I think they had an increase in the number of applications to certify) the certification time jumped from two days to more than a week. More frustrating is seeing applications like this one published in "bulk":


So is it worth having thousands of applications without any quality filter (just rules on how to write your app)? I would prefer a quality marketplace, but maybe having both is better. It's like when you go to the market to shop: if you want products that cost less you go in one place, if you want quality products you go to another shop, if you just need one product you go in the first shop you find. The marketplace in the marketplace could improve a little bit on the quality part. It would need quality reviewers that would select the apps for the "quality" marketplace. It is easier than to go on all review websites and look for top applications on each platform. A place in the marketplace where you go when you don't know what you really want but you would like to try some quality applications. Apple, Google and Microsoft should not be the quality reviewers but continue to do what they do and then the best reviewers/websites on each platform should intersect their chosen applications (easy to say and hard to do). It is not a bullet proof mechanism.
Other suggestion regards the reviews specifically bad reviews. In this moment if you want to make a concurrent application go down you just go and slowly start to make bad reviews in all the marketplaces. (it is a situation I am dealing with). I would suggest that, if someone makes a bad review and give one or two stars, he should be "forced" to write a reason. This should help the developers understand the problem, and, if it's not true at least ask the review to be removed. Also the reviews should be disabled when the application is hidden. For the hidden applications the reviews don't make any sense.
Being able to publish a beta version of the application in the marketplace is an awesome feature, but in this moment, for me is almost useless. You have to find your beta testers, but it is a difficult task. So there should be an "open" beta option. This way anybody that wants to test the beta and has a link to it can do it with a limit of 100 users (more or less like the hidden apps but limited to a number of users).
In my opinion 2011 was a great year for Windows Phone even if the market shares don't reflect it . The 7.5 version is a great step forward and I hope that 2012 will bring us another big step. I still think that the application list is "ugly" and not really usable, we need some way to group applications (maybe an evolution of the "folder" concept).
I really hope Microsoft will make Apollo an EVOLUTION and not a REVOLUTION.

Happy New Year to all my readers! A better year to everyone.

NAMASTE

Thursday, October 27, 2011

WP7 A better InkPresenter using XNA

  Last week I was at SMAU Italia  together with Matteo Pagani giving a hand at Windows Phone 7 labs and having a good time with my friends at Microsoft. I also got the pleasure to meet Ben Riga. One of the attendees at the laboratory raised a really good question about the performance of the InkPresenter in WP7. He is using the control to capture a signature, but if you are pretty fast (usually people when they do their signature are fast) the result is "ugly" and not really usable. You won't get a smooth curve, but something like this:


 This screenshot is taken in the emulator, but on the real device the curve looks worst and it's easy to reproduce this behavior. I took this "problem" as a challenge (two nights of work and now the third to write the post) convinced that I can get better results with a mix between XNA and Silverlight, mix that in Mango is possible. T
 The main problem is the number of points returned by the event MouseMove of the InkPresenter control which is not enough points to draw a decent curve.
  The first thing I've tried in the XNA version was to use the TouchPanel.GetState() but I was surprised to see that I get the same number of sampling points as the MouseMove in InkPresenter. The things improved a lot when I've used TouchPanel.ReadGesture() with GestureType.FreeDrag. Using these sampling points as StylusPoints for the InkPresenter the situation improved a little:


 The black line is the one obtained with MouseMove and the red one is the one obtained with ReadGesture.The result is better, but not satisfying. The only way to further improve the result was to manually draw the curve without InkPresenter. I've have used BezierSegment to draw the curve. Without any processing this would be the result:


The new curve is the blue one which is better than the others, but it is still not smooth in some points. This is because a Bézier path is smooth if each endpoint and its two surrounding control points lie in a straight line. In other words, the two tangents at each Bézier endpoint are parallel.



There is more than one approach to solve this behavior and I've implemented two (with all the mathematics I felt back at the University http://en.wikipedia.org/wiki/B%C3%A9zier_curve). 

The first is an algorithm for Automatically Fitting Digitized Curves with the Douglas Peucker algorithm to reduce the number of points (http://stackoverflow.com/questions/5525665/smoothing-a-hand-drawn-curve).

The second one uses Bézier splines which creates the First and Second control points for each Bézier segment http://www.codeproject.com/KB/graphics/BezierSpline.aspx . 

With both algorithms the results are pretty good:


If you are interested to play with the sample you can change the following parameters:

double PhilipSchneiderTolerance = 0;
double PhilipSchneiderError = 4;
-used when the fitting algorithm is PhilipSchneider (run this sample http://cid-c27e99281f78a67a.office.live.com/self.aspx/Public/Simplify.zip on the desktop to understand what changes when you change the Tolerance and the Error)

 private bool _showPoints = false;
-shows or hides the points read by ReadGesture
        
private bool _showOtherCurves = false;
-shows or hides the InkPresenter curve using MouseMove and ReadGesture

private FitCurveAlgorithm _algorithm = FitCurveAlgorithm.PhilipSchneider;
-changes the fitting algorithm: None, BezierSpline, PhilipSchneider




P.S. The project still needs some working/polishing in order to be used in production, but that is the simple part so... HAVE FUN

NAMASTE

Friday, October 21, 2011

Skydrive Library for Windows Phone v1

   I've started this project before Build. At that time I didn't know what Microsoft was preparing for the skydrive REST Api so there was no way to fully access your skydrive folders and files. The idea was to be able to get the modified files (word, excel) from Skydrive back to the dropbox account (a lot of people requested that feature and, as you probably know, in Mango you can save the files directly to your skydrive account). So I've started by contacting the people that already had developed applications that use Skydrive for Windows Phone 7 ( it doesn't make sense to reinvent the wheel if you can borrow or buy one) . I've found 2 applications: Sky Wallet and the other Skydrive Player and the answers from the developers were not what I was expected: the first one pointed me to Skydrive.Net which is(was) unusable for Windows Phone and then didn't replied to my other emails (so I understood it was disturbing for him to share his work) and the other said that the source code was not really clean (so more or less I don't want to share it). The only option was to start digging up and find out how they did it (that day I've also promised to myself that i will publish the code even if this will mean that the application I have in the marketplace will loose some value) It took me more than I expected  to understand and implement the mess (for me it's a mess) behind the WebDAV, but the results are not bad ... it works. The source code is quite a mess but it's free and you can use it (if I wait to have time to "clean" the code I will never publish the library). When the REST api will be out of beta (you cannot publish an app with the beta sdk) this library will be obsolete, but till then you can use it in your applications and they will pass certification (at least mine did ... till now ). The list root folder method is slow because I have to call two methods in order to have all the files and folders. You will also find a test project that will show you how to browse your skydrive. Creating folders and uploading files are not implemented in this version and it doesn't make sense to implement them because it will be much easier to do it with the REST api. If you need this functionality contact me and I will point you in the right direction.
  The project is published on Codeplex: http://wp7skydrive.codeplex.com/
  
  If you have questions, need support, or want to improve the library please let me know. If you wanna see a better integration of the library than the simple test project you should buy my dropbox client Boxfiles :) .

NAMASTE

Thursday, October 20, 2011

DropBox library for Windows Phone 7 v1.1

 I have just published an updated version of my Dropbox client on CodePlex. You can download it here. I have rewritten the library from scratch (took out all dependencies - Json.Net and Hammock, added the download progress event and a lot of other things that I cannot even remember). It's faster, better and it's the exact same library I am using in my Dropbox application . I really hope that it will be useful for your projects and hope your projects will not be something similar to Boxfiles.
   That's all folks!

P.S. It doesn't have a test project, but you can use the one in the first release. It should be easy to use and pretty intuitive. If you find bugs or want to improve the library please let me know


NAMASTE!

Thursday, September 8, 2011

BoxFiles for Dropbox v2 Beta

          Dear readers,
  We've just published the first beta of BoxFiles for Dropbox Mango edition :). The beta is available at: zune://navigate/?appid=8cfa8f66-3174-48e1-99b5-f2d0146113e8 and is limited to the first 100 users that will download the app (if we reach that limit and we still have requests we can publish another beta). We've rewritten most of the source code so it needs a good testing and some feedback. Send your problems/suggestions to: info@neologics.eu .
  The Dropbox library was rewritten from scratch taking out all the 3rd party components (JSON.Net and Hammock), but the featureI am most proud of is the integration with Skydrive. You can now upload your modified Office files back to your Dropbox account.
    We need your help to make our product better. If you can, please tweet the link.

NAMASTE!

Thursday, September 1, 2011

Mobile HTML5 Speed Reading Again

 Today I've upgrade my iPad 2 to iOS beta 7 and I was thinking that a more "realistic" comparison for the HTML5 Mobile Speed reading would with the new iPhone compared to a new Windows Phone Mango device (new year new hardware). On my Omnia 7 with 7712 build and video drivers not optimized for Mango I get around 30fps, the same that I was getting on my iPhone 4 with iOs5 beta. I remember that on a tweet I read that, on some devices, Windows Phone 7.5 Mango was doing 60 fps. On the other hand the new iPhone will probable have the A5 processor just like the iPad2 so I've run the same test on my device and the results are not bad at all. The iPad2 with iOs5 beta 7 is doing a stable 60fps. This is the frame rate we can expect from the new iPhone.So Apple and Microsoft are, for now, at the same level and let's hope that the OEM's will optimize their video drivers for Mango in order to get 60 fps, if not it could be a boomerang for Microsoft (the new iPhone, doing 60fps, would smash WP7 Mango that is doing 30-40fps). Hope it won't happen.

Here is the test on the iPad2

NAMASTE

Thursday, August 25, 2011

Where XNA beats up Silverlight

   Finally a blog post. I am in the process of updating (it's more of a rewriting) Boxfiles for Mango. Till now I have rewritten the Dropbox library from scratch (took off all the dependencies Hammock, Json.Net and now it's pure HttpWebRequest) and developed a library for accessing Skydrive resources (it works and it is possible to list the folders and download the files mainly what I need to get the modified Office files back to Dropbox). Anyway the Skydrive API it's a mess for the moment and I really hope they will get a "clean" API. The current version of the Rest Api is usable only for contacts, photos and videos. I will post both libraries on Codeplex (very probable after I finish the update of Boxfiles). 
    So what is this post all about. One of the features of the new version of Boxfiles will be pinch to zoom. Searching on the web I have found the XNA and the Silverlight solutions. I've started with Silverlight and with pinch to zoom added the application would easily eat more than 90MB of RAM while the image window is opened.  Digging up on what was consuming so much memory it turned up that the image window eats around 40 MB of memory (also because I have enabled CacheMode="BitmapCache" in order to have a smooth zoom). This is an abomination for a simple page with one menu and an Image control displaying a file  of 3MB. I than remembered that, in Mango, Silverlight and Xna can "live" together. The feature was introduced for enabling Silverlight in Xna (menus and stuff) , but in this particular case I will use Xna in Silverlight. I've created a project where I can compare the pinch to zoom on both Xna and Silverlight. The results are not bad: XNA uses around 10MB while Silverlight uses 40MB and the pinch to zoom is much smoother in Xna (the sample starts with 10MB of memory occupied).




    In order to have a realistic comparison I've added an ApplicationBar to the Xna window and both of the windows have a Menu where you can force the GC to collect. While testing the solution I've found a really strange behavior (in my opinion it's a memory leak of the image control and maybe somebody from Microsoft should have a look into it): the Silverlight window, after the first launch, was not releasing 10MB of memory. In order to release the memory I had to manually remove the Image control from the ContentPanel and give it a null value.


ContentPanel.Children.Remove(image);
image = null;

If you play with the solution just comment the two lines located in OnNavigatedFrom (ImageSilverlight.xaml.cs) and you will see the leak.

Here is the Source Code

NAMASTE!