Wednesday, February 23, 2011

Simple Twitter Integration

A few posts ago I did a quick post on simple Facebook integration but in HTML . Twitter is even simpler and this method can be applied to Silverlight easy enough. First lets look at the HTML version:

<a href="http://twitter.com/share?url=http://www.HackingSilverlight.net&text=check out this awesome site&via=DavidJKelley"
>Tweet</a>

you can see that basically its just a hyper link to the twitter share URL but it adds 3 query string parameters namely URL , text and via. URL gets parsed into a short URL by twitter and then the text is inserted and then a note about what user it came from meaning in this case the twitter would be something to the effect of:

check out this awesome site http://t.co/nn6oQN8 via @DavidJKelley

keep in mind that users will have to login and the tweet will be posted as them.
In HTML rendered the above code would look like this in your browser:

Tweet

now from Silverlight in C# it is about as simple with something like:

System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("http://twitter.com/share?url=http://www.HackingSilverlight.net&text=check out this awesome site&via=DavidJKelley"), "_blank");

this would do effectively the same thing opening a new browser window and ask them to login to twitter and then let them post the same thing. Nice and simple :)

Wednesday, February 16, 2011

Bytes by MSDN: David Kelley and Tim Huckaby on building applications for Windows Phone 7

This week, meet MVP David Kelley, Principal User-Experience Architect at Wirestone, as he is interviewed by Tim Huckaby, Founder of InterKnowlogy. David and Tim discuss the user experience on large screens, such as the Nike touch wall, and small screens, including Windows Phone 7. David offers tips on how to build applications on Windows Phone 7, using Metro as the aesthetic, with a rich user interface.

watch the video at: https://channel9.msdn.com/Blogs/Bytes+by+MSDN/Bytes-by-MSDN-David-Kelley-and-Tim-Huckaby-on-building-applications-for-Windows-Phone-7

Silverlight TV 61: Chat on Deep Zoom, Touch, and Windows Phone 7

Thinking about writing a touch intensive Windows Phone 7 application? In this episode, David Kelley of Wirestone shares his experience creating rich experiences with Silverlight. David has been involved with many high profile applications and he shows off both the Jordan Deep Zoom mosaic and his Simon for Windows Phone 7 application that's in the marketplace (for free). This is a great discussion with a Silverlight user experience expert.

Watch the video here: http://channel9.msdn.com/Shows/SilverlightTV/Silverlight-TV-61-Expert-Chat-on-Deep-Zoom-Touch-and-Windows-Phone

Jordan Mosiac: http://www.jumpman23mosaic.com/

MS Retail: http://blogs.msdn.com/b/mvpawardprogram/archive/2011/01/04/achieving-digital-zen-in-retail.aspx

DeepLink for Simon on the phone: http://social.zune.net/redirect?type=phoneApp&id=65c23c5b-73e9-df11-9264-00237de2db9e

Friday, February 11, 2011

App Development for Windows Phone 7 101

App support for the Windows Phone 7 platform is occurring at an accelerated rate. At one time the quantity of available apps was in the hundreds, now it’s in the thousands. Some of this acceleration is due to a relatively straight forward and clearly-defined development platform. This article explains the basics of developing an app for the Windows 7 phone on both the Microsoft .NET and XNA development platforms. Whether you're programming an app that'll be placed for download, or developing a premium app on your own web hosting services, this article is designed to help get you started.

Application development for the Windows Phone 7 is accomplished through the help of the Microsoft .NET application programming interface (API). The .NET development platform supports multiple languages and executes from within a common language runtime environment. Two different frameworks can be used to develop apps. One is the Silverlight application framework and the other is the XNA framework.

Microsoft Silverlight is a browser-diagnostic development platform built on the .NET framework that utilizes a variety of technologies that support a multitude of programming languages. Microsoft Visual Studio is the primary application used in the Silverlight platform and it is also shared with the XNA development platform.

The XNA development platform is a development framework that utilizes XNA Game Studio. XNA Game Studio is a managed-code class library designed specifically for game development. Its advantages are an easier learning curve with a free toolset. Apps using XNA Game Studio are playable on a variety of gaming platforms, including Windows Phone 7.

The first step in developing apps for the Windows Phone 7 is to setup the proper development environment. At a minimum, Windows 7 or Vista and a DirectX 10 compatible graphics card are required. Go to http://create.msdn.com/en-us/home/getting_started and follow the instructions to install all the free development tools. These include:

- Silverlight
- Visual Studio 2010 Express
- Windows Phone Emulator
- XNA Game Studio 4.0
- Microsoft Expression Blend for Windows Phone
- .NET Framework 4

To begin creating your first app, perform the following steps:

1) Open Visual Studio 2010 Express. This may take a few minutes, if this is the first time Visual Studio has been run. It will initialize various settings. When this process is complete, Visual Studio displays a startup page that lists a variety of information.

2) Click the “New Project” link from the menu bar on the left side of the GUI. The New Project screen displays a variety of templates.

3) Click “Windows Phone Application” from the list of templates. The template name appears highlighted.

4) Enter a project name in the “Name” field towards the bottom of the GUI.

5) Enter a name in the “Solution Name” field towards the bottom of the GUI.

6) Click the “Create directory for solution” check box above the OK button. This assists in organizing your project.

7) Click the OK button. The new project is created.

After the project is created, Visual Studio loads and displays the contents of a file called MainPage.xaml. The GUI is in design mode with the left pane showing how your application will look on the Windows 7 phone and the right pane showing the code. At any time you can press CTRL+F5 to compile the current code and run it in the Windows Phone Emulator. While developing, any changes entered on the right development pane will display on the left pane.

