About the Author

Danny is a Senior Software Engineer at InterKnowlogy in Carlsbad, CA. Danny began acquiring his expertise in software engineering at Neumont University in Salt Lake City, Utah where he graduated with a BSCS. Danny’s passion for technology has led him throughout the Microsoft Stack including .NET, C#, XAML, and F#. 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 Windows Universal Apps and WPF Applications driven by gesture interaction using the Microsoft Kinect. Danny is an Alumnus Microsoft MVP for Windows Platform Development and speaks all over the country including That Conference, Spark Conference, and SoCal Code Camp. When not building beautiful software, Danny is an outdoors man and devoted husband and father. He loves to camp, hike and mountain bike. Follow him on twitter @dannydwarren

Getting Started with Azure Mobile Apps

Earlier this year I worked on an awesome project for IMSA. While the project was full of challenges such as Xamarin.Forms there was one part of the project that ran smoother than the rest. That part was our Azure Mobile Service. Since completing that project Azure has released a new product named Azure Mobile Apps which is an even more comprehensive solution for creating Web APIs for mobile apps. The new name is a bit confusing, but rest assured Azure Mobile Apps does not refer to the actual App package running on a device.

Why?

Before Azure Mobile Apps and Azure Mobile Services the work a developer had to perform to provide a simple API to their mobile app was quite extensive. Standing up a website with a RESTful API was only step 1. If you wanted to see metrics about how healthy your API was you’d have to go find a solution from another provider and integrate it manually. You’d have multiple places to manage your mobile app. Your database might have lived in Azure, but it’s wouldn’t have been related to any grouping of services. The ability to manage this world effectively became unreasonable and difficult very quickly.

Azure Mobile Apps provide all the necessary services to provide and support an API for your mobile app. It also groups all those services in one easy to manage location in the Azure Preview Portal. In my experience the provided services and grouping of those services has provided critical time saving and sanity preserving assistance compared to previous solutions. This is especially true because of the awesome integration with Visual Studio.

What does it do?

Azure Mobile Apps provide a suite of Azure services which are used for working with mobile app development and support. You can read their details here. All of the services are grouped into a single Resource Group. This organization is awesome! It helps you comprehend and manage all of the services used by your mobile app effectively. The default services included are:

  • Web App (aka: A website which hosts Web API Controllers)
  • Application Insights (For the Web App)

You can also add in any number of services into this Resource Group. For example you’ll probably add a Database Server and Database to store the data for you mobile app. Adding theses services allow you to leverage Entity Framework in your mobile app, which is a really cool feature.

How much does it cost?

It would be silly for me to try to repeat the values quoted my Microsoft since Azure changes things quite frequently. You can find the official pricing here. Everyone has a different definition of “affordable”, so I’ll only say that in our experience here at InterKnowlogy this service has been worth every penny!

How do I set it up?

Go to the Preview Portal. In the bar on the left click the “+ New” button. Select the “Web + Mobile” category. Select the Mobile App offering. Fill out all the data. I suggest creating a new Resource Group specifically named for this Mobile App. In my demo I’m creating a Secret Santa app so my Resource Group name is SecretSanta and my Web App name is SecretSantaApp.

image

Click the Create button and Azure will now create all the services mentioned before in a single Resource Group. When Azure notifies you that it’s done you’ll see something like this when you navigate to your Resource Group.

image

You can modify what level of service you want to use for your Web App. From the Resource Group blade click your Web App which is the item with the blue sphere. You’ll see a pair of blades like this:

image

On the right you’ll see Application Settings where you can modify any AppSetting or ConnectionString that is specific to this deployment in Azure. These settings persist in Azure across publishes. This means that you can have AppSettings and ConnectionsStrings for Local development that do not get used in Azure.

To change you Web App’s service plan look under the Essentials section and click the link under the header “App Service plan/pricing tier” which will open the following blade:

image

Click the “Pricing tier” block to open the “Choose your pricing tier” blade for different plan tiers.

image

In the image above you only see a few of the many options. For this demo I selected F1 Free which is a very limited plan, but it doesn’t cost anything which is nice for a demo or proof of concept. You can change your plan at any time. After selecting your desired plan click Select and your plan will be applied.

Now there is a bug in the link to Quickstart at the time of this writing. So at this point if you’re following along, close all the open blades using the ‘x’ button in the top right of the dark blue header.

Reopen your Resource Group and then open your Web App again. This time pay attention to the far right Quickstart blade which should look like this:

image

Azure has provided us with an awesome set of getting started tools for a bunch of different platforms. For the sake of this demo we’ll stick with Windows C#. Click on the Windows C# option. You should now see:

image

You’ll now notice that step 1 is to get Visual Studio 2015 installed. Microsoft offers the Community Edition straight up here in case you don’t have it yet. Step 2 allows you to download a starting point for your service in the cloud. Download this code and explore it. There is a lot going on. We will not cover the source in this demo. The source in basically a Web API project where you can add your Web API Controllers and build it out like you would any other Web API project. Lastly step 3 allows you to download an app that is ready to use with the Web API project you downloaded in step 2. This is an awesome starting point. The project in step 3 for Windows C# is a Windows 8.1 Universal App. If you want to do UWP and/or switch to another language you can do that just fine. At the top of this blade is a toggle button. Toggle it to Connect an Existing App and then follow the instructions to wire up your custom app that you created to the Mobile App service in Azure.

Finally I want to walk you through getting the Database to set up. At the top of this blade you’ll notice a message stating you need a database in order to complete the quick start. Click that banner. It will open a Data Connections blade. We’ll create a new data connection. Click the Add button. Follow the wizard to fill out all required data. Be sure to select “Create a new database” not “Use an existing database” if you want a new place to store your data. If you already have data that you will now leverage in this Mobile App then point at your existing database. Also, make sure you’re aware which pricing tier you’re selecting for your database. The default is standard which for most demos may cost too much.

image

After your database is created navigate back to your Resource Group. It should look something like this now:

image

You’ll notice the 2 new items. The Database Server ands the Database itself. Now you’re Azure Mobile App is ready for use.

Let’s run it!

You’ve downloaded both the Server and the Mobile App. Before you can use the server app you need to deploy it. The sample code you downloaded is ready for upload with all the settings matching your Mobile App settings. Azure does not auto deploy the server code for you because you will always change it for real projects. Go ahead and deploy the project. Follow the instructions in Microsoft’s Tutorial under the heading “Publish the server project to Azure.”

Limitation Notice

In order for your app to access the database using the default settings you need to modify your ConnectionString named MS_TableConnectionString to use admin credentials not user credentials. This is because Entity Framework code first requires permissions to create a schema for your database. Once the server code is deployed go back to the Azure Portal and open the Web App again. Open the Settings blade and select Application Settings. Modify your connection string MS_TableConnectionString to use admin credentials.

image

Save your changes. Then try out your API. You can try it out in the browser by hitting the URL for your Mobile App and then adding on /tables/todoitem. For example: http://secretsantaapp.azurewebsites.net/tables/todoitem. You should see JSON output similar to this:

image

Once this is working you can run the demo app that you downloaded from Azure. The first load of the app should look like this:

image

WOOT WOOT! Demo DONE! You’re now an expert!

The take away…

While it may have taken 15-30 min. to walk through this demo, after becoming familiar with the creation process Azure Mobile Apps take very little time and effort to get up and running. I’m very grateful for this solution. Here at InterKnowlogy we have used Azure Mobile Apps on many different projects in order to support mobile apps on Windows, Android, and iOS. Maintenance has been very straight forward and the flexibility is great. It feels like such a small thing, but has a profound impact on creating successful mobile app solutions. If you have any questions feel free to reach out on twitter @dannydwarren or here in the comments.

SoCal Code Camp – Crawl, Walk, Talk – Windows Universal App Lifecycle and Cortana API

This year’s SoCal Code Camp at Cal State Fullerton was a blast! So many great speakers and attendees. It’s nice getting out again.

Huge thanks to the crew that came out today to my talk. It was a great having so many people there! Here is a link to my materials for my talk:

Crawl, Walk, Talk – Windows Universal App Lifecycle and Cortana API.

Hope to see everyone at the next SoCal Code Camp!

What I do When Creating a New Machine for Development

Everyone has a build that makes them happy when it comes to their development machine. I particularly love to use Bootable VHDs. They allow me extreme flexibility in size, OS, and disposability. I know that sounds funny to some, but I burn through a new dev machine almost every 6 months. Lately it’s been ever project so the ease is great. I’m not going to go in to creating Bootable VHDs in this post, but my fellow InterKnowlogist Travis Schilling has covered it in this blog post. The steps work for both Windows 7 and Windows 8. I assume they will not change for Windows 10, but I don’t know.

I’ve followed this process twice in the last 3 months so it’s pretty comprehensive of what I need and do. Please do let me know your thoughts, suggestions, alternatives, and what you do! Cheers!

My Build

Dell Precision M4800, Core i7-4800MQ, 8GB RAM

SSD Size: 500GB

  • HOST OS Partition: 25GB (Windows 8.1 with Windows ADK – No updates)
  • Data Partition: 475GB

Bootable VHDs (Live on Data Partition)

  • DEV: 150GB
  • EXPERIMENTAL: 100GB
  • PRESENTATION: 50GB

Windows 8.1 Update or Higher

NOTE: “Restoration Tools” is a directory on the Data Partition (I always use the drive letter E:\) that contains installers that are required each time a new bootable vhd is created. This way the internet is not required in order to get the machine up and running. This also significantly reduces down time caused by slow download speeds caused by some manufacturers and software providers.

Restoration Tools->Basics->M4800

  • BIOS not needed (M4800A03.exe)
  • System Tray->Dell Touchpad->Mouse
    • CHECK: Disable Touchpad & Pointstick when USB Mouse is present

Power Settings

Activate Windows

Start Full Windows Update

Control Panel\Appearance and Personalization\Display

  • Right-Click Desktop->Screen Resolution->Display (Back a level)
    • CHECK: Let me choose one scaling level for all my displays
    • ABOVE SELECT: “Smaller – 100%”

Add Printers

Disable Notifications

  • Win+I->Change PC Settings->Search and apps->
  • Search
    • Strict Search
  • Notifications
    • SWITCH “Show app notifications” to Off

Move Libraries (“C:\Users\Danny”, ALL)

  • Right-Click Library->Properties->Location (tab)
    • Input new shared directory location for library to share with other VHDs
      • (i.e. E:\Desktop)
    • Click Move
    • Accept move all Items

Taskbar and Navigation Properties

  • Right-Click Taskbar->Properties->Jump List
    • Set to 30 items

Add Toolbar to Taskbar for Recycle Bin

  • Right-Click Taskbar->Toolbars->New Toolbar
    • Select Folder with Shortcut to Recycle Bin (E:\Toolbar)

Remove Recycle Bin from Desktop

  • Right-Click Desktop->Personalize->Change Desktop Icons
    • UNCHECK: Recycle Bin

Finish Full Windows Update (Wait – Continuing before Windows is fully updated may cause instability in Windows. It’s best to fully patch Windows and then continue.)

Business Environment Install (Unless noted all apps can be found in Restoration Tools)

  • Office 2013
    • Setup Outlook and Lync
      • Outlook
        • File->Options->Reading Pane->Uncheck: Mark item as read when selection changes
    • OneNote
      • Can’t Open Hyperlinks: http://support2.microsoft.com/default.aspx?scid=kb;en-us;310049

Restoration Tools->Basics->Misc

  • 7zip
  • Notepad++
  • Cubby
  • Paint.NET
  • TreeSize (? Better app for purpose ?)
  • Chrome
    • Sign in to Chrome and all extensions
  • Camtasia
  • Snagit
  • ZoomIt
  • Skype
    • IM & SMS Settings->IM Settings-> Show Advanced Settings
      • Select: paste message as plain text
  • VLC
  • TweetDeck
  • http://baremetalsoft.com/baretail/
    • Restoration Tools->NoInstall
      • Enable Search: Pin to Start

Set Default File Type Associations

  • All associations for Notepad should be changed to Notepad++
  • Search “Default”->Default Programs->Associate a file type or protocol with a program

Pin Chrome Applications (Pandora, Wunderlist)

  • From Pandora (Pick favorite Station)
    • Click Hamburger Icon->More Tools->Create application shortcuts
      • ONLY CHECK: Taskbar

