About the Author

Danny is a Software Engineer at InterKnowlogy in Carlsbad, CA. Danny began acquiring his expertise in software engineering and .NET at Neumont University in Salt Lake City, Utah where he graduated with a Bachelor’s degree in Computer Science. Danny’s passion for technology has led him throughout the Microsoft Stack including WPF, Silverlight, WCF, Windows Phone 7, and the Microsoft Surface. Danny has an expertise in NUI (The Natural User Interface) having built numerous multi-touch and gesture based interfaces for software applications across a broad spectrum of devices. Currently his passion includes building Metro/WinRT Applications for Windows 8 driven by gesture based interface with the Microsoft Kinect. Danny is a Microsoft Certified Professional Developer, obtaining certification in .NET 4. When not building beautiful software, Danny is an outdoorsman and family man. He loves to camp, hike and mountain bike. Follow him on twitter @dannydwarren

Nokia – San Diego Windows Phone 8 Hackathon – May 2013

The San Diego Windows Phone 8 Hackathon held at Nokia on May 11th 2013 was a huge success! I want to express my sincere appreciation and respect to all who participated. We had 33 Windows Phone 8 Apps submitted after a mere 4 hours of development time. That’s quite an impressive feat, especially considering the quality of the apps that were presented! I hope everyone that participated will put the finishing touches on their apps and submit them to the Windows Phone Store. (And let me know!)

I took a new approach to presenting code topics at this event and I am quite pleased how it turned out. We held 3 sessions each 1 hour long. Between each session was 1 hour for hands on lab. In the past I’ve shown different codebases for my presentation vs. any hands on labs. At this event I decided to try to use the same codebase for both. This meant I could show off a working version of the hands on labs before attendees would start them. This gave the attendees greater understanding about what they were about to do and how the code topics work in an app setting instead of some simplified, non-best practices sample. This worked tremendously well. I received many comments from attendees about how much they loved seeing the code first then writing the code themselves, and how that was much more effective than seeing two different samples. The apps shown off during the hackathon were evidence to me that my approach was effective and good.

This event was not my first; however it was my first with 111 attendees! It was also my first as a Nokia Developer Champion. I had a blast and the atmosphere and enthusiasm of attendees told me that everyone else did too. I look forward to the many follow up sessions we discussed during the event and other events coming up in the future!

Link to event materials: NokiaWP8May2013

Session 9 of the WinRT Development Class – Intro to Model-View-ViewModel (MVVM)

WinRTWebBanner_JPEG

This class was really made possible by all those who attended. And a special thanks to Tom Hannum for lending me your power cord. We all learned a lot at this session. I hope everyone will go review the presentation video and get familiar with MVVM. If you have any questions leave a comment below! Happy Coding!

Session Resources

Overview of Sessions

The links below lead you to Meetup Events where you can RSVP. We look forward to seeing you at our next session!

1. Introductory Lecture (Nov 27th by Danny & Kevin)
2. Introduction to XAML and WinRT’s powerful Control Framework; (Dec 4th by Danny & Kevin Click here for the video recording)
3. Page-Navigation Model and Application Lifecycle (Jan 8th by Danny Click here for the video recording)
4. Fundamentals (Async/Await, WinRT API, Security) (Jan 15th by Kevin Click here for the video recording)
5. Settings and Search Contract (Jan 28th by Danny Click here for the video recording)
6. Share Contract (Feb 4th by Kevin Click here for the video recording)
7. Live Tiles and Background Tasks (March 18th by Kevin Click here for the video recording)
8. Orientation Handling and Proximity using Near Field Communication (NFC) (March 25th by Danny Click here for the video recording)
9. Introduction to ModelViewViewModel (MVVM) (April 8th by Danny Click here for the video recording)
10. InterKnowlogy’s WinRT MVVM Framework Session Part I/II(April 22nd by Kevin)
11. InterKnowlogy’s WinRT MVVM Framework Session Part II/II(May 6th by Danny)
12. Presentation of Hackathon Results + Certificate/Prize Giveaway(May 20th by Danny and Kevin)

Session 8 of the WinRT Development Class – Orientation And Near Field Communication

WinRTWebBanner_JPEG