At this point, you’re ready to begin app development using the Visual Studio editor. Visual Studio provides an effective platform to develop code and there are a number of online resources available as well as WP7 Help hosting companies to assist during the development process. Here are a few that are worth bookmarking:

The App Hub website is an excellent resource for Windows Phone 7 development with lots of tips and downloads just a mouse click away. http://create.msdn.com/en-US/

The Windows Phone Developer Blog is also an excellent site for information.

For those seeking to develop games in the XNA framework, it will be necessary to have a rudimentary grasp of the C# language. The XNA environment has some limitations in terms of use. For example, it doesn’t support drag-and-drop and it’s necessary to have a more firm grasp of C#, but, as with programming with Visual Studio, there are a number of websites that offer help using the XNA framework. The Microsoft Beginner Development Learning Center at http://msdn.microsoft.com/en-us/beginner/default.aspx is an excellent place to learn more about C#.

Programming in the XNA framework requires the same minimum graphics requirements as programming in Visual Studio. The XNA Wiki (http://www.xnawiki.com/index.php?title=Graphics_card_compatibility ) contains a list of graphics cards that are compatible with XNA Game Studio.

The following steps describe how to begin programming in the XNA framework.

1) Ensure Microsoft Visual Studio is installed, as explained earlier.

2) Install the latest version of Microsoft XNA Game Studio. Only install this application from the Microsoft website. Some mirror sites offer compromised builds. Play it safe and always download the installation directly from Microsoft. XNA Game Studio 4.0 is available at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9ac86eca-206f-4274-97f2-ef6c8b1f478f

3) Start the Visual Studio application.

4) Click “File” and select “New Project”. A dialog box lists various tree nodes, each represent a project type.

5) Select the “XNA Game Studio” tree node. This is located under the “Visual C#” node. A list of projects displays in the right pane.

6) Select “Windows Game” in the right pane.

7) Enter a project name in the “Name” field on the lower portion of the GUI.

8) Enter the directory path in the “Location” field. This defines where the new project will be created.

9) Click the OK button. The new project is created and the GUI switches to code entry mode.

You are now ready to begin developing your game within the XNA framework. Refer to Getting Started with XNA Game Studio Development for a development tutorial.

When you create your new project, the basic code structure is automatically created for you. Within the code that has already been inserted, you can now add various methods and loops. Here’s a brief rundown of the code elements you will want to learn and explore:

- Draw loop: (http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.draw.aspx ) Used to define frames and screen-render backgrounds and objects.

- Update look: (http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.update.aspx ) Used when processing game logic, such as object movement, user input, or processing simulation data.

- Initialize method: (http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.initialize.aspx ) Used to load any nongraphic resource.

- LoadContent method: (http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.loadcontent.aspx ) Used when loading graphic resources, such as textures and other graphic elements.

As stated, this article is designed to get you started developing apps on the Windows Phone 7 using either the Microsoft Silverlight development dedicated server platform or XNA Game Studio Developer. Links to helpful sites have been provided, but this is only a start. There are extensive information available online and it is strongly recommended that each person perform their own research to locate the proper resources, tutorials, and code samples.

With the proper applications loaded and ready to go, websites bookmarked, and resources and code samples at your fingertips, you’re now ready to explore the exciting development opportunities offered for the Windows Phone 7 platform.

Wednesday, February 2, 2011

HTML 5 Is Dead!

“gasp” what? How can that be? What can this guy be talking about? What can this blogger possibly know and why would he say something so sacrilegious? I’m aghast…


I’m sure that is the kind of response that many of you are having when reading this article but I wanted to make a point, with all the excitement around HTML 5, not so much that its bad but people seem to be in one camp or the other and few are looking at the big picture. Yes HTML 5 is awesome and all but many of the ‘HTML 5 is awesome’ crowd is saying other RIA technologies are dead and it is just not logical to make a whole sale generalization like that and it drives me nuts. I hear things like ‘Flash is dead’ or ‘Silverlight is dead’ (even from some less then razor sharp micrsoftee’s).


HTML fine is the foundation of all our content on the web and all but a technology whose last major version is 10 years old is not making rich immersive technologies like flash out dated? That’s just crazy. Flash and Silverlight both in particular have proven over and over again that they iterate faster and more importantly ‘innovate’ faster than more open technologies like HTML. Both of those technologies do more, better and faster than HTML 5 and are more cross platform, more tool-able and have better dev/workflow stories across the board. But why do people put these technologies up against each other at all? That’s like saying apples are better than oranges? They are just different.


HTML 5 is a cross platform long term foundation for web based content and web based apps and great it now is more richer then before but RIA technologies such as Flash and Silverlight both are not nor have they ever been dubbed as a replacement for HTML (at least not anyone I know). These technologies both live out of the browser and are ways of delivering on all the promises that Java first made when it came out. Rich cross platform immersive UI experiences on so many platforms from droid phones to xbox to browsers and desktop apps.


HTML is for the rich distributed web stuff and Flash and Silverlight is for immersive experiences that may or may not be on the web at all. HTML in the browser or maybe even an HTA sort of app and Flash/Silverlight is for UX that leaps out of the browser. HTML 5 is cool but that doesn’t mean that more powerful RIA technologies are dead. To each his own and to each problem space its technology; there is room enough for it all. Let’s all be a bit less zealous about things and focus on building better apps regardless of the technology you want to use.


Heck if apple had any since they would get flash on the iphone for building cool apps so we don’t have to use that objective C…