Enable IIS

  • .NET 3.5
  • .NET 4.5
  • IIS 6 Compatibility
  • Other settings as desired

Full Windows Update (Wait – Again, to prevent instability fully patch Windows at this time.)

Dev Environment Install – Do in Order (Unless noted all apps can be found in Restoration Tools)

  • SQL Server 2012 Dev Edition (MSDN)
  • Visual Studio 2010 (MSDN)
  • Visual Studio 2013 (MSDN)
    • Disable Start Page (Check box at bottom of page)
    • Perform all updates
    • Update Snippets Directory
    • Options->
      • Documents->
        • Check: Auto-load changes, if saved
      • Startup->
        • Show empty environment
        • Uncheck: Download content
      • Tabs and Windows->
        • Uncheck: Allow new files to be opened in the preview tab
    • In Debug Mode->
      • Output Window
      • Solution Explorer
      • Team Explorer
      • Changes
      • Pending changes
  • Resharper
    • Use VS Intellisense
  • Xamarin
  • Telerik
  • Beyond Compare
    • Setup VS (Optional)
  • Xaml Spy
  • Snoop
  • Kaxaml
    • Don’t use as default .xaml file opener
  • MongoDB
    • Still working to figure this one out…

Taskbar Icon Order (Enable Win + [#], ex: Win + 1 launches IE):

  1. IE
  2. Pandora
  3. Chrome
  4. File Explorer
  5. VS13 (Always in Admin Mode)
  6. SQL12
  7. Wunderlist
  8. Excel
  9. Snoop (Always in Admin Mode)

NEAdNUG: Crawl, Walk, Talk – Windows Universal App Lifecycle and Cortana API

Always more time for firsts! This was my first time giving a remote presentation! HUGE THANKS to NEAdNUG and everyone else who attended with that group or online! It’s a strange feeling to be so immersed in tech and be able to connect with people on the other side of the country.

Crawl Walk Talk – Windows Universal App Lifecycle and Cortana API

Repo: CrawlWalkTalk

It’s always a pleasure to work with such talented people across the globe. I hope my materials were found to be relevant and helpful. Feedback and Pull Requests are always welcome. Hope to see you at the next User Group!

devLink 2014: Presentation Materials

Super stoked to present at devLink this year. I’m trying to get with the times and provide my materials before hand so you can get your hands on them before you forget about them. You can find everything from my slide deck to code in my GitHub repos.

Crawl Walk Talk – Windows Phone App Lifecycle and Cortana API

Repo: CrawlWalkTalk

Master Windows 8.1 Location and Proximity Capabilities

Repo: WindowsLocationAndProximity

For those that see this before I hope you attend, and for all those that attend thank you so much for coming and please let me know what you thought of the presentation and materials. I’m always trying to improve. For those that find these materials after the presentation please check them out and let me know if I can answer any questions you may have!

Presentation: Crawl Walk Talk – App Lifecycle and Voice API for Windows Phone

Talk about technical difficulties! Major props to the vNext crew for sticking through my crazy tech issues. For those of you who couldn’t make it VS wouldn’t open any files. It would load the project, but if I tried to open a .xaml file VS crashed. I had installed VS 2013 Update 2 the night before thinking it would fix a code issue for me. Instead it created a nightmare! And then Cortana and I got into a fight. A little reboot fixed her right up. Overall I had fun despite the difficulties. Thanks again to all who attended!

Materials

I’m starting a new practice with this presentation. I’m using GitHub to host ALL of my materials: Code and Deck! I hope that works out better than having to download .zip files. Plus this way you can submit Pull Requests for bugs you see during my presentations. 😉 But seriously, I hope it makes it easier for you to access and for me to update! See link below:

Review: Dave Fancher’s “The Book of F#”

This book is fantastic! I had little F# experience going into this book and found the basics of the language easy to understand and fun to read. Dave does an excellent job explaining F# from syntax, types, and its functional nature all the way through complex topics like quoted expressions and asynchronous programming. The occasional Dr. Who reference is sure to catch the eye in his exciting code samples. As a C# developer I really appreciated Dave’s chapter that focused on comparing F#’s APIs to C#’s. I feel confident in adding F# to any of my pre-existing C# projects right away. One thing that I found very intriguing was Dave’s focus on using F# for regular application development not just math! F# is not just a niche language for the scientific world, but is a way to help develop extremely testable and reliable code in everyday applications.

I highly recommend Dave Fancher’s “The Book of F#” to every .NET developer. Even if the developer does not adopt F# the lessons taught by the language are invaluable and will make them a better .NET developer in whichever language they use.

DVLUP Day San Diego – Intro to WinPhone Dev and App Studio Materials

Thank you so much to those who attended my session today! It was awesome. All of my materials were websites and Visual Studio project templates. You can find them here:

We also learned about Windows Phone AppStudio.

If you have any questions feel free to contact me! You can find me on twitter: @dannydwarren or here in comments.

Presentation: Introduction to Windows 8.1 App Development

A huge thanks to the crowd at the San Diego .NET Developers Group! You guys were an awesome crowd. Congrats on the 20 year anniversary of the group as well. It’s great to know we have a deep culture of helping and teaching each other in the area. Keep it up!

For those that couldn’t make it we discussed how to handle Page Navigation and App Lifecycle for the first hour then moved into Location Services for the last 30min. Theses are some critical topics for Windows 8.1 App Development that I think a lot of people could use some help with. I only say that because many apps I use behave badly. I hope you find the recording of the session useful. Please leave some comments on what you think!

Materials

 

Again, thanks a bunch! And we’ll catch you next time!

Send Your Automated Build via Hightail (Formerly YouSendIt)

Here at InterKnowlogy we are always looking for ways to optimize our business. We’ve been using automated builds for sometime now. They are seriously one of the best things since sliced bread! Who doesn’t love to see a giant green checkmark stating their check-in succeeded. Or yelling names down the hallway when someone else causes a huge red ‘X’ to show up due to a failed check-in. As long as those names are aimed at you that is… We’ve been struggling with one problem lately with our release builds. If we have someone working offsite and they need to get the build after it completes they have to VPN into our network, go to the build directory, and copy the deliverable to their local machine. We do a lot of really cool graphically intense applications, which can mean large deliverables. This then turns into a really long difficult process to get a single deliverable. After a lot of discussions we come up with a really cool idea to use Hightail.

Hightail (Formerly YouSendIt)

We use Hightail for sending and receiving large files as I’m sure many of you do. We love the feature allowing us to specify an expiration date on a file so it will no longer take up space on our account. I did a lot of research on DropBox, Box, SkyDrive, and a few other options and each had pros and cons. In the end, Hightail was superior. It supports expiration dates, emails, and an easy API.

BuildSendService

We created a REST service that lives on our build server named the BuildSendService. This service is responsible for accepting a file path, expiration date, and details for sending the email with a link to the file. Information received is immediately added to a queue and which is then processed asynchronously. This allows the caller of the service to continue on to do more work instead of waiting for the file to be hightailed. The service asynchronously processes each item in the queue using the Hightail API, which is brain dead simple! It’s really great! Hightail takes care of the email for us once the file is uploaded. Recipients can then quickly download the file from their inbox! AWESOME!

SendBuild Custom Build Action

In order to leverage the BuildSendService most efficiently we built a Custom Build Action named SendBuild. In our Build Process Template, after the build has completed all other tasks and the final deliverable is ready for use in the final build directory, the SendBuild action contacts the BuildSendService to hightail the build to all desired recipients. It is not a mandatory action and is ignored if no recipients are specified. We wanted this action to be as fast as possible. That is why the BuildSendService accepts the parameters and queues the information immediately. This frees up our build server to process the next request immediately instead of waiting for a large deliverable to be uploaded to Hightail.

Conclusion

While this process is still new to us here at InterKnowlogy it is showing promise. Overtime, I’m sure we’ll tweak the current implementation to make it better and help use run more effectively and efficiently. Also, Hightail is just awesome! They have been super helpful answering all of our questions and pointing me in the right direction for development. They have a .NET sample application, which as far as I can tell implements each of their APIs. That was the best source of information. Their documentation is mostly good, but could use some extra explanations. If you want to do something similar for your build process let me know. I’m happy to help where I can.