Now that you’re all oriented and able to communicate in close quarters I want to see some rockin’ apps! Thanks again for attending! And for those that didn’t make it, you missed an AWESOME magic trick! My best yet.

Session Resources

Overview of Sessions

The links below lead you to Meetup Events where you can RSVP. We look forward to seeing you at our next session!

1. Introductory Lecture (Nov 27th by Danny & Kevin)
2. Introduction to XAML and WinRT’s powerful Control Framework; (Dec 4th by Danny & Kevin Click here for the video recording)
3. Page-Navigation Model and Application Lifecycle (Jan 8th by Danny Click here for the video recording)
4. Fundamentals (Async/Await, WinRT API, Security) (Jan 15th by Kevin Click here for the video recording)
5. Settings and Search Contract (Jan 28th by Danny Click here for the video recording)
6. Share Contract (Feb 4th by Kevin Click here for the video recording)
7. Live Tiles and Background Tasks (March 18th by Kevin Click here for the video recording)
8. Orientation Handling and Proximity using Near Field Communication (NFC) (March 25th by Danny Click here for the video recording)
9. Introduction to ModelViewViewModel (MVVM) (April 8th by Danny)
10. InterKnowlogy’s WinRT MVVM Framework Session Part I/II(April 22nd by Kevin)
11. InterKnowlogy’s WinRT MVVM Framework Session Part II/II(May 6th by Danny)
12. Presentation of Hackathon Results + Certificate/Prize Giveaway(May 20th by Danny and Kevin)

LionHeart & World Autism Awareness Day 2013

LargePC

Today holds a special place in my heart. For the last 3 years my wife has been working with children with Autism helping them to overcome and manage behaviors that are reactive, inappropriate, and distracting to themselves and others. Her kids are amazing little creatures! While some are severely impacted many are not. They are so sweet and love making her get well cards when she is out. It’s impressive. Certainly I can never hope to achieve such satisfaction in my job as a software engineer. However, I can definitely try to help!

Introducing LionHeart: Autism Behavior Interventionist Assistant

It is with great pleasure that I bring you LionHeart; a proof of concept aid for Behavior Interventionists delivering services to people with Autism. The concept of LionHeart came from my wife while we were discussing ways software could help influence medicine. She explained that her job as an Interventionist consists of going home to home to visit each child for a few hours. During the session she uses ABA therapy to help the child learn appropriate behaviors. First the Interventionist reviews notes from the previous session. Then during the session the Behavior Interventionist will keep tally of behaviors and responses. After the session the Interventionist records qualitative notes in the child’s record binder. Every month the binder is collected and paper records are read and transferred to different paper records. It’s a very tedious job. The binder is then hopefully returned to the child’s home before their next session. If not, the Interventionist will have little to no idea how that child is progressing and how to proceed. Even with the binder, there is no easy way to see the child’s improvement over time in a specific program without reading weeks of session notes. Because it is so difficult to see progress over time it is rarely if ever done in the field.

LionHeart is the solution. The app provides a hint at what digital records could look like. It also gives an idea of how easy it would be to generate reports in the office let alone in the field. The concept is that each Interventionist would have a device, like a smart phone or tablet, that would have an app like LionHeart installed. The app has the ability to track behavioral data, record session notes, review client progress, map client addresses, help keep Interventionists in the know about cancelled/postponed/rescheduled sessions, and more! What is currently an extremely inefficient system could be streamlined to benefit the client as well as the service provider.

Goal of LionHeart

My goal when I set out to create LionHeart was to show that technology can be used in simple ways to accomplish great things! My wife wishes she could use LionHeart in the work place, but that of course requires much more than a simple Demo app. I hope, in the near future, that Autism service providers will strive to adopt time saving and quality of care improving technology such as LionHeart. InterKnowlogy is a wealth of knowledge and I continue to be impressed by how well our team works to effectively deliver awesome and amazing software. I would love to see InterKnowlogy partner with Autism service providers to make LionHeart a reality!

Why the Name LionHeart?

The name itself is a fun little story. I had been contemplating a name for a few days for the project. The thought came to me that these kids have huge hearts. They are just so full of love. And while this thought ran through my head I was staring at a pad of paper my mother in-law had given me with a print of a lion on it. I realized lions have big hearts and these kids are often as wild as a lion. How fitting then to give the app the title of LionHeart representing both the challenges and rewards for working with children with Autism.

