APIMASH Quakes & Astronomy

A bit overdue, but I just realized I never really announced the APIMASH project we’ve been working on.  It’s up on github.   The purpose of the project is to illustrate how to go about constructing a mashup application from a variety of data sources.  We’re adding to the project all the time, and have both Windows 8 and Windows Phone app starter kits to get you going.  What makes the APIMASH concept so fun, to me, is that we’re consuming real-world data.   Whether you use one of our APIs we consume in the kits, or find one through a site like Mashery, Programmable Web, the Azure Datamarket, or others, mashup applications are a LOT of fun to create.  Because many mashup applications use similar patterns, consume similar JSON data, etc., you’ll see it’s easy to adapt the code to just about any scenario. I’ve got a couple of examples in the APIMASH project, and more to come soon.  The first one is an earthquake sample that illustrates how to consume a data feed from the USGS that contains earthquake information for a given time frame.  That data is then plotted on a Bing map.   This starter kit is available as both a Windows 8 app and Windows Phone app.   The starter kits are very bare-bones (intentionally) – a more complete version based off these templates is available in the Windows Store as an app called Earthquake Explorer.   Conceptually, the apps are the same, but the finished app in the store illustrates what you can do by adding a bit of polish to the app.  You can read more about creating a great mashup using this app as an example here in these blog posts. Starter Kit: Completed app: The other project I created in the APIMASH project is called Messier Sky Objects, which is available in the Windows Store as Messier Object Explorer.   This is a mashup (of sorts) that combines Worldwide Telescope with the data of all Messier objects, a collection of objects like nebulae, galaxies, clusters, et. al.  By using the Worldwide Telescope JavaScript API, it’s simple to create great-looking astronomy apps (in fact, many of my apps, listed in my side-bar on my home page, use this as a template). So what’s next?  I just released Brew Finder for Windows 8.   This app uses the brewerydb.com API to show local breweries and is available in the Windows Store here.   I hope to have a nice sample in the APIMASH project soon based on this project. Have another sample you’d like to see?  Leave a comment and we’ll review it on the next team meeting!

Windows 8 to 8.1 App Considerations: Screen Size

One of the most frequent questions/concerns I’m seeing in community is:  what application changes do I need to consider for Windows 8.1 development?   Is there anything I should be doing today in my Win8 apps to make it easy to move to 8.1 in the future? There’s a ton of great info that came out of the recent //build conference.  In my opinion, the main design consideration to take into account with applications in Win8.1 is to handle multiple screen sizes and states effectively.  Conceptually, this is nothing new:  when developing web applications or desktop apps, you have to assume the application will be viewed on a variety of form factors and handle the layout effectively. When Windows 8 first shipped, apps would run either full screen or in snapped view.  Further, the minimum resolution requirement were 1366x768, and snapped applications have a width of 320px and full height.  This simplified the design slightly, and as a result, many samples had code like the following (C#): private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) { if (Windows.UI.ViewManagement.ApplicationView.Value == Windows.UI.ViewManagement.ApplicationViewState.Snapped) { //handle snapped view -- hide stuff, etc. } } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Here, we’re handling the screen size changed event and if the view is snapped, rearranging/hiding elements as necessary, or if it’s not snapped, doing something equally appropriate.  A far better approach, though, is to not worry about snapped view specifically, and simply return to the tried and true method of examining the current app dimensions and scaling appropriately.  In JavaScript, we can do something like: window.addEventListener("resize", handleResize); function handleResize(eventArgs) { var screenWidth = window.outerWidth; var screenHeight = window.outerHeight; if (screenWidth <= 320) { //should be snapped } //handle other combinations } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   This is a far more flexible approach, and because Windows 8.1 will support a wider array of screen dimensions and snapped combinations, it’s just best to consider how your app will work at any given resolution.  Particularly for HTML/JS apps, it’s just smarter, too, as we don’t have to have any Win8 specific code and instead can leverage the same logic regardless of platform. To test your apps, I enjoy using ModernMix from Stardock.  ModernMix is a tool that allows you to run Windows 8 modern/store apps in a window on the desktop.   While you can also use the Windows Simulator to simulate different resolutions, ModernMix is lightweight and also allows you to instantly resize your apps, making it easier to test/debug screen and layout issues.  I like using it to debug non-screen issues, also, as it minimizes the flipping back/forth from desktop to full screen modern apps on a single monitor.  The simulator is still very useful for a variety of other scenarios, like screen rotation.  Disclosure: I paid for my own copy of ModernMix, and this is solely my opinion on its use as a tool for helping to build applications.  Use at your own risk. Effectively handling virtually any screen size is the best way to future proof an app.  You don’t necessarily have to handle every conceivable screen resolution – put the plumbing in place now to make it easier as the platform evolves.  You’ll be glad you did.

Microsoft DevRadio: (Part 2) APIMASH – Earthquake and Messier Sky Object API Starter Kit for Windows Store Apps

My latest DevRadio episode has been published – here are the details! Abstract: In today’s episode Brian Hitney demos for us the Messier Sky Object Explorer and Earthquake Starter Kits for your Windows 8 apps. Tune in as he walks us through both APIs and show us how easy it is get started building for Windows 8. Check out all the APIMASH Starter Kits here Download Earthquake APIMASH Starter Kit Download the Messier Sky Object Explorer APIMASH Starter Kit Next Steps: Step #1 – Download the Tools for Windows 8 App Development Step #2 – Download Visual Studio Express for Windows 8 Step #3 – Start building your own Apps for Windows 8 Subscribe to our podcast via iTunes, Windows Phone Marketplace,  or RSS If you're interested in learning more about the products or solutions discussed in this episode, click on any of the below links for free, in-depth information: Blogs & Articles: Brian Hitney’s blog APIMASH Starter Kits (all) APIMASH on Channel 9 Download the Earthquake APIMASH Starter Kit Download the Messier Sky Object Explorer APIMASH Starter Kit Download the Earthquake Explorer app for Windows 8 Videos: 7 Part Series – Using Windows Azure to Build Back-End Services for Windows 8 Apps Virtual Labs: Windows 8  Virtual Labs Download MP3 (Audio only) MP4 (iPod, Zune HD) High Quality MP4 (iPad, PC) Mid Quality MP4 (WP7, HTML5) High Quality WMV (PC, Xbox, MCE)

APIMASH and Intro to Game Dev Raleigh

I’m really excited to be hosting a few events in the Microsoft Raleigh office focused on Windows 8 development.  The first on revolves around our APIMASH starter kits – a great way to get started building mashup style applications in Windows 8, with templates and examples in both C# and HTML/JS.  The other sessions are intro to gaming, developing some simple games using Construct2, and GameMaker/other frameworks as time allows.   Here are the events/times: APIMASH: Tue 6/4/2013 from 10:00am to 2:00pm and Tue 6/11/2013 from 10:00am to 2:00pm Intro to Gaming: Wed 6/5/2013 from 10:00am to 2:00pm and Wed 6/11/2013 from 10:00am to 2:00pm Here’s a more official description of each event: Game Development for Beginners In this beginner level workshop we will cover the basics of game design, programming and publication. We will build a casual game and publish it to the Windows Store. This workshop is great for students, hobbyists and professional developers who want to learn the basics of game development and publish their first app to the store as no programming skills are required! Windows 8 App Mashup Series In this workshop you will learn how to develop Windows 8 apps based on well-known web service API's such as Twitter, Meetup, ESPN, EchoNest and data from the World Health Organization WHO. Your app could entertain or even change the world. This workshop is great for students, hobbyists and professional developers who want to learn the basics of app development and publish their first app to the store. For more info, stay tuned to the MSDN Events page!

Windows 8 “Elev8” App Challenge

