July 11, 2014

 

WP8 - some troubles report

While releasing first commercial app for WP8 I had experienced following effects.

1. Beta app updates very unstable. Frequently the description is new, but xap itself is of previous version. I don't know workaround. Usually publish new version. You have to check version carefully on every launch.

2. If you have crashes (unhandled exceptions), these stack traces will be in dashboard only 4 (yes, four) days after exception happened. After all, not every crash is reported. Workaround: I ended up writing my own unhandled exception handler which sends reports to my own sever.

3. IAP logics is not so simple as it may be thought of when you use consumable products with your own server check. There's one pitfall: you must call CurrentApp.RequestProductPurchaseAsync() only from UI thread (or you will have and unhandled exception!), while LicenseInformation.IsActive IAP license testing calls must not be called from UI according to MSDN. So it seems good idea on "buy" click to show some "please wait" indicator and continue to work in new thread. But when time comes to make a purchase method call you don't have Dispatcher.Invoke() for synchronously executing in UI thread (I mean wait for result). Also, you have to deliver exceptions from UI thread to your own thread. Here's the way:

          //not UI thread. something like "new Thread(delegate(){ ...following code... }).Start();"
          AutoResetEvent waitHandle = new AutoResetEvent(false);
          Dispatcher.BeginInvoke(async () =>
          {
            try{
              await CurrentApp.RequestProductPurchaseAsync(productListing.ProductId, false);
            }
            catch (Exception e) {
              purchaseEx = e;
              log(print(e)); 
            }
            waitHandle.Set();
          });
          waitHandle.WaitOne();
Or course you have to handle exceptions from separate UI thread, otherwise you will have unhandled exception and crash.

4. RequestProductPurchaseAsync() leads to ProductLicense.IsActive = true. But nobody knows when. MSDN says ""

5. When user press Cancel (or Back button) during system purchase confirmation, CurrentApp.RequestProductPurchaseAsync() throws an exception. This is undocumented behaviour, so you have to catch general Exception (I've seen System.Runtime.InteropServices.COMException at 8.0, but nobody guarantees 8.1 have same). By the way, catching general Exception is called "no-go" by Microsoft. Very nice.

Actually, I did not found good code sample of working IAP for consumable and self-checking. I'm going to publish my code when I test it fully. See next post.

Labels: , , , , , , ,

August 15, 2010

 

Drawings in new version of google docs text docs: regression

In new version of text editor of GDocs it's very hard to maintain aspect ratio of drawings to keep text readable. Drawing is rendered at server side and the aspect ratio of drawing when rendered in document now does not correlate with its content size. Renderer tries to calculate the text scale from drawing aspect ratio. But size is not correlated to drawing content. So anytime you insert or change drawing you have to manually adjust its size just to make text readable (which is very hard, because text is not rendered in a stylish way for any scale incompatibility).
It's impossible to use previous version of drawer with new version document, but you can create documents in old version of editor. Also, It's impossible to copy drawing from new version to old one via web clipboard.
In comparison to GDocs tricks MS Office is just as solid as stone. Just checked: 2007 Word has almost same cool drawings editor.
I need solution to simplify sharing of DOCs (svn seems to me very heavy for such an easy task, cause it's impossible to use web interface to share or publish one document). Do you know one?

Labels: , , , , ,

July 24, 2009

 

[office2007] ...Application configuration incorrect...

Some time ago my office 2007 stopped work after I uninstalled custom Windows Search 4 component of Windows. Reinstalling of Office didn't work (actually, even uninstaller/installer didn't work, both have errors!).
If you have same problem, here's solution: (re)install MS C++ 2005 runtime.

Labels: , , , , ,

This page is powered by Blogger. Isn't yours?