Faculty Connection is an online set of real-world resources and shared peer knowledge, the goal of the Faculty Connection site is to put relevant and applicable tools and information at the fingertips of technology educators.
The UK Academic Team is responsible for offering IT students and faculty members free access to software, for enhancing knowledge and skills by providing curriculum materials and other learning opportunities, for helping students achieve their dreams by organizing an international competition, and finally for assisting last year students through career resources and job opportunities at our customers and partners.
With this blog we want to inform you on our latest initiatives.
Enjoy reading and stay tuned!
Last week I was travelling the country talking to academics and students about the opportunity of building apps for Windows 8.
During the week I had a number of really interesting discussions, however on Friday I had a comment from one student, who simply believed Windows 8, was for touch devices only.
We got onto the topic of keyboard and mouse as I was presenting using a Lenovo thinkpad which supports both touch and keyboard and mouse. I was simply demonstrating Windows navigation via touch and then via keyboard and mouse during the presentation demos and the student in question seemed to be blown away by this and when we discussed this it more detail after the event he wasn't aware of the number of Windows Shortcut keys available.
So here a quick list of some of my favourites
Charms and menus
Apps Search Screen
Files Search Screen
Split to the right
Split to the left
Scroll Start Screen
Apps Options/App bar
With the release of Unity 4.2, you can now take your Unity games and quickly port them to Windows Phone 8 and extend your reach to Windows users.
Getting started building a Windows Phone 8 game with Unity
To develop, compile and submit a Unity game to the Windows Phone store, you will need:
• Unity 4.2 . Either the Unity free version or Unity Pro will work. The add-ons to publish to Windows and Windows Store are free, even for Unity Pro users.
• Windows Phone SDK 8.0 The WP8 SDK includes a stand-alone version of Visual Studio Express 2012 - if you already have Visual Studio Premium or Ultimate, the SDK will work as an addin and you can continue to use your version-.
• Windows 8.0 or later. If you do not own a Windows 8 license, you can get a 90-day evaluation version. If you are running Mac OS X or will install on Apple hardware, check different options for installing using Boot Camp, VMWare , or Parallels.
• Windows Phone developer account. This is needed to “unlock” your phone so you can side load your game for developing and testing. It will also be needed to submit your game to the Windows Phone store.
• Windows Phone 8 device. In Unity 4.2, deploying and debugging to the Windows Phone emulator is not supported, so you will need a phone. Once you have a phone and your developer account, follow these instructions to register your phone for development.
Targeting a new platform always requires a few tweaks, such as using a few platform specific APIs (e.g. in-app purchase or application life cycle) and tailoring the game to the device’s hardware capabilities (e.g. a back button).
To create your game, you will still be using the Unity IDE. This will feel very familiar and keep your productivity high. That said, there is a significant difference that you should keep in mind: When running the game within Unity, it will run using the Mono run-time; however, once you build for Windows Phone platform and deploy to the phone, you will be running in the .NET for Windows Phone run-time.
Here are a few tips for dealing with this “dual run-time” environment:
1. If including script files that will run in Unity, use the #if UNITY_WP8 pre-processor directive to refer to code that should not run inside Unity.
2. For plugins, include Unity plugins to be used in the Unity editor in the Assets/Plugins directory and include the run-time plugins for Windows Phone in the Assets/Plugins/WP8 folder.
3. Make sure you test your game thoroughly on a device. If you are referencing a Mono API that is not on Windows Phone, it will work fine in the Unity player, and throw an exception on the phone.
4. Unity uses the Mono compiler to generate phone assemblies, as such you may find that once in a while you will call a Mono API that is not in phone and even the compiler (when you build for phone) will not catch it. These errors will lead to exceptions when running on the phone. A good tool to validate an assembly’s portability to Windows Phone is http://scan.xamarin.com. You should extend this practice of validating your assemblies to compiled plugins. If you purchase a plugin that ships as a binary, validate it to make sure it uses only Windows Phone APIs.
If you find errors or missing Mono APIs that you are using in your game, you should look at the .NET API for Windows Phone reference site to find alternates.
Windows Phone renders their UI using XAML. This infrastructure can be useful if you want to have UI that is not in your Unity game (such as a splash screen or ads). XAML UI and Unity UI can compose seamlessly. The way this composition works is via the DrawingSurfaceBackgroundGrid control. This control uses Direct3D to render what is effectively the background to the whole screen. Unity renders your game against this surface using hardware accelerated Direct3D. For more details on XAML + Direct3D composition, refer to the XAML and Direct3D apps for Windows Phone 8 write-up on MSDN.
The graphics composition with via the Unity engine will all be transparent to you. It is where you mix and match that you will need to remember these four details:
1. Within your app, you can include XAML UI controls and widgets (such as an ad control, buttons, etc.) that compose visually with your game.
2. If you add XAML UI, this will be in front of your game since your game is rendered as the background of the scene.
3. To maximize compatibility across screen sizes, XAML content is scaled. XAML content is 480 wide, and then scaled. [So on devices with 1280x768 resolution, Unity will see this resolution and XAML content will be 480x800, scaled 1.6 times. If you are trying to align a pixel-perfect composite of a scene that uses XAML and Unity content, you will need to scale down your Unity content. You can get the scale from the Appication.Current.Host.Content.ScaleFactor property.
4. XAML UI runs on a different thread than Unity, so you will need to dispatch messages to the right thread in order to access the respective UI components for each technology:
To tweak XAML UI from a Unity callback, use this:
1: Dispatcher.BeginInvoke(() =>
3: //access XAML UI elements here..
To call from within XAML UI thread onto the Unity thread, use:
1: UnityApp.BeginInvoke(() =>
3: //access Unity objets here..
Windows Phone games must declare some of the resources or APIs they will consume.
This is done via declarations in the application manifest (WMAppManifest.xml). If you are making network requests, accessing sensors, using push notifications, etc. you will need to declare these, else your app with get exceptions or failures with access denied.
Everything you need to know about capabilities is in the capabilities documentation page. Review that page and double click on the WMAppManifest.xml document in your Visual Studio project to declare the resources you will need; there is no coding required for any of these.
Process Lifecycle Management
The Windows Phone application model has one foreground app (the one that is visible) that has access to most of the OS resources (memory, CPU, networking); to enable fast app switching, the OS does keep recently used apps that the user has not explicitly closed in memory. All of this app model is explained to great detail in the “App activation and deactivation for Windows Phone” documentation.
For games where you are saving state as early as possible, the default mappings to Unity events should work well. If you want to optimize further, all these events are in App.xaml.cs and the default Unity generated code is subscribing to them, you can add extra logic in the event handlers on the C# side, and use a plugin to communicate with your game code.
Windows Phone 8 has a detailed minimum hardware spec that all devices must meet; you should expect high-degree of consistency across the devices.
Hardware acceleration with programmable GPU. Windows phone uses Direct3D with feature level set to 9_3. MSDN has a great table of the supported features by level. The two biggest take-aways to notice are shader model level 2 and max texture size of 4096.
Windows phone 8 devices come in three resolutions: 480x800(WVGA), 768x1280 (WXGA) and 720x1280(720p). To find the resolution of your device, you can query the Screen.width and Screen.height properties within your Unity scripts; you can then scale appropriately within the game. For static assets outside the game (tiles, splash image, etc.) supplying assets for the WXGA resolution often suffices, Windows Phone will scale these.
Memory comes in multiple configurations: 512 MB of RAM for the WVGA devices, and minimum of 1GB RAM for the 720p devices. The newest phones such as Nokia 1020 are up to 2GB.
The OS limits how much memory a single application can consume; for lower memory phones this is around 150MB for a single app, and it goes up to around 380MB for higher memory phones. There are capabilities you can declare in your manifest to opt into specific memory behaviours and to opt out of running on low-end devices.
The default Unity projects opt into the ID_FUNC_EXTENDED_MEM capability, which says your game will run in a lower memory device, getting up to 180 MB. You can opt out of lower memory devices by using the ID_REQ_MEMORY_300 capability; learn more about the limits and the capabilities from the App Memory Limits documentation.
Accelerometer is available on all phones and directly accessible from Unity APIs.
Magnetometer and gyroscope are optional on the hardware on the phone. Compass APIs are not implemented in 4.2, but they are in the upcoming 4.3 release.
Hardware Back button. All Windows Phones have a dedicated back button and there are specific guidelines on what an app should do when the back button is pressed:
• If you have implemented navigation within your app, pressing the back button should go back to the previous step in your navigation.
• If you are inside a modal dialog (e.g. settings or achievements, etc.) pressing back button should dismiss the dialog.
• If you are not in a dialog and you are at the root of the navigation game (or you do not have navigation in your game), pressing the back button should exit the game.
To handle the back button, use the same mechanism as android: listen for the Escape key.
Note that proper handling of the back button is a certification requirement. If you do not handle it, you will fail certification. The default code exported from Unity does not handle it, they do the work to suppress it, and expect you to handle Escape key. If you do not want to waste cycles on every update listening for the Escape key you have a game with a single screen and no modal dialogs where the back button would always exit the game, you can comment out the e.Cancel assignment from the
1: BackKeyPress event handler in MainPage.xaml.cs
2: private void PhoneApplicationPage_BackKeyPress(object sender,CancelEventArgs e)
4: //e.Cancel = UnityApp.BackButtonPressed();
As any mobile platform, performance is important and you should test for it. Most of the standard Unity guidance on optimizations for mobile devices applies. Most games should not need platform specific optimizations (outside of tweaking visual features to the GPU capabilities on phone). For those looking to get every drop of performance, interop cost on Windows is a bit higher than on Mono. You need to be smart about crossing the boundaries from your script (C# or UnityScript) to the unity engine (which is written in native code).
Unity support for Windows Phone is still growing so not all APIs have been ported, there is only a few missing,
• Compass support is not in Unity 4.2
• Location services is not in Unity 4.2
• Webcam support is not in Unity 4.2
• Microphone support is not in Unity 4.2.
• WWW is implemented but multiplayer networking APIs are missing. You can used .NET APIs or third party libraries (e.g. photon) as an alternative.
• GPU profiling is not available yet.
• Application.OpenURL is not implemented. You can use the Windows Phone WebBrowserTask for this.
Enhancing your game with some of the Windows Phone platform features
The Windows Phone Start screen is a signature and highly praised feature in Windows phone. Tiles are the ‘first impression’ your users will get about your app; when used effectively, tiles can be a differentiator that drives continuous engagement to your game.
Anyone shipping a game for Windows phone should read the introduction to tiles for Windows Phone and the tile design guidelines for Windows Phone.
At a minimum, your game should have beautiful tile that meets the design guidelines on all possible sizes – tiles come in 3 sizes: 159x159 (small), 336x336(medium) and 691x336(wide).
To configure and include the tiles for your app, you must use Visual Studio’s manifest editor and include the images in your VS project.
Once you have a beautiful static tile, consider how to “invite” your users to come and play often. If you have a turn-based game, you can use the tile to notify the user of their turn; if you have a game that can start at any level, let the user create a secondary tile that lets’ them pin their favorite level and start there every time. If you have any server-side features (high scores from peers, special offers, etc.) use Windows phone push notifications to let the user know about your offers or any other relevant data that invites your user to play a game. You can also do local notifications, and scheduled tiles. There is a lot of different options to keep your start screen alive.
Unity does not include APIs for tiles and since Unity uses the Mono compiler, you can’t just include a script in your project to access tiles (the compiler won’t be able to resolve this), you must do a plugin and compile it using Visual Studio. For details on the tile APIs for Windows Phone, refer to the ShellTile class.
A few seconds will pass between a user tapping to launch your game, and the Unity engine rendering it to the screen. Windows Phone allows you to configure an image that the OS will show between the time the user launches your app and when XAML UI is rendered to the screen. This image is a JPG and you can configure different sizes for the different phone resolutions:
Image size in pixels
Filename (you must use)
You can also just include a single image called SphashscreenImage.jpg, this is what the default Unity builds do; if you are shipping a single image, make it the WXGA size, the OS will scale appropriately.
The Unity 4.2 Player Settings dialog does not allow you to override the Splash Image with your own, so you must configure it in Visual Studio. Instructions on where to copy the images to and what resolutions to use are in this How to create a Splash Screen walk-through.
Having a splash screen is a must-do, but it is usually not enough. Windows Phone only shows the splash image while the app is getting started and once it is ready to show XAML UI, it transitions into this XAML UI. For some games, there are still a couple seconds between that and your Unity UI. To get around this, you can just edit your XAML to display your splash image (or any other UI you want to display) until Unity is ready. For details on how to accomplish this, look at the “Extending your splash image” in the common tasks section below.
Windows Phone offers different options for monetizing your game.
Beyond the one-time purchase of your game, Windows Phone offers trials (that you would need to convert to a full purchase), in-app purchase for durables and consumables and advertising.
To access the in-app purchase APIs you will need to write a Unity plugin. MSDN has a great overview of the in-app purchase APIs, most concepts will feel ‘familiar’ for those who have implemented in-app purchase in other platforms. The only ‘quirk’ you will encounter is that Windows Phone does not have a staging environment to test in app purchase. There is a Mock API library that you can use for your development; if you feel that testing the in-app purchase APIs (not just the mock library) is absolutely required before submitting to the store, then do a beta for your game. This would allow you to test inapp purchase using the real APIs before you submit to production.
If you prefer to purchase a plugin instead of writing one, here are vendors that have plugins. RobotoWP for Windows Phone , BitRave and Prime31 have Microsoft Store plugin and lots of other useful Windows Phone and Windows store plugins such as Microsoft ads plugin, and an essential plugins that includes a lot of sharing tasks
Submitting to the store
To submit to the store, you will need your Windows Phone developer account and a licensed version of Unity. The trial version of Unity, will produce a water mark in the build that says “development build” on the bottom right of your game, and this will not pass certification. The Unity addins for Windows Phone are free for Unity basic and even Unity Pro users, so just contact Unity to get your free license.
When you are ready to submit to the store, follow these steps.
1. Check out the App certification requirements for Windows Phone 2. Become familiar with Windows Phone app product submission process.
3. Run your app through the Windows Phone Store Test Kit. The Windows Phone Store test kit is a suite of automated tests and manual tests for your game. The kit will identify and help you fix issues that Microsoft testers will find during certification; by finding them early, you will save a lot of time. The store kit can be executed from within visual studio (under the project tab), this walkthrough gives you step-by step- instructions and details on running the kit.
You will be tempted to just run the automated tests and ignore the manual ones; this is a bad idea; you can learn a lot about the platform and about making your game better from looking at what the Microsoft certification folks are testing for; give the manual tests a try and see how your game fares.
4. We recommend you go through a beta submission. More details at the “Beta testing your app” page , on MSDN
5. Submit your master configuration. Unity will create a debug, release, and master configuration for your visual Studio project. Make sure you submit the master, not the release one.
Other useful references
• Unity’s Windows Phone 8: Getting Started guide is a must read.
• The getting started with Windows Phone will walk you through downloading the tools, registering your phone for development (aka unlocking the phone) and writing a basic app that walks you through Visual studio project structure.
• The Windows Phone SDK samples collection has hundreds of coding samples to accomplish specific tasks.
Unity has instructions on debugging with visual studio.
Unity has instructions on profiling Windows phone apps
A large number of the UK’s Universities and colleges have been using XNA since 2004 within gaming course curricula on Windows, XBox and Windows Phone. We have a huge set of Free curricula resources for XNA game development at http://www.microsoft.com/faculty
XNA over the last 7 years has provide a number of students and indie game developers with an impressive content pipeline, game assets, load functionality, animation, math, sound and user input tracking via gamepad, mouse, keyboard and touch with game logic organized in a straightforward game loop architecture, more recently we have also added curricula for XNA and Kinect.
Within education XNA has been a huge driver for a number of students and developers who wanted to learn how to create games. XNA along with Visual Studio made it as easy as File –> New –> XNA Game Studio Project and you were off developing.
Since Windows 8 is built on the strong foundation of Windows 7, any app built for Windows will run in the Windows 8 desktop environment. This includes apps based on XNA, Win32, .NET, WPF, Silverlight, etc.
Windows 8 also introduces a new type of app called a Metro Style App for developers that wish to make their app available in the Windows 8 Store, for free or for sale. Using Visual Studio 2012, you have a language choice of C++, XAML with C#, VB or C++, or HTML5/JS to create a Metro Style App.
Using the XNA Framework is not a choice for building a Metro Style App. Official Microsoft guidance on game development is documented here.
Windows 8 allows you too build highly immersive games using HTML5/JS, XAML/C#, XAML/VB or C++ and DirectX.
However a number of you have already stressed too me, that you and your students have been developing with XNA and have an existing code base, or would like to import existing XNA games too Windows 8 your only option it would seem is running as a desktop app.
This is where MonoGame comes in…
MonoGame is an Open Source implementation of the Microsoft XNA 4 Framework. The goal is to allow XNA developers on Windows & Windows Phone to port their games to the iOS, Android, Mac OS X, Linux with both PlayStation Suite and Windows 8 support currently under development.
NOTE : This project is not linked with Microsoft or any of it subsidiaries. It is a non-profit, open source project. MonoGame is licensed under the Microsoft Public License (Ms-PL)
NOTE : This project is not linked with Microsoft or any of it subsidiaries. It is a non-profit, open source project. MonoGame is licensed under the Microsoft Public License (Ms-PL)
MonoGame provides a cross platform XNA Framework implementation for XNA developers who want to take their code to non-Microsoft platforms as well as the ability, to target Windows 8.
MonoGame for Windows 8 you can take your XNA code and with a recompile and some additional features too simply create a Metro Style App for example Armed within the Windows Store uses MonoGame. I have too stress MonoGame is still under development and so any use of it should come with a note of advice to stay on top of that effort.
In order to provide a complete implementation of XNA on Windows 8, MonoGame leverages SharpDX , an open-source project delivering the full DirectX API for managed code (.NET) and Windows 8 (WinRT). SharpDX is an open-source project, free of charge available under the following MIT License.
Typically, you develop an application for Windows Phone 7 by using Microsoft Silverlight and one of the managed programming languages—usually C# or XNA.
A Windows Store app using C++, C#, or Visual Basic, using XAML, is the preferred model for ports from Windows Phone 7. If you are familiar with Silverlight, you can port to a Windows Store app using XAML by using familiar languages like C# or Visual Basic, and a similar set of UI elements and APIs.
For more detail about porting a Windows Phone 7 application to XAML, read Migrating a Windows Phone 7 app to XAML.
However if your a game developer then you can move your existing Windows Phone XNA using Monogame.
Porting to Windows Store app using MonoGame
For some background you can read these posts:
During the ThreeThing Game event, Dean Ellis @InfSpaceStudios talked through the porting of a one of the teams Windows Phone game, Shear Carnage to Windows 8, the initial port took 7mins 47seconds, which is pretty impressive stuff!
Some of the key features, the team now need to work on now to get the app store ready is..
Overall this is pretty stunning for existing Windows Phone developers taking existing or new phone apps to both the Windows Phone Marketplace and Windows 8 Store.
Microsoft provides grants for educators wanting to use Windows Azure platform in their curricula. These grants are facilitated through Windows Azure academic passes, which provide the following resources for a period of 5 months from the date of redemption:
Grant applications are designated for faculty who are teaching Windows Azure in their curricula as well as faculty preparing to integrate Windows Azure into their curricula. Educator Grant awards are subject to demand and availability.
To apply for an Educator Grant please contact AzureU@Microsoft.com and provide us with:
Windows Azure Educator Grants FAQs
Q: What are the Windows Azure Educator grants?
A: The Windows Azure Education Grants are focused on enabling educators to easily leverage the benefits of the Windows Azure platform for curriculum development and teaching. Through these grants, educators can obtain easy access, with no Credit Card required, to the Windows Azure platform for an extended period of time at no cost for themselves and their students. Access to the Windows Azure platform is made possible through 5 month Windows Azure platform academic passes. Educator Grants may be available up to the number of students within the course, dependent on the volume of requests, pass availability, and the needs of the course.
Q: What resources are available through the Windows Azure platform academic pass?
A: Each 5 month Windows Azure platform academic pass provides the following resources:
Windows Azure 2 small compute instances 3GB of storage 250,000 storage transactions SQL Azure Two 1GB Web Edition database
AppFabric 100,000 Access Control transactions 2 Service Bus connections Data Transfers (per region) 3 GB in 3 GB out 1 Hosted Service
Q: What is the Gifting Letter and who needs to sign this?
A: If you are granted a Windows Azure Educator Grant, we require that you sign a “Gifting Letter” in order to ensure compliance with all applicable government gift and ethics rules, which restrict/prohibit government employees. Your ethics officer, (or designated executive/office responsible for your organization’s gifts/ethics policy), or responsible attorney should review and sign this letter.
Q: How do the Windows Azure platform academic passes get redeemed?
A: Each Windows Azure platform academic pass is redeemable through http://www.windowsazure.com/en-us/community/education/program/educators/ If you receive an Educator Grant we will send you a PowerPoint deck which will guide you and your students through the easy process of redeeming these passes.
Q: Why is Microsoft offering this?
A: A large percentage of the academic community has developed curricula materials leveraging the Windows Azure platform for teaching Cloud-centric courses. We are experiencing an increase in demand from the academic community for access to the Windows Azure platform. Windows Azure Educator Grants allows us to enable even more members of the academic community to leverage the Windows Azure platform within their courses.
Q: Are Windows Azure Educator Grants available globally?
A: Windows Azure Educator Grants are available worldwide.
Q: Is there an available education discount program for the Windows Azure platform?
A: At this time, we do not offer education discount pricing for the Windows Azure platform.
Q: Who can apply for a Windows Azure platform Educator Grant?
A: Educators at accredited academic institutions can apply for the Windows Azure Educator Grants.
Q: How do I apply for a Windows Azure platform Educator Grant?
A: Applying for a Windows Azure platform academic pass is easy. Simply go to http://www.windowsazure.com/en-us/community/education/program/educators/
We will ask you for the following information:
· Your name · Your email contact · Country · Institution/University name · Course name · Course description · Number of students in your course · Number of Windows Azure platform academic passes needed · Date when Windows Azure platform academic passes will be used
Q: What factors will Microsoft consider when determining who will receive a Windows Azure Educator Grant?
A: Windows Azure Educator Grants will be awarded based on factors such as purpose of use, number of passes required, and timing requirements for usage of the passes.
Q: I am a student. Can I apply for a pass?
A: Windows Azure Educator Grants are only valid for valid faculty. If your faculty has been awarded a Windows Azure Educator Grant, you will be able to get a pass through him/her for you coursework. If you are interested in learning more about the Windows Azure platform, we encourage you to share these Educator Grants with your faculty or leverage the FREE 90-day trial offer at http://www.windowsazure.com/en-us/pricing/free-trial/
Q: Does my Windows Azure platform academic pass expire?
A: Yes. The Windows Azure platform academic pass will expire 150 days after it has been activated. You will be receiving email notifications when the expiration date is close, and you will have the opportunity to migrate your data to a paid Windows Azure platform subscription, if you want to continue on using the Windows Azure platform.
Q: What happens to my data application when my pass expires?
A: Shortly prior to the expiration date you will have the opportunity to migrate your data to a paid Windows Azure platform subscription. All of your data will be erased when your pass expires. If you choose to not migrate your Windows Azure account to a paid account, please be sure to back up your data.
Q: Do I have to use a credit card to redeem my pass?
A: No. You do not need to use a credit card to redeem your pass activate your Windows Azure account.
Ideal for those with fundamental programming skills, this tutorial provides practical, learn-by-doing exercises for mastering the entire Windows Azure platform.
For more details see http://www.windowsazure.com/en-us/community/education/program/overview/
DVD + On-line
Windows Phone Programming in C# by Prof Rob Miles;
WP7.5 update + extra modules This material contains a ten chapter textbook with labs, demos and step by step instructions on how to create Windows Phone 7 applications.
1st & 2nd Year Programming courses
Introduction to Game Programming with XNA and Windows Phone 7 by Prof Kelvin Sung (UW)
WP7.5 update + new material
This material is a 16-hour course designed to teach students how to build a 2D interactive video game.
3rd & 4th Year (require background in data structure)
Introduction to Mobile Application Development Using Silverlight by Michael Iantosca.
Students learn the knowledge, skills, and abilities necessary to develop a mobile application on the Windows Phone 7.5 platform using Microsoft Silverlight. 2nd & 3rd Year: background in programming needed (preferably C#, but C, C++, Java helps
Designing for Windows Phone by Microsoft
This material contains the following 7 lessons on how to design for the Windows Phone: METRO Design, Building WP7 Assets, Layout Controls in Expression Blend, Creating Animation and Basic Interactivity, Working with the Visual State Manager, Adding Data to your Application and Creating the Flickr4Fun app. [ HCI and Software Dev-t classes 1nd - 3rd Year: ]
Azure Mobile Curriculum by Rob Miles
Find out how Cloud computing works and what it brings to the Windows Phone user. The content will show you how to use the cloud for data storage and databases, farm out heavyweight tasks for cloud data processing and use the cloud to perform identity validation. [addition to above courses]
If you would like to receive a FREE copy of the CD please email firstname.lastname@example.org with your University contact details and full UK postal address.
PLEASE NOTE THE DVD WILL ONLY BE POSTED TO UK INSTITUTION ADDRESS
Don't forget students can get great resources and developer tools for free from http://www.dreamspark.com and check up on all the latest offers and prizes via the Microsoft UK Student Blog and Facebook Group
Microsoft Research Connections announced the release of the book, TouchDevelop—Programming on the Go, available in print form, as an e-book, and on the web. TouchDevelop has reached new heights as the only programming environment on mobile touch devices that creates apps directly for the Windows Marketplace. This book is a comprehensive guide on how to use TouchDevelop to write fun, productive apps that make full use of a device's audio, camera, sensors, and so on.
Touchdevelop — Programming on the Go by Nigel Horspool (University of Victoria), Judith Bishop, Arjmand Samuel, Nikolai Tillmann, Michał Moskal, Jonathan de Halleux, Manuel Fähndrich (Microsoft Research)
Download the book for FREE.
Download as single file
Alternative download option: one file per chapter
Who this book is for
This book has much to offer to both students and teachers: For teachers, it walks in detail through all of the screens of the TouchDevelop app, and it points out similarities and differences of the TouchDevelop language compared to other programming languages that the teacher might already be familiar with. For students and enthusiasts, the book can serve as a handy reference next to the phone. The book systematically addresses all programming language constructs, starting from the very basic constructs such as variables and loops. The book also explores many of the phone sensors and data sources which make creating apps for mobile devices so rewarding.
How to read this book
If you are new to programming with TouchDevelop, or if you have not yet worked on touchscreen devices, we suggest that you read the book starting from chapter 1. If you are already familiar with the basic paradigm of the TouchDevelop programming environment, then feel free to jump ahead to the later chapters that address particular topic areas.
Two apps, one book
This book is written from the perspective of a Windows Phone user – all screenshots and navigation instructions refer to the Windows Phone app. The TouchDevelop Web App runs in many modern browsers on many different devices such as iPhone, iPad, Android phones and tablets, Macs, PC. The Web App uses the same programming language and has a very similar navigation structure as the TouchDevelop Windows Phone app. As a result, you can reuse the lessons of this book when you create mobile apps in your web browser.
I wanted to put this quick blog together to answer the most common questions I get from students/developers wishing to build apps.
1. How can I get a Store Account for Windows?
All Students get FREE Windows 8 Store accounts via DreamSpark follow this presentation on the steps to how to validate your FREE Windows 8 Store account
2. What are the resources available if I want to start developing a Windows 8 or Windows Phone application
Windows 8 Developers – http://dev.windows.com
Windows 8 Designers – http://design.windows.com
Windows Phone Developers – http://dev.windowsphone.com
Windows Phone Designers – http://design.windowsphone.com
3. Not a designer, where can I get a logo?
Images from www.thenounproject.com Remember to check licensing first!
4. I want nice fonts, but aren’t they expensive?
www.Fontsquirrel.com is an excellent resource
5. Where can I get colours to match my app?
www.kuler.adobe.com and www.colorlovers.com are excellent, free, searchable resources
6. Where can I get background/pattern for my app?
Great resource with some nice tutorials www.dinpattern.com
Ok I have to confess, I am addicted! I have been playing with a .NET Gadgeteer FEZ Spider Kit from GHI Electronics. The .NET Gadgeteer kits enable you to quickly prototype and test a wide variety of functionality for embedded devices. As you are all aware from some of my recent presentations I am a huge fan of the Microsoft .NET Gadgeteer.
A number of you have asked me about about the .NET Gadgeteer kits and how easy is it for Teachers, Lectures and academics to grasp and teach this technology to school, college and University students? Well firstly you need to know some C# if you don't then watch the following tutorials. So for all of you haven't heard about Gadgeteer or are simply wondering what you can do with Gadgeteer the following guide will hopefully be of assistance.
The following guide is to:
1. Introduces you to the basic hardware components of the GHI FEZ Spider Kit
2. Give you some examples of how to create your first .NET Gadgeteer application.
.NET Gadgeteer development requires that you have Microsoft Visual Studio installed on your computer. You can use either of the following Visual Studio packages:
Both of these are free to download for all UK Students via http://www.dreamSpark.com there is an extensive .NET Gadgeteer support and learning materials available from .NET Gadgeteer http://www.netmf.com/gadgeteer/get-started.aspx and GHI http://www.tinyclr.com/support
So lets get started
The FEZ Spider Kit consists of components, which are called modules, and cables that you can use to create various types of functionality in your device. To create your first .NET Gadgeteer device, you will need the following parts:
The FEZ Spider Mainboard includes a processor and memory, as well as 14 sockets. The sockets are outlined by a white box that surrounds the socket number (1 through 14) and groups the socket number with a set of letters that indicate which modules can be connected to the socket.
.NET Gadgeteer-compatible hardware modules connected to the FEZ Spider mainboard by these connectors allow you to extend the FEZ Spider mainboard with communication, user interaction, sensing, and actuation capabilities.
The FEZ Spider mainboard includes a Reset button to reboot the system. There is also a small LED (labelled D1) which lights up whenever the FEZ Spider has power.
The USB Client Dual Power (USBClientDP) module (coloured red) enables you to connect the FEZ Spider Mainboard to your computer for programming and debugging. The dual-powered module is itself powered either by a USB port on a computer or by a 7 -30 volt DC power source. A USBClientDP module supplies power to the FEZ Spider and to any other modules that are connected to it. You can plug in both power sources of the USBClientDP module to program and to power at the same time.
Never connect more than one red module to the FEZ Spider Mainboard at the same time. This will damage the hardware.
The USBClientDP module has a black socket, identical to the sockets on the FEZ Spider Mainboard. Next to the connector, there is a letter D. This means that this particular module can only be connected to a socket labelled D on the mainboard.
In a similar way, all .NET Gadgeteer-compatible modules have letters next to their sockets that identify which mainboard sockets they can be connected to. Many modules are labelled with multiple letters. This means that they can be connected to any of the labelled sockets.
Red USB Device Module
Your hardware kit includes many module connector cables of different lengths. Apart from the length, these cables are all identical and can be used interchangeably to connect modules to the FEZ Spider Mainboard. Note that all sockets have a notch and the cable headers have a protrusion that fits into this notch, so the cables can only be inserted one way.
A .NET Gadgeteer-compatible Module Connector Cable
Connect the red USB Device module to socket number 1 on the FEZ Spider Mainboard, which is the only socket that has the letter D. Then, connect the small end of the mini USB cable provided with the kit to the USBClientDP module. However, do not connect the other end to your computer yet.
Connecting the FEZ Spider to the USB Client module
When plugging or unplugging any module into a FEZ Spider socket, always make sure that power is not connected, by unplugging either end of the mini USB cable. The mini USB cable supplies power to the FEZ Spider; if you plug or unplug a module on the FEZ Spider while it is powered, the hardware could be damaged.
After ensuring that the FEZ Spider mainboard is not powered, continue by getting a Button module from your hardware kit.
A Button with Multicolour LED
Turn the Button module over. Next to the connector are the letters X Y. This means that a Button module can be connected to one of the sockets labelled X or Y on a mainboard.
The Reverse Side of a Button Module
Get a Camera module from your hardware kit. Turn the Camera module over. This module has a single connector labelled H. Only socket 3 on the FEZ Spider mainboard supports modules labelled with the letter H. Plug one end of a connector cable to the socket on the Camera module and the other end to the FEZ Spider on socket number 3, also labelled HI.
Camera with Socket labelled H
Connect the Button and the Camera to the mainboard using module connector cables as described in the previous sections.
The .NET Gadgeteer designer can identify the sockets on modules and on the mainboard that are compatible. This method is described in the following section titled Using the .NET Gadgeteer Designer UI. In this example we will connect the remaining Display_T35 module manually.
The Display_T35 module has four connectors. Connect sockets 14, 13, and 12 to the Display_T35 module sockets labelled R, G, and B. As you might expect, these letters signify the colour distribution of the Display_T35 module. Connect socket 10 on the mainboard to socket T on the Display_T35 module. Socket T on the Display_T35 module facilitates the touch screen features of this module.
Make the actual connections between all modules and the mainboard before you connect the USBClientDP to the USB port on your computer.
The following illustration shows the mainboard connected to a Display_T35 module, a Button module, a Camera module, and the USBClientDP module. Now, with all the other modules connected, you can connect the USBClientDP module to the USB port on your computer.
.NET Gadgeteer Modules with Connectors
Start Microsoft Visual Studio 2010 or Microsoft Visual C# 2010 Express. The following sequence will get your first .NET Gadgeteer Application up and running in less than half an hour.
Microsoft Visual Studio
Microsoft Visual Studio, New .NET Gadgeteer Application Project
The .NET Gadgeteer Designer opens with the FEZ Spider Mainboard displayed on the canvas. If the Toolbox is not visible, click the View menu and select Toolbox. The Toolbox with a list of installed modules will open. You can resize or hide the Toolbox to make more work space on the canvas.
Microsoft Visual Studio, .NET Gadgeteer Application and Toolbox
If you want to use a different mainboard, open the toolbox, and drag the mainboard icon of your choice onto the designer surface.
When you drag a new mainboard to the designer surface, you'll be prompted, as shown in the following illustration, to confirm replacement of the mainboard. All existing connections will be removed.
To continue building the example device, open the Toolbox and drag the modules for this example on to the work canvas. You will need the following modules:
The Designer canvas with modules is shown in the following illustration.
Microsoft Visual Studio, .NET Gadgeteer Application and Modules
As indicated by the instructions in the text box on the canvas, the .NET Gadgeteer Designer will graphically connect all the modules for you. Right click on the design surface and select Connect all modules. You can move the modules around on the design surface to make the connections easier to read. You can also delete any connection by right clicking on the connection and selecting Delete.
Microsoft Visual Studio, Designer Connected Modules
To manually set a connection, click on a socket in the diagram and hold down the left mouse button. Then you can drag a line that represents the connection from a module socket to a mainboard socket or in the opposite direction from the mainboard to a module. The sockets that the module can use will light up in green, as shown in the following illustration.
Writing Code for Devices that use .NET Gadgeteer Modules
To specify what the modules should do in this application, now edit the Program.cs file. The following illustration shows the Program.cs file open in Visual Studio.
Microsoft Visual Studio, New Project, default Program.cs Code
When using the designer, the modules are automatically instantiated by auto-generated code. This code can be found in the file Program.Generated.cs, but during normal use it is not necessary to view this file, and this file should not be edited because the Designer will automatically regenerate it and undo any direct changes made to it. The Program.Generated.cs file is shown in the following snippet.Program.Generated.cs file.
Microsoft Visual Studio, Progam.Generated.cs Code
Next, you generate code that will enable the program to react to a button press. To do this, assign an event handler for the Button.ButtonPressedevent. The IntelliSense feature of Visual Studio makes this process very easy.
In the Program.cs file, after the comment that reads:
Initialize event handlers here.
Type button.(button followed by a period). IntelliSense displays a list of properties, methods and events as shown in the following illustration.
IntelliSense Feature Showing Members of the Button class
Using the arrow keys, select ButtonPressed. Then type += (plus sign followed by an equals sign). IntelliSense offers option to automatically insert the rest of the declaration:
IntelliSense Offers to Create the Handler Declaration
Press TAB to confirm. IntelliSense offers to automatically generate a delegate method to handle the event:
IntelliSense Offers to Generate the Event Handler Method
Press TAB to confirm. The following code is generated:
Event Handler for the ButtonPressed Event
This event handler will be called each time the button is pressed. Delete the following line from the method:
throw new NotImplementedException();
And replace it with:
Now when the Button is pressed, the Camera module will take a picture.
Take Picture in ButtonPressed Event
The Camera module raises an event when the Cameracaptures a picture. You can use the event to display the picture in the Display_T35 module.
The PictureCaptured event is an example of an asynchronous event. Calling Camera.TakePicturein the Button.ButtonPressed delegate starts the process, but the result of the action is not returned by the ButtonPressed delegate. Instead, the GT.Picture object returns as a parameter of the asynchronous PictureCaptured event.
When the PictureCaptured event occurs, you can get the GT.Picture object and display it by using the SimpleGraphics interface of the Display_T35 module. The SimpleGraphics interface supports the DisplayImage method, which accepts a GT.Picture object as a parameter, along with integer values to indicate the X an Y coordinates that position the image on the display.
All code required to display the picture is shown in the following implementation of the PictureCaptured event delegate.
All the code for a .NET Gadgeteer Application that takes a picture and displays it in the Display_T35 module is shown in the following example.
Entire Code Listing
To deploy this application to a mainboard and begin running it, select Start Debugging from the Debug menu, or press F5.
Make sure that the Output Window is visible by pressing the CTRL + ALT + O key combination on your keyboard. If you have enabled sounds, you should hear Windows make the "USB disconnected" sound, followed by the "USB connected" sound as the Mainboard reboots. The Output Window should show the process of loading various files and assemblies. The final line, which appears once the application begins to run, should read Program Started.
When you see Program Started appear on the Output window, you can take a picture. Smile for the Camera, and push the Button. Your picture will appear on the screen of the Display_T35 module. If it works - congratulations! You have completed your first .NET Gadgeteer application.
To exit debugging mode, select Stop Debugging from the Debug menu, or press Shift + F5.
Note: The mainboard continues to be programmed, and will run this application whenever it is powered up, even if it is not connected to a computer.
An interesting extension of the camera application in the previous example is programming the application to take pictures automatically at an interval set by an instance of the GT.Timer class.
To create an instance of the GT.Timer class, add the following global variable to the Program class, as shown in the following example. This line of code initializes the GT.Timer to raise the Tick event at an interval of 2000 milliseconds (2 seconds).
GT.Timer timer = new GT.Timer(2000);
Create the delegate to handle the GT.Timer.Tick event, but stop the timer until the button is pushed. The following code shows the set-up in the ProgramStarted method.
In the ButtonPressed handler replace Camera.TakePicture with the following code. The new code starts and stops the GT.Timer.Tick event and toggles the LED indicator on the Button. When the GT.Timer is firing events, you can use the event handler to take pictures instead of the ButtonPressed handler.
The implementation of the GT.Timer.Tick event is shown in the following example.
When the LED is off and the user pushes the Button, the LED indicator turns on and remains on while the Camera module takes pictures at two second intervals. When the user pushes the button again, the GT.Timer stops, and the LED turns off.
The following code contains all the code for the camera with timer. The boxes show the changes to the previous example.
Code for Surveillance Camera
This section describes common issues that you may encounter and provides suggestions for how to fix them.
If VS is running when you install GadgeteerCore, you’ll need to close and restart it before creating your first project. Otherwise you won’t see the .NET Gadgeteer Application template.
You may need to change the USB name of the target mainboard in your first project. The most efficient way to do this is using the MFDeploy tool.
Sometimes VS will hang at the display: “The debugging target is not in an initialized state; rebooting”. Push the reset button on the mainboard to fix this.
If you’re using the Display_T35 and see a null reference exception on startup, verify that the touch socket is connected both in the designer and on the module.
If you’re using a laptop and you see errors on deployment like “Please check your hardware”, try plugging a 7 volt DC power supply into the USBClientDP module.
The camera image is blurred or not in focus The lens is screwed into camera base, by unscrewing or screwing in you can focus it.
If you receive compilation errors when you attempt to deploy and run your application, read the error message carefully. Most errors fall into one of two categories:
If your application does not behave as expected (for example, pressing the button does not raise the event), start by checking that the physical socket to which the hardware module is connected agrees with the initializion in code of the identifier that corresponds to the module.
For example, if you connect a Button to mainboard socket 4, but initialize it to socket 8, the button will not work.
// Button is actually plugged into socket 4.
button = new GTM.GHIElectronics.Button(8);
The programming model for the .NET Gadgeteer platform is event driven. Events are raised that correspond to a hardware change or physical action. For example, when you press a button, the ButtonPressed event is raised, and when you release it, the ButtonReleased event is raised.
You can use debug statements inside your event handlers to make sure that your handler is receiving the event. For example, if your LED does not light when you press the button, you can insert a statement inside the event handler for the ButtonPressed event to make sure that your button is in fact receiving the event.
private void Button_ButtonPressed(GTM.Button sender, GTM.Button.ButtonState state)
When you deploy and run your application, check the Visual Studio Debug Output window for your message. If the message does not appear at the expected time (for example, when you press the button), make sure that the physical socket and logical initializer are in agreement, as previously described. If they are, the button or the module connector cable might be defective. Unplug the mini USB cable from your computer, swap the module connector cable or the button with another from your hardware kit, reconnect the mini USB cable, and try again.
Occasionally, you may receive an error as you attempt to deploy your application to a mainboard. This can happen if the mainboard is not connected to your computer, or the mainboard requires a restart. If the mainboard is disconnected, connect it and retry. If the mainboard is connected when this happens, disconnect it from your computer (by unplugging the mini USB cable), wait a few seconds, and reconnect it. Then try the deployment again.
When you install the .NET Gadgeteer core, the device drivers that are needed to communicate with a mainboard are also installed. This process usually does not require any intervention on your part.
In some cases, the .NET Gadgeteer core installation or kit installation might not install the device drivers automatically. If your computer is having problems communicating with a mainboard that you suspect are related to the device drivers, please refer to the Tiny CLR Forum.
If you get any error during installation of .NET Gadgeteer ensure that you have installed .NET Micro Framework Version 4.1 drivers and SDK from http://www.netmf.com/
Have something to add? Got a request or suggestion?
You can email the Gadgeteer team at email@example.com or follow them on Twitter @netgadgeteer.
We are pleased to announce new versions of Blend + Sketchflow preview for Visual Studio 2012. Bringing Blend and Visual Studio together offers more value. Blend is a great tool offering a wide variety of designers and developers the ability to quickly and easily build great looking and powerful UI.
These new versions make available capabilities that were previously only available in Expression Blend such as Windows Presentation Foundation, Silverlight and SketchFlow support, unifying the design-centric tools for building Windows Store Apps and Windows desktop apps to Visual Studio users.
This is for evaluation only and none of the platforms contain a go-live license. Therefore you SHOULD use other released versions of Blend for production work.
What is the Blend + Sketchflow Preview for Visual Studio 2012?
Blend for Visual Studio 2012 can help you design user interfaces for applications with robust tools that solve complex design tasks for building Windows Store apps.
The Blend + Sketchflow Preview introduces powerful WYSIWYG design capabilities to Visual Studio developers by providing support for WPF and Silverlight.
What is the difference between Blend + SketchFlow Preview for Visual Studio 2012 and Blend for Visual Studio 2012 RTW? Do I need both?
Blend for Visual Studio 2012 is a unique, innovative authoring tool with rich visual tools for creating Windows store apps using HTML/CSS and XAML. Blend is installed with most versions of Visual Studio 2012.
Blend + SketchFlow Preview for Visual Studio 2012 delivers WPF, Silverlight, and SketchFlow support compatible with Visual Studio 2012. You can install this alongside Visual Studio 2012 RTW.
What is SketchFlow; how does it differ from Storyboarding in Visual Studio 2012?
SketchFlow provides an informal and quick way to explore, iterate and prototype user interface scenarios. SketchFlow is for building working prototypes of software for developers, while the new storyboarding capability allows PowerPoint to be used for capturing lightweight requirements from stakeholders.