We’re coming up on the annual Carolina Code Camp here in Charlotte and this year we thought it would fun to hold a hackathon leading up to the code camp, rather than simply run an all-day event at the code camp.  Here’s your chance to develop a great app for Windows 8, elev8 your skillset, and potentially win some cool stuff  Here are the details: The short version: develop a Windows 8 app, optionally attend some of our workshops, and submit it to the challenge.  At some point you need to be in person -- either at one of the workshops, or at the code camp -- as we need to prepare the demos and verify you are human.  Winners will be determined at the Carolina Code Camp.  The details: This app challenge is open to all Developers Guild members and members from the local community.  Download the free Visual Studio 2012 Express tools and other related SDKs here to begin developing your app.  Apps entered will be voted upon at the Carolina Code Camp on Saturday, May 4, 2013 by the attendees and organizers. While it is strongly encouraged you attend the Carolina Code Camp to demo your application, you do not need to be present to win (you will need to arrange to pick up your prize, if you win).  However, you must attend one of the Charlotte Windows App Developers workshops to demo and showcase your app prior to the code camp so we can have it loaded and ready for review. All apps must be original and new (published after 3/26) and must be submitted to the Windows store.  In the event it’s not approved yet and publically available, send some screenshots to show the app’s current progress.  The package files can be copied over to a demo machine, or you can bring your own machine the code camp to demo the application. Want some help developing your app?  Attend one of the Charlotte Windows App Developers meetups. Prizes: 1st Place:  Lenovo IdeaPad Yoga 11 and Nokia Lumia 820 Windows Phone.  2nd Place:  $250 Visa Gift Card, Wedge Mobile Keyboard and Wedge Touch Mouse. 3rd Place:  $250 Visa Gift Card As an additional incentive, the first 10 entries will receive a 4,000 XBOX Live Points card valued at $50! Also, don’t forget about the Keep The Cash offer from Microsoft.  Earn $100 for every qualified app you enter.  See site for more details.

Microsoft DevRadio: (Part 4) Using Windows Azure to Build Back-End Services for Windows 8 Apps – Azure Mobile Services

Abstract: In Part 4 of of their “Using Windows Azure to Build Back-End Services for Windows 8 apps” series  Peter Laudati, Brian Hitney and Andrew Duthie show us how to build the same game leaderboard service on top of Windows Azure Mobile Services. Tune in as Andrew demos for us how to get started as well as lays out what some of the +/- are for using Azure Mobile Services for this kind of service.  Check out the full article here. Watch Part 1 | Part 2 | Part 3 After watching this video, follow these next steps: Step #1 – Try Windows Azure: No cost. No obligation. 90-Day FREE trial. Step #2 – Download the Tools for Windows 8 App Development Step #3 – Start building your own Apps for Windows 8 Subscribe to our podcast via iTunes or RSS If you're interested in learning more about the products or solutions discussed in this episode, click on any of the below links for free, in-depth information: Register for our Windows Azure Hands-on Lab Online (HOLO) events today! Windows Azure Hands-on Labs Online Blogs: Brian Hitney’s blog Peter Laudati’s blog Andrew Duthie’s Blog Videos: Microsoft DevRadio: How to Get Started with Windows Azure Microsoft DevRadio: (Part 1) What is Windows Azure Web Sites? Microsoft DevRadio: (Part 2) Windows Azure Web Sites Explained Microsoft DevRadio: How to Integrate TFS Projects with Windows Azure Web Sites Virtual Labs: MSDN Virtual Labs: Windows Azure Download MP3 (Audio only) MP4 (iPod, Zune HD) High Quality MP4 (iPad, PC) Mid Quality MP4 (WP7, HTML5) High Quality WMV (PC, Xbox, MCE)

Microsoft DevRadio: (Part 3) Using Windows Azure to Build Back-End Services for Windows 8 Apps – ASP.NET Web API

Abstract: Back for part 3 in their series for “Using Windows Azure to Build Back-End Services for Windows 8 apps”, Peter Laudati, Brian Hitney and Andrew Duthie show us how easy it is to host services built with the ASP.NET Web API using the new Windows Azure Web Sites feature. Check out the full article here. Part 1 | Part 2 After watching this video, follow these next steps: Step #1 – Try Windows Azure: No cost. No obligation. 90-Day FREE trial. Step #2 – Download the Tools for Windows 8 App Development Step #3 – Start building your own Apps for Windows 8 Subscribe to our podcast via iTunes or RSS If you're interested in learning more about the products or solutions discussed in this episode, click on any of the below links for free, in-depth information: Register for our Windows Azure Hands-on Lab Online (HOLO) events today! Windows Azure Hands-on Labs Online Blogs: Brian Hitney’s blog Peter Laudati’s blog Andrew Duthie’s Blog Videos: Microsoft DevRadio: How to Get Started with Windows Azure Microsoft DevRadio: (Part 1) What is Windows Azure Web Sites? Microsoft DevRadio: (Part 2) Windows Azure Web Sites Explained Microsoft DevRadio: How to Integrate TFS Projects with Windows Azure Web Sites Virtual Labs: MSDN Virtual Labs: Windows Azure Download MP3 (Audio only) MP4 (iPod, Zune HD) High Quality MP4 (iPad, PC) Mid Quality MP4 (WP7, HTML5) High Quality WMV (PC, Xbox, MCE)

Bing Maps Mashup in Dark Skies

I’ve gotten a few requests about how to do a mashup in Dark Skies … so, thought I’d do a blog post on how it was put together.  First, what’s a mashup?   A mashup is an application that combines data from multiple sources into what is, hopefully, a more useful or interesting way to view the data.  They are often done as web applications because the data is often pulled from online sources.  But, mashups are ideal for Windows 8 and Windows Phone apps, too.  Dark Skies is simply a mashup that combines 3 main sources of data.  maps (from Bing), light pollution data (from sources like these: Save The Night, NOAA, and P. Cinzano), and favorite astronomy viewing locations and looks like so: What makes this interesting is the level of zooming, so you get really specific: Specific is good, but add in data sharing and you, hopefully, have an ideal mashup experience. Overlaying pins is easy as the map.  In fact, there’s a small sample on putting pins on a map here.   The harder part is storing the data, and for this, Windows Azure Mobile Services works really well.  I’ve talked about that in previous posts. The light pollution data is available from a variety of sources but in this case, a high res version with a color that can be made transparent (black) is ideal.  Credit: P. Cinzano, F. Falchi (University of Padova), C. D. Elvidge (NOAA National Geophysical Data Center, Boulder). Copyright Royal Astronomical Society. Reproduced from the Monthly Notices of the RAS by permission of Blackwell Science.   There are two fundamental problems in overlaying the two: first, the image should be sliced into small tiles to make it bandwidth sensitive (the uncompressed TIF file is 200MB).   The second is that the image doesn’t exactly line up.  It’s close, but there are subtle errors that get introduced despite both maps appearing to be Mercator projections.  There are a number of tools that can help you solve this problem, but in this case, I used MapCruncher.  It’s from Microsoft, and it hasn’t been updated since 2007, but … it works.  The idea is that MapCruncher can both transform/skew an image to fit the projection of the map, and carve it up into nice, little tiles.  Let’s take the following image: If I want to overlay this image at a specific point on the map. Let’s say that the two eyes should be where Lake Superior and Lake Huron are.  In MapCruncher, we’d bring in the image as an asset, and start defining matching points in the image, like so:     It’s not until we hit the lock button near the bottom left that the image is scaled/skewed/transformed to fit.  The closer an image is to being the same scale, the better/few points are required to get it look right.  Once you hit the Render button in the bottom left, it will go to town and slice and dice the image up, based on the zoom depth requested.  More on that in a second. In this case, it generated some 92 tiles.  When we preview the results, we can see the data is overlaid nicely: The tiles produced are laid out and named format known as quadkeys.   You can read a lot more about it here, but in short, each tile is scaled to fit the appropriate dimensions based on the current zoom level:   The pattern to this approach makes it very easy to know exactly what tile you need, and at what zoom level (detail).  Additionally, all of these files can be stored in a flat data structure (like a folder) which makes storage quite simple.  The best part is, Bing maps already knows how to build a quad key, so all you have to do is create a tile layer, and specify the quadkey as a parameter by putting it in curly braces, like so: MapTileLayer pollutionTileLayer = new MapTileLayer(); pollutionTileLayer.TileSource = "myurl.com/{quadley}.png";   But, this isn’t quite ideal.  One problem that I ran into is that if there are a large number of quad keys you don’t have (which is the case even in my app), there are a HUGE number of 404’s because the app has no way of knowing there isn’t a tile available for a specific quad key.  While the user doesn’t directly see this, it’s a lot of wasted traffic and just not clean.  The way to solve that is to roll your own GetTileUri handler. In my next post, I’ll detail the steps involved in setting that up!

Microsoft DevRadio: (Part 2) Using Windows Azure to Build Back-End Services for Windows 8 Apps

Abstract: Peter Laudati, Brian Hitney and Andrew Duthie are back for part 2 of their series and in today’s episode Andrew shows us how to deploy the OData Service for his Windows 8 app to Windows Azure as well as outlines the advantages and disadvantages to building back-end services via this approach. After watching this video, follow these next steps: Step #1 – Try Windows Azure: No cost. No obligation. 90-Day FREE trial. Step #2 – Download the Tools for Windows 8 App Development Step #3 – Start building your own Apps for Windows 8 Subscribe to our podcast via iTunes or RSS If you're interested in learning more about the products or solutions discussed in this episode, click on any of the below links for free, in-depth information: Register for our Windows Azure Hands-on Lab Online (HOLO) events today! Windows Azure Hands-on Labs Online Blogs: Brian Hitney’s blog Peter Laudati’s blog Andrew Duthie’s Blog Videos: Microsoft DevRadio: How to Get Started with Windows Azure Microsoft DevRadio: (Part 1) What is Windows Azure Web Sites? Microsoft DevRadio: (Part 2) Windows Azure Web Sites Explained Microsoft DevRadio: How to Integrate TFS Projects with Windows Azure Web Sites Virtual Labs: MSDN Virtual Labs: Windows Azure Download MP3 (Audio only) MP4 (iPod, Zune HD) High Quality MP4 (iPad, PC) Mid Quality MP4 (WP7, HTML5) High Quality WMV (PC, Xbox, MCE)

Microsoft DevRadio: (Part 1) Using Windows Azure to Build Back-End Services for Windows 8 Apps

Abstract: Peter Laudati and Brian Hitney welcome fellow Developer Evangelist, Andrew Duthie to the show as they kick off their series on how to build back-end services for their Windows 8 apps using Windows Azure. Tune in for part 1 as Andrew gives an overview of the series and introduces some potential techniques you could incorporate as you build your back-end services. After watching this video, follow these next steps: Step #1 – Try Windows Azure: No cost. No obligation. 90-Day FREE trial. Step #2 – Download the Tools for Windows 8 App Development Step #3 – Start building your own Apps for Windows 8 Subscribe to our podcast via iTunes or RSS If you're interested in learning more about the products or solutions discussed in this episode, click on any of the below links for free, in-depth information: Register for our Windows Azure Hands-on Lab Online (HOLO) events today! Windows Azure Hands-on Labs Online Blogs: Brian Hitney’s blog Peter Laudati’s blog Andrew Duthie’s Blog Videos: Microsoft DevRadio: How to Get Started with Windows Azure Microsoft DevRadio: (Part 1) What is Windows Azure Web Sites? Microsoft DevRadio: (Part 2) Windows Azure Web Sites Explained Microsoft DevRadio: How to Integrate TFS Projects with Windows Azure Web Sites Virtual Labs: MSDN Virtual Labs: Windows Azure Download MP3 (Audio only) MP4 (iPod, Zune HD) High Quality MP4 (iPad, PC) Mid Quality MP4 (WP7, HTML5) High Quality WMV (PC, Xbox, MCE)

My Apps

Dark Skies Astrophotography Journal Vol 1 Explore The Moon
Mars Explorer Moons of Jupiter Messier Object Explorer
Brew Finder Earthquake Explorer Venus Explorer  

My Worldmap

Month List