Windows Azure Loves Open Source at Make Web Not War Conference

Microsoft held it’s Make Web Not War conference in Montreal on May 27th 2010.

mwnw[1]

I was asked to present on the Windows Azure Platform for a CodeFest audience consistly largely of open source developers.

Here’s the Windows stack using Azure across from the LAMP stack.

20100606 cross-plat

I discussed how to mix and match a these things, so here’s a summary of some of the interoperability points and resources mentioned at the event.

Windows Azure Storage accessible from .NET and PHP

Windows Azure storage is a hugely scalable storage system with a REST-based interface accessible to systems that can talk XML over TCP.

As well as client libraries for .NET applications, there’s also the Windows Azure SDK for PHP (CTP on CodePlex – BSD License).

Windows Azure Hosting & Tools for ASP.NET apps built with Visual Studio and PHP apps bulit with either Eclipse or the Command Line

Windows Azure provides for scalable hosted applications running within the IIS platform (including FastCGI-enabled interpreters like PHP) as well as native Win32 applications (which could include your open server application listening on TCP ports).

Of course there’s a set of Visual Studio tools for developing ASP.NET applications on IIS.  There’s also Windows Azure Tools for Eclipse (windowsazure4e.org) for developing your PHP application in Eclipse to run under IIS FastCGI on Windows Azure.

And if you don’t want to use an IDE there’s also Windows Azure Command-line Tools for PHP (CTP on CodePlex – BSD License).

SQL Azure accessible from .NET and PHP applications

SQL Azure (talking just minutes – seriously like 3 minutes -  to set up a database in the cloud) provides reliable database storage in the cloud.

You can access this from ADO.NET and ODBC clients using the TDS+SSL protocol.  You can also use the SQL Server Driver for PHP 1.1 (or the 2.0 CTP) to access your cloud database from a PHP application.

MySQL hosted on Windows Azure

Yep, there’s a solution for that too – see the Solution Accelerator for MySQL & PHP on Azure

Advertisements

Navigating Bus Stops with Open Data and Windows Phone 7

In a recent post I talked about Bringing Azure+OData+Silverlight Goodness to Open Data Apps in Ottawa.  To do this, I imported standardized transportation data (that I found for the city of Ottawa) into a SQL database and exposed it as OData using WCF Data Services on an Entity Framework model.  I subsequently published a sample database to Windows Azure to demonstrate use of the data in an adapted Silverlight application that uses the Open Data Application Framework.

The OData information is accessible through a RESTful interface.  Here are the root entities displayed in IE.

20100606 odata

Last Thursday evening, I did a presentation on building Silverlight applications for Windows Phone 7.  Given that there’s an OData client library CTP available for Windows Phone 7, I knocked up a Bus Stop ulity application to demonstrate to my audience.  To get started with Silverlight applications on WP7 you can download the free developer tools (vs. the designer tools which are extensions for Blend 4 RC currently) currently the April CTP version.  The developer tools also include the XNA Game Studio for creating XNA-based games.

Here’s are the two main features I set up…

20100606 menu

Do create my menu I went with the list-based project template and then replaced the listbox content with manual entries with tag values.  These tags are then used as the names of the XAML files to load.  Quick and dirty, but it works…

20100606 listcode

Selecting the first option brings up a screen that allows the user to enter a bus stop (by its number as displayed on bus stop signs in Ottawa) and then lookup the trip heading and time of the the next 10 buses stopping at that stop.

When declaring the text box to enter the number, the attribute settings InputScope="Number" is used to default the standard input panel to the number entry mode.  The "TelephoneNumber" value may have also been acceptable (to bring up the phone keypad keyboard with bigger numbers) since many people request this kind of information using their telephone and its keypad.

20100606 entry

The application then uses a proxy class derived from DataServiceContext (and created using the DataSvcUtil command line tool since the WP7 add-in for VS2010 Pro does not currently provide an Add Service Reference option on a project) to query the OData service (running locally or on Azure).

The results come back and use the very flexible ListViewItem control (with its Metro styling) to display the results, making use of Layout="TextAndDetails".

20100606 times

If the user had gone to the other main menu option, they’d be presented with this screen.

20100606 nearby

This shows their ‘current’ location and the bus stops nearby.  Again this calls the OData service using filter parameters to bring back only bus stops that are within a 1km block of the location.  The map shown is the Bing Maps Silverlight control set to Road mode – the same one as used for desktop Silverlight apps – and the bus stop icons are added as children to the map control with attached properties specifying their locations.  The navigation controls where turned off to maximise space, so I added two Windows Phone 7 Applicaiton Bar to allow the user to zoom in and out.  The user can pan around with their finger of course.  The bus stop icons could easily be made actionable in some way. 

Since the WP7 emulator has no GPS, the location was hard coded in.  One of the samples in the WP7 SDK shows how to use Reactive Extensions to simulate location information in a way that is easily switched later to real device data. 

While this kind of application needs fairly accurate location data, others don’t.  Perhaps just knowing the city would be enough if one had just landed in that city and wanted general information.  The location APIs for WP7 allow the developer to easily make a choice between slow and accurate (while the device GPS locks on to satellites) or quick and less accurate (by using available Wifi and mobile network information in conjunction with Microsoft’s cloud-based location services).

Once WP7 devices are released, and the city officially publishes this data set I’d expect a fleshed out and polished application of this kind to be quickly available ;-).