Calling WebAPI service from Windows Phone 8 using HttpClient

I had to solve what I figure must be a typical problem for a windows phone developer today, invoking a WebAPI service from the Mobile side. I found documentation on this process rather scarce, so here’s how you do it.

NuGet is your friend in this regard.

Step 1.

PM>  Install-Package Microsoft.AspNet.WebApi.Client -Pre

Step 2.
Confirm references

References

Step 3.

Now you can use ¬†the HttpClient Async API to invoke your WebAPI service and return data. Here’s an example.

code

Which can then be used like this

StockService

To download the source click here.

Advertisements

Can’t start the Windows Phone Emulator – The Windows Phone Emulator couldn’t start because the hypervisor isn’t running.

So I figured I’d document my first experiences with the Windows Phone 8 SDK.

First issue I ran into was an error “The Windows Phone Emulator couldn’t start because the hypervisor isn’t running.”

Image

While the information shown in the “more information” link helps its a bit verbose.

Basically enable “Execute disable bit” and “Intel Virtualization Technology” in the equivalent BIOS settings of your motherboard.

WP_20130927_001

and ensure you have the “Hyper-V” features turned on

windowsfeatures

That’s it. Should be working now!

Magic Url Fetcher (Website Thumbnailer)

I recently tried to find a service to create website thumbnails for a product I am currently working on. Unfortunately I was unable to find a company that provides a service that returns the metadata I needed. Hence I created an Azure Service I call Magic Url Fetcher which allows you to take a thumbnail of any site and use it in your application.

If you’d like more information please visit: http://www.maxgershkovich.com