Archive for category WP7

PickFlicks for Windows Phone–One Year Later

SortBy

 

My Windows Phone application has been in the marketplace for one year now and an update has just been published (v2.5).  The new version was necessary as Netflix updated some API URL’s that required code changes, plus I added a new feature allowing users to sort new titles by date, title, or rating.  As usual, the submission and approval process was smooth and quick (4 days).  I thought it would be good to summarize how things have gone the past year.

The app has been downloaded about 1200 times- it’s free and ad supported via the Microsoft PubCenter, but I won’t be retiring on the proceeds.  The grand total earned with ad impressions was under $20!  But, it’s been good learning experience and I actually use the app frequently as it solves a problem I personally had.

What’s amazing is this system has run almost untouched and automatically for the past year using a WCF service on my website and Amazon EC service (a micro Windows instance free for 1 year).  I shut down my EC instance as the free time was going away, but it was only being used to start the WCF service to process the Netflix RSS feed and this is easily done on my own server.  The RSS feed is processed and data made available to users every few hours, and it’s been working without modification for the entire year.  Nice!

Since I don’t have a Windows Phone 8 yet I won’t be converting it to the new version anytime soon…I doubt there are any new features to take advantage of and this version should run fine on V8 devices.  Writing the application was a good experience and not too difficult, so overall the experience has been very pleasant.  If you want to install PickFlicks, here’s the link:

Update 6/15/2014:  Netflix has decided to discontinue their public API, making updates to this app impossible.  This is unfortunate, I don’t think it’s good to create walled gardens and keep out third party developers.  I’ve unpublished the application from the store and hope to try a new mobile project sometime soon.

 

PickFlicks in the Windows Phone Marketplace

 

PickFlicks is Available

I’m excited to announce the PickFlicks application is now available on the Windows Marketplace!  The approval process took about 3 days and it passed certification the first time.  You can click the link below or use the QR code to see more details on the marketplace page.  It’s free (ad supported) and I’ll update how the marketing proceeds and if any money is made from Microsoft Pubcenter.

There’s also an application support & info companion website HERE

Download For Windows Phone

 

 

PickFlicks QR Code

 

My First Windows Phone Application – PickFlicks

I’ve spent the last few weeks watching Windows Phone training videos (via learndevnow.com) and reading all the great Microsoft articles on WP7 development and finally writing my own application. I started with the idea that there was no convenient place to get a date sorted list of new titles available on Netflix Instant Streaming and add to your queue and decided this would be a useful phone application and a fantastic learning experience. I really believe in having hobby projects you can work on in the background to learn new skills and keep things fun and interesting.

I can’t say it was entirely easy or straightforward to learn Silverlight programming, MVVM patterns, OAuth security, WCF data services, RSS feed parsing, or the quirks of working with third party API’s (Netflix and Rotten Tomato) but I think the end result is simple, easy to use, and useful. It’s been submitted and will hopefully be available in the marketplace soon…I’ll update as things progress. During this process I also moved my website from GoDaddy to WinHost, and am much happier at WinHost. The site runs much faster and has more flexible policies for .NET developers all the while charging about the same prices. Sold!

WCF Services, Shared Hosting and Windows Phone 7

Creating a Microsoft web service can be a straightforward thing, but add in the requirements of deploying a WCF service to a shared hosting provider (such as GoDaddy) and have it available to web applications and to a Windows Phone 7 device can add a few wrinkles.  Most examples I read only explained these concepts on a local system and did not go into the complications of deploying to a real hosting provider.  This post explains how to achieve those goals using Visual Studio 2010, .NET 4.0, WCF, and a Windows Phone 7 Silverlight project.

You’ll need to have Visual Studio 2010 and also have your shared hosting provider configured for .NET 4.0 and running IIS 7.0.  You’ll also have to download and install the Windows Phone 7 toolkit if you’ll be doing the phone portion also.  The hosting provider steps may take them a few hours to complete, so get that going first.  Once set up, go into the providers IIS admin console page and create a new directory and make sure to set the folder as “Application Root” and enable “Anonymous Access”.

 

The Windows Communication Foundation Steps

image

Below, you can see the new services folder in the IIS console:

image

 

Now, onto the coding.  When working with external systems, it’s best to first get things working locally then move one piece at a time up to the web and get that working.  In other words, only change one variable at a time….so that when you get the inevitable configuration error you can assume it’s a hosting issue rather than your own bug and simply Google for solutions.