Screen Shots

List of Session & Viewing Session Info

1a_SessionList2_Session

List of Session Notes & List of Programs in a Session’s Notes

1c_SessionNotesList3b_SessionNotes_Programs

Client Information & Client Progress Over Time

4a_Client_Info4b_Client_Progress

Special Thanks

I would have never finished LionHeart with out the awesome support of the InterKnowlogy team and our RECESS time. You can learn about RECESS here. A special shout out to Beth Juncal who help me work with a designer to make the app beautiful. A huge thanks to Xen Rabara who came to InterKnowlogy in January as a fresh graduate from my alma mater Neumont University, and styled almost the entire app! Travis Schilling also helped me get in a crucial last minute revision to help with usability! Of course I want to thank the company Holly works for, C.A.S.E. Inc., and especially her boss, Cynthia Norall, who has helped me understand the challenges faced by Interventionists in the field. And finally my wife Holly who continues to impress me everyday in her care and love for children with Autism!

Development History

If you’re a developer interested in learning how to make a Windows Phone app like LionHeart check out this blog series on how LionHeart was created.

Session 5 of the WinRT Development Class – Search and Settings

WinRTWebBanner_JPEG

 

What a crazy session! We pulled through it like champs! Thank you everyone who attended. It was a blast and we are working with our sponsors to ensure future sessions go much smoother.

Session Resources

Next session will mark the half way point so don’t miss it! Kevin will be presenting about the Share Contract on Monday February 4th! It’s going to be great!

Overview of Sessions

The links below lead you to Meetup Events where you can RSVP. We look forward to seeing you at our next session!

1. Introductory Lecture (Nov 27th by Danny & Kevin)
2. Introduction to XAML and WinRT’s powerful Control Framework; (Dec 4th by Danny & Kevin Click here for the video recording)
3. Page-Navigation Model and Application Lifecycle (Jan 8th by Danny Click here for the video recording)
4. Fundamentals (Async/Await, WinRT API, Security) (Jan 15th by Kevin Click here for the video recording)
5. Settings and Search Contract (Jan 28th by Danny Click here for the video recording)
6. Share Contract (Feb 4th by Kevin)
7. Live Tiles and Background Tasks (March 18th by Kevin)
8. Orientation Handling and Proximity using Near Field Communication (NFC) (March 25th by Danny)
9. Introduction to ModelViewViewModel (MVVM) (April 8th by Danny)
10. InterKnowlogy’s WinRT MVVM Framework Session Part I/II(April 22nd by Kevin)
11. InterKnowlogy’s WinRT MVVM Framework Session Part II/II(May 6th by Danny)
12. Presentation of Hackathon Results + Certificate/Prize Giveaway(May 22nd by Danny and Kevin)

Session 3 of the WinRT Development Class – App Lifecycle and Navigation

WinRTWebBannerSmall_JPEG

What an excellent session! I know it’s been a little over a week, but I’m very grateful to all those who attended! For those of you who were not able to attend we have a video of the session! Please find the class resources and link to the video below.

Session 3 Resources

Overview of Sessions

The links below lead you to Meetup Events where you can RSVP. We look forward to seeing you at our next session!

1. Introductory Lecture (Nov 27th by Danny & Kevin)
2. Introduction to XAML and WinRT’s powerful Control Framework; (Dec 4th by Danny & Kevin Click here for the video recording)
3. Page-Navigation Model and Application Lifecycle (Jan 8th by Danny Click here for the video recording)
4. Fundamentals (Async/Await, WinRT API, Security) (Jan 15th by Kevin Click here for the video recording)
5. Settings and Search Contract (Jan 28th by Danny)
6. Share Contract (Feb 4th by Kevin)
7. Live Tiles and Background Tasks (March 18th by Kevin)
8. Orientation Handling and Proximity using Near Field Communication (NFC) (March 25th by Danny)
9. Introduction to ModelViewViewModel (MVVM) (April 8th by Danny)
10. InterKnowlogy’s WinRT MVVM Framework Session Part I/II(April 22nd by Kevin)
11. InterKnowlogy’s WinRT MVVM Framework Session Part II/II(May 6th by Danny)
12. Presentation of Hackathon Results + Certificate/Prize Giveaway(May 22nd by Danny and Kevin)

Session 1 & 2 of the WinRT Development Class – Introduction, XAML, and WinRT’s Control Framework

WinRTWebBannerSmall_JPEG

 

The first two sessions of the WinRT Development class were a great introduction to what Windows 8 WinRT development really is and to XAML development. We’re very excited about the future sessions and hope every developer will come learn with us about developing WinRT apps!

Session 1 Resources

Session 2 Resources

 

Overview of Sessions

The links below lead you to Meetup Events where you can RSVP. We look forward to seeing you at our next session!

1. Introductory Lecture (Nov 27th by Danny & Kevin)
2. Introduction to XAML and WinRT’s powerful Control Framework; (Dec 4th by Danny & Kevin Click here for the video recording)
3. Page-Navigation Model and Application Lifecycle (Jan 8th by Danny)
4. Fundamentals (Async/Await, WinRT API, Security) (Jan 15th by Kevin)
5. Settings and Search Contract (Jan 28th by Danny)
6. Share Contract (Feb 4th by Kevin)
7. Live Tiles and Background Tasks (March 18th by Kevin)
8. Orientation Handling and Proximity using Near Field Communication (NFC) (March 25th by Danny)
9. Introduction to ModelViewViewModel (MVVM) (April 8th by Danny)
10. InterKnowlogy’s WinRT MVVM Framework Session Part I/II(April 22nd by Kevin)
11. InterKnowlogy’s WinRT MVVM Framework Session Part II/II(May 6th by Danny)
12. Presentation of Hackathon Results + Certificate/Prize Giveaway(May 22nd by Danny and Kevin)

Development Environment for Windows 8

With the advent of Microsoft’s latest OS, a lot of people are asking how to get setup for developing Windows 8 applications. Here is a short post about getting a development environment for Windows 8 up and running.

Where to find Windows 8?

Full OEM

A full copy of Windows 8 can be purchased at http://www.newegg.com/Product/Product.aspx?Item=N82E16832416552. Be careful to only purchase the Windows 8 Pro version and not the Windows 8 version. Only Windows 8 Pro supports developing.

Upgrade

This is the preferred option.  Windows 8 is great OS. This option also guarantees the developer the best environment for developing for Windows 8. Anyone machine running Windows XP SP3, Vista, or Windows 7 can be upgraded. The upgrade cost is currently $40 (until Jan. 31st 2013) at http://windows.microsoft.com/en-US/windows/buy?ocid=GA8_O_WOL_DIS_ShopHP_FPP_Light for digital media. Developers can/need to create physical media from the digital media by using the Windows 7 USB/DVD download tool in order to create a bootable USB or DVD available at http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool. The tool allows users to create a bootable DVD or USB. Typically the USB has been found to be the easiest. Physical upgrade media is also available at the same site for $70 (until Jan 31st 2013).

Evaluation Copy of Windows 8

The evaluation copy can be installed natively, in a virtual machine, or on a bootable VHD. The evaluation copy cannot be upgraded and is only good for 90 days. After 90 days Windows would need to be installed via a clean install. The evaluation copy can be found here http://msdn.microsoft.com/en-US/evalcenter/jj554510.aspx?wt.mc_id=MEC_132_1_4. The suggested route with the evaluation copy is to create a virtual machine or a bootable VHD. To learn how to create a bootable VHD read this article http://blogs.interknowlogy.com/2011/09/01/windows7bootablevhd/. To learn about creating a virtual machine read this article http://www.techspot.com/guides/503-windows-8-virtual-machine/. Please be aware that the virtual machine and bootable VHD methods only available in Windows 7 (Home Premium or higher).

Tools and Resources

Once Windows 8 is installed visit http://dev.windows.com and http://msdn.microsoft.com/en-US/windows/apps/br229516.aspx to download Visual Studio 2012 and other tools and resources for developing for Windows 8.

VNEXT Presentation: Building for the Future with Windows Phone & Windows 8

Here is the slide deck and sample code from the presentation I gave last night (8/14/2012).

I had such a great time presenting. vNext is an amazing group! Very intelligent developers and quite creative too. It was fun talking about ideas for apps and speculating about the future.

Feedback is always welcome. If there is something you wish I had presented on but didn’t or if I just spent too much time in slides please let me know. Thank you vNext for letting me come and present on this new and exciting topic! Always a pleasure!

Windows Phone 7.5 Isolated Storage for Complex Object Graphs

This post is somewhat related to my series WP7 Simplified. I have been writing the series based on an app codenamed LionHeart and just last night I was trying to get the PhoneDataProvider to save three (3) collections of complex objects. Up till now I’ve been regenerating my mock data each run. That’s OK until you want to start persisting data. Now that I’ve disabled the constant regen of data, I’ve uncovered a small mystery that confounded me for a few hours. So in hopes to save you some time here is what I found.

Basic Serialization Overview

Objects stored in IsolatedStorage are serialized. That means objects retrieved from IsolatedStorage are deserialized. IsolatedStorage uses the DataContractSerializer from WCF. I’m not sure if it’s the same, but that doesn’t matter right now. What that means is it relies on an opt-in pattern for objects to be serialized. Objects that are to be serialized but be adorned with the DataContract attribute and all properties that need to be serialized need to be public, have a getter and a setter, and be adorned with the DataMember attribute. That’s a lot of annoying attribute maintenance if you ask me. Luckily, Windows Phone 7 automatically assumes that each class is adorned with DataContract and all public properties with a getter and a setter are adorned with DataMember so you don’t have to messy up your class with the actual attributes. Cool! Thanks, Windows Phone! However not everything is free. Each each type that will be stored in IsolatedStorage MUST have a public paramerterless (default) constructor. If inheritance is used and there are properties of the base type where derived types might be stored then the KnownType attribute MUST be applied to the base type referenced for all derived types.

The Problem and Fix

Now into the problem I ran into. If you are missing KnownType attributes when calling IsolatedStorageSettings.ApplicationSettings.Save() a SerializationException will be thrown. This is actually good because it tells you what to fix. However, if one of the types is missing a parameterless constructor the Save method will not throw any exceptions. Why is this? Because serialization does not require the parameterless constructor, but deserialization does. So, one might expect an exception when deserializing that object from IsolatedStorage. Deserialization does fail but only throws a KeyNotFoundException. That is absolutely NOT helpful. So I scoured the internet and came across this post discussing manual serializing and deserializing. Figuring it was something to do with my objects failing to serialize or deserialize I used the two methods from the sample for Serialize and Deserialize on each collection of objects that I was about to save to IsolatedStorage. Sure enough I found that I was missing a parameterless constructor and deserialize was failing. Once I fixed my object everything saved just fine.

Serialize, Deserialize, and TestSerialization methods:

public class PhoneDataProvider : IDataProvider
{
	private static string Serialize(object objectToSerialize)
	{
		using (MemoryStream ms = new MemoryStream())
		{
			DataContractSerializer serializer = new DataContractSerializer(objectToSerialize.GetType());
			serializer.WriteObject(ms, objectToSerialize);
			ms.Position = 0;
	
			using (StreamReader reader = new StreamReader(ms))
			{
				return reader.ReadToEnd();
			}
		}
	}
	
	private static T Deserialize<T>(string jsonString)
	{
		using (MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(jsonString)))
		{
			DataContractSerializer serializer = new DataContractSerializer(typeof(T));
			return (T)serializer.ReadObject(ms);
		}
	}
	
	private void TestSerialization<T>(T originalObject)
	{
		string serializedObject = Serialize(originalObject);
		T deserializedObject = Deserialize<T>(serializedObject);
	
		if (Equals(deserializedObject, default(T)))
		{
			throw new Exception();
		}
	}
}

Using TestSerialization:

public class PhoneDataProvider : IDataProvider
{
	public void SaveChanges()
	{
			#if DEBUG
			
			TestSerialization(_clients);
			TestSerialization(_sessionNotes);
			TestSerialization(_sessions);
			
			#endif
			
			SaveValue(CLIENTS_KEY, _clients);
			SaveValue(SESSION_NOTES_KEY, _sessionNotes);
			SaveValue(SESSIONS_KEY, _sessions);
	}
}

So now, only in DEBUG mode, each complex object graph is “validated” and then saved to IsolatedStorage. I love it when things finally work!