Archives For Samples

In the middle of a project where the team is building a customer app for iPad using Xamarin a requirement came up to automatically shut down the after a certain action was performed by the user.  Usually it’s recommended to not ‘kill’ your app on iOS and apps may fail certification if you do this.  Make sure to read the iOS documentation.

Now because we are doing an Enterprise Deploy and not an App Store Deploy, we were pretty safe.

I go in more detail in the post titled Exiting an iOS App using Xamarin on the Exiting an iOS App using Xamarin.

In the last three posts, I have gone through various ways to share common code across the various Windows based platforms. So far in this series of articles in sharing code we have looked at

  1. Sharing Code Part I: Common Source File (source code download)
  2. Sharing Code Part II: Partial Classes (source code download)
  3. Sharing Code Part III: Conditional Compile (source code download)

In this final part, we’ll look at using a Portable Class Library to share the Math2 class across the different platforms instead of the C# source code file. Personally, I prefer sharing the source code file across the platforms and not sharing an assembly as it gives a little more control. Of course, if I’m building out an API or SDK for external developers to use, a Portable Class Library is the way to go. Continue Reading…

In the first part of Sharing Code series we looked at sharing a common class source file across three different platforms, and in the second part we continued with using partial classes to separate the code out. In this third part of the series, we’ll look at using conditional compiles in our code and continue working on the sample code from the previous articles. Continue Reading…

In the first part of Sharing Code series we looked at sharing a common class source file across three different platforms. Continuing the series on Sharing Code across various platforms, we’ll look at leveraging partial classes to help share code across our many apps on Windows 8, Windows Phone 7 & Windows Phone 8 using the same source code from Part I.

What is a Partial Classes?

Essentially a partial class allows you to separate a class or structure into two or more separate files. Personally, I use this technique to hide any specific platform code from other platforms.

Continue Reading…

In this article, I’ll go through how to share source code files between Windows Phone 8, Windows Phone 7.1 and Windows 8.  In this sample we’ll go through how to share a Math class between two separate Windows Phone projects.

Creating the Projects

First thing is to create two Visual Studio 2012 Projects one for Windows Phone 7.1, 8 and Windows 8.

Windows Phone 7.1 Project

Create a Windows Phone Project and call it WP7_App and uncheck ‘Create Directory for solution’.

Continue Reading…

In 2006 I did a presentation on that focused on .NET Compact Framework for Desktop Developers where the core focus was on how to leverage existing code from the full desktop .NET Framework and .NET Compact Framework.

Well seven years later (yes I’ve been doing this a long time!), some of those techniques are still usable with all the different mobile platforms available and as a developer you definitely want to leverage as much code as possible.

In the next series of articles, I will go through some techniques on sharing code across different platforms including Windows Phone 7, Windows Phone 8 and Windows 8. You can use some of the techniques also on iOS and Android using Xamarin.

The following topics will be covered:

  1. Sharing Code Part I: Common Source File (source code download)
  2. Sharing Code Part II: Partial Classes (source code download)
  3. Sharing Code Part III: Conditional Compile (source code download)
  4. Sharing Code Part IV: Portable Class Libraries (source code download)

I have personally used these techniques with various products we have built plus customer work.  By the end of the series, hopefully you will have a good understanding on how to leverage your code across different platforms using C#.

Note that the samples being used are not using anything like MVVM or other frameworks as it’s something I was using my 11yr old son on using programming to solve some math homework he had and I wanted to keep it as simple as possible.

I recently wrote a four part article about how to build a simple count down timer app using HTML5 and Windows Phone.  The articles covered getting started with HTML5 and Windows Phone, multiple resolutions, using the WebBrowser control to ‘talk’ to web page and finally getting ready for Windows Phone Store certification.

Here is the result of the articles.

finalImage

Here is a list of the articles available for easy reference

  1. XBoxReveal HTML5 Windows Phone Sample
  2. XBoxReveal HTML5 Windows Phone Sample: Multiple Resolutions
  3. XBoxReveal HTML5 Windows Phone Sample: WebBrowser Control
  4. XBoxReveal HTML5 Windows Phone Sample: Store Certification

As for the source code, if you want to run it yourself you can download the #xboxreveal source code from GitHub.

Hope it was useful and please leave comments or questions!

In this final article of the XBoxReveal HTML5 Windows Phone sample, I’ll be going through some of the things you need to do as a developer to get ready for Windows Store Certification.

If you have not read the previous articles, here is a list for some background

  1. XBoxReveal HTML5 Windows Phone Sample
  2. XBoxReveal HTML5 Windows Phone Sample: Multiple Resolutions
  3. XBoxReveal HTML5 Windows Phone Sample: WebBrowser Control

Getting Ready for Store

The first thing you want to do to get ready for Windows Phone Store certification is read the App Certification Requirements for Windows Phone article on MSDN.  Lucky for the people who don’t like going through the entire document (like me :) the Windows Phone SDK comes with a Store Test Kit to help go through the cert process.

wp-testkit

Continue Reading…

In this third installment of the Windows Phone HTML5 XBox Reveal sample, we’ll look at fixing the horizontal and vertical scrolling of the index.html

Here are the first articles available if you have not read them yet for some background

  1. HTML5 & Windows Phone: XBox Reveal Sample
  2. HTML5 & Windows Phone: Multiple Resolutions

Usually using CSS you would fix horizontal scrolling by setting the following meta tag in your HTML page.

Unfortunately this does not work within our app. But fortunately for us, there is a fix to this but does take a little extra work.

Continue Reading…

In a previous article I wrote about writing an XBox Reveal Count Down Timer for Windows Phone using HTML5 & CSS. By the end of the article we ended up with the following

finalImage

Continue Reading…