The first step is to create a WCF service in Visual Studio.  This example service takes an integer and returns an object holding the number’s square, it’s square root, and a request timestamp field.  This slightly more complicated example shows how you can return complex objects via the web service.  Create a new Project using the WCF Service Application (C#) template.  Change the names if desired. My interface “IService1.cs” looks like this:

using System.ServiceModel;

namespace WcfService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService1
    {
        [OperationContract]
        string GetSquared(int value);

        [OperationContract]
        myClass.Numbers Process(int value);
    }
}

We’ll add the “myClass.Numbers” class next.  This holds the results of our service.  Add a new class item to the project, the example looks like this:

using System;

namespace myClass
{
    [Serializable]
    public class Numbers
    {
        DateTime requestTime { get; set; }
        public int squared { get; set; }
        public double root{get;set;}

        public Numbers()
        {
            squared = 0;
            root = 0;
        }

        public void ProcessNumber(int value)
        {
            requestTime = System.DateTime.Now;
            squared = value * value;
            root = Math.Sqrt(System.Convert.ToDouble( value));
        }
    }
}

 

The class implementation is simple- one field holds the request time, another the square, and a final one the square root of the supplied value.  Next, add a reference to the new class to your WCF project (right-click on references).

Implement the WCF service with the following code:

 

using myClass;

namespace WcfService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
    public class myservice : IService1
    {

        public myClass.Numbers Process(int value)
        {
            myClass.Numbers item = new Numbers();
            item.ProcessNumber(value);
            return item;
        }
    }
}

The service only has one method “Process”- it takes the supplied value, creates a new “Numbers” object, processes the number, and returns the object to the caller.

Now to test your WCF service locally.  Set the WCF project as the startup project (right-click on the item in solution explorer), and also set the “myservice.svc” item as the startup page.  Press F5 (for a debug run) and VS 2010 should open a WCF test client for you:

image

Double click on “Process()”, type in a value in the request Value field, and click the “Invoke” button.  The response results should come back and you can see the request time, square root, and square values.  Great…it’s working so far!

You can also test the standard WSDL screen by right-clicking on the WCF service project and do a “View in Browser”, then in the directory listing choose the “myservice.svc” item.  You should get a page like this:

image

 

Before deploying to your provider, verify the following configuration setting (multipleSiteBindingsEnabled) in the Web.config…it allows your service to work in a shared hosting environment.  You might need additional settings depending on yours:

 

image

Now, let’s deploy this to the shared hosting provider (GoDaddy in this case).  I used FTP access to publish the project to the folder I previously set up as the application folder.  Right click on the WCF project and choose “Publish…”.  A dialog appears where you can enter your path and credentials:

 

image

Once finished, you can test by invoking the URL to the .svc file which will look like: http://techybit.com/programs1/services/myservice.svc (assuming your application folder configured above is services).  You should get the standard WSDL info page.  If an error occurs, check all details above and/or Google the error message.  If you get stuck, you might have to contact your service provider for details on how to configure WCF services for their environment, but these steps worked for me.

At this point, you could create a standard webforms application, add a service reference to the WCF service, and call the interface method.  I tried this, and no unusual steps were needed other than making sure the WCF binding is set to basicHttpBinding.  It’s more interesting to try this with a Windows Phone 7 system and so the web version is left as an extra exercise.

Click here to proceed to Part 2: The Windows Phone 7 Application Steps

 

Digitize with Windows Phone 7, Gmail, and Handyscan

 

hd7I’ve been using an HTC HD7 running Windows Phone 7 for 6 weeks now, and I love it, rarely missing my iPhone.  I discovered a very useful technique to digitize all my important papers and receipts using the phone, an application called Handyscan, and Google Gmail.  This method allows you to scan papers with the phone, send the result as a .PDF via email to Gmail, and auto tag it for easier retrieval later.  Here’s the steps:

  • Set up a rule in Gmail under Options->Filters and set the parameters for any email with the word “Handyscan” in it which has an attachment to apply a label like “ScannedDocs”.
  • Install the Handyscan application ( JDB Pocketware Handyscan ) onto the phone and start it up by clicking the “Scan New Document” button.
  • Take a picture of the document/receipt.  The new Windows Phone 7 has a good camera with LED flash so the results are excellent.
  • The application presents three image optimizations for you to choose from, select the one which looks best to you.
  • Save the picture in Handyscan and name it something logical related to the document…I also add the month & year at the end for future reference.
  • Use the application’s menu (the three dots along the bottom right) and email the picture in Handyscan as a PDF (you could also leave it as a .jpg) to your google email account.
  • When Gmail receives the email it will apply the label, making it easier to find later.

 

I’ve used this method to archive and digitally store lots of documents in the cloud for later retrieval and only takes a minute to complete…give it a try and see if it’s useful to you.

Note:  The application currently costs $3.99 but there is a light version…I’m not associated with the company, just a satisfied user :-)

Tags: