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.
Over the weekend I was at University of Ottawa presenting to the students in the Electrical Engineering and Computer Science program talking about building for Windows and Windows Phone and the best way to leverage and re-use code across the different platforms. It’s always exciting to meeting and share with students my experience in software development and helping them along in their endeavours/careers. You can read more about the event on the RedBit blog
As a follow up here are bunch of resources and links to things I mentioned during the two days
- Build4Both Sample Source Code
- Windows Phone Developer Site
- Windows Developer Site
- Developer Movement
- Channel 9 – Lots of technical videos from the product group
- Cross Platform
- Windows Azure Mobile Services
If you attended (or if you didn’t, heard it was mid terms) feel free to connect with me here or via twitter to ask questions on developing for both Windows and Windows Phone or any other questions in general.
Throughout my whole career as a developer I have always tried to participate in various events and speak at events to share the knowledge I have learned in developing software. With the RedBit team expanding, I get introduced to new type of events and get excited to participate.
One of those events is the Global Game Jam and the specifically the Toronto Global Game Jam and the RedBit team will be participating. RedBit as a company has also decided to sponsor the Toronto Global Game Jam. At RedBit we are building some games for customers and used tried different software such Unity and MonoGame so we should be able to get something going in the 48hrs. I will be there to help encourage people to think about all platforms including Windows Phone (it outsells iPhone in 24 Countries), think about games that can go global and think about the female demographic as I think that is an area that is overlooked (45% of gamers are female according to The Entertainment Software Association)
Personally, I’ve played games my whole life and yes I did own Excite Bike. I continue to play games with my kids be it on XBox, Phones or desktops. I have also dabbled in creating games using XNA and going through the process with my son and created ‘hello world’ type games such as Tic Tac Toe and Memory Matching games.
I always get asked what tools should you use? We have used Unity3d and MonoGame with Xamarin, both are good and both allow you to go cross platform which is key in my opinion. At RedBit we are buildign using MonoGame and Xamarin as we are a Xamarin Partner and have all appropriate licenses. If you are building a game, you want to target the widest audience possible and using tools that allow you to go Mac, Windows, iOS, Windows Phone, Android is key. Marketing is also another key factor but that is another post entirely!
I’m excited to be participating in the Global Game Jam to see what comes out of it and feel privileged to be in a position where through my company I can help sponsor the event to help support the developer community.
Will you be there? Let me know as would be great to connect with you!
I have been involved in open data for a while now from a personal interest as a developer and a business interest via RedBit. I’ve participated in various hackathons, events, done presentation, open sourced some code and even help run an open data group called Open Halton where we try to work with cities and municipalities to open up their data.
Over the years I’ve seen many cities open up their data and even seen a Canadian National Open Data policy come into place via Data.gc.ca. It was also exciting seeing Open Data being tabled as part of the G8 summit where it is guided by the following principles
- Open Data by Default
- Quality and Quantity
- Useable by All
- Releasing Data for Improved Governance
- Releasing Data for Innovation
Now the City (or Town rather) I live in (Oakville) is ready to open up the town data and is holding the first community meetup. I will be participating representing the developer community here in the region and how RedBit as a business has leveraged Open Data to generate revenue and most importantly create jobs.
If you are free Feb 5 2014 be sure to join as. You can register at EventBrite and we are holding two sessions to try and accommodate everyone.
Have you done anything with open data? Share what you have done in the comments below or via twitter @MarkArteaga
The first time I was awarded Microsoft Most Valuable Professional Award I was awarded for .NET Compact Framework which ran on Windows CE and Windows Mobile. Fast forward 10yrs later and was re-awarded for for the 10th time in a row for Windows Phone Development.
Over the past years, I’ve meet a lot a lot of people from all over the world who just love technology and sharing their knowledge with everyone around. Being from Canada, it is great to see so many new faces and people sharing their knowledge with the local community. There are over 4,000 MVPs around the world in 90 countries and it’s a privilege to be part of a group like this.
I guess now I’m considered a veteran to the MVP program, but here is to another year in the community and as a Windows Phone Development MVP. If you see me at a conference/event, feel free to say hi, always great to meet new people!
This article is also available on the RedBit Site
Easy Third Party Authentication
Using the Identity feature of Azure Mobile Services allows developers to quick implement OAuth based authentication without having to worry about a lot of the plumbing code that is required when writing everything from scratch.
You can easily incorporate authentication with
- Microsoft Account
As a developer all you would have to do is
- Specify the keys in the portal
- Use the mobile SDK for iOS, Android, Windows 8, Windows Phone with application
- Authenticate via the SDK calling MobileServiceClient.LoginAsync()
To learn more about this feature see Get Started With Authentication with Mobile Services
Most mobile apps written today need some form of data storage and usually the process is
- Figure out where to host it
- Figure out what type of database to use
- Write some REST APIs to access the data
- Make sure the APIs are secured
Using the data feature of Azure Mobile Services developers can quickly create data tables, secure the data tables for read/write operations and also write custom scripts to run when an insert, update, delete or read operation is performed on the data.
From the client side, using the SDK, you call the MobileServiceClient.GetTable<>() method and data will be retrieved. If the data is secured via the portal settings, you will need to login using the client SDK before attempting to retrieve the data.
For more information see Get Started with Data in Mobile Services.
Azure Mobile Services comes with clients libraries for the main mobile platforms available in the market today which are
Leveraging this library and Azure Mobile Services on the back end, developers can focus on writing their app and not all the extra plumbing required for things such as authentication.
The API feature is relatively new (as of Jun 24 2013) to Azure Mobile Services but allows developers to quick build APIs to the systems to be accessed by various client applications. You can quickly build out the APIs required by your app and just as quickly secure the APIs making sure only authenticated users have access to the APIs. Definitely something to use more often in the future!
I’m a big fan of push notifications for mobile apps because it allows users to stay connected and engaged with their users. It’s also a great way to entice users to open your apps and this is especially useful if you are monetizing your apps with in app advertising.
Using Azure mobile Services, developers can quickly get this up and running on the various platforms such as iOS, Android, Windows Phone 8 and Windows 8 and it’s as easy as setting a few keys in your Azure Mobile Services Dashboard
Definitely something every developer should look at to keep their users engaged with their app.
For more information on how to get this running, see Get Started with Push Notifications in Mobile Services.
Overall, I think Windows Azure Mobile services really helps accelerate the development cycle and get your product to market faster. It allows you to focus on building out your product on not have to worry about server infrastructure or plumbing code required for things like authentication. When you need to scale, it’s just a few clicks and you are ready to handle your extra load from your users.
Tracking and visualizing social media streams in real-time and across multiple social networks can be a challenge. Three months ago we set out to address this challenge, in partnership with our friends at IdeaNotion and Microsoft.
Today we’re pleased to release as Open Source the Social Cloud project.
Social Cloud allows users to monitor various social media channels such as Twitter, Instagram and FourSquare, aggregate and process that data (e.g. generate word clouds) and expose real-time streams to web & mobile clients.
The entire solution consists of the following:
- NodeJS “emitters” on Linux VMs running concurrently to monitor social media streams
- NodeJS “server” exposing streaming data to front end visualization systems
- An admin web dashboard built in NodeJS & Bootstrap
- Native iPhone, Android and Windows Phone admin clients built using Xamarin
- Email, SMS, push notification & in-app alerts using SendGrid, Twillio & Pusher
- HTML5/Canvas visualization engine powered by IdeaCloud
Here is an architectural overview of the system that was built using Windows Azure
On the outside, seems like a pretty easy concept, but internally there are a lot of components to make this an efficient scalable system. Here is a list and description of all of the features used for the system.
Azure Virtual Machines
Windows Azure has the ability to run Virtual Machines or VMs in the cloud. The ability to spin up a VM in a few minutes is great from a development standpoint because we can spin up test boxes with minimal effort and minimal network infrastructure.
Social Cloud leverages this feature and we utilize Linux VMs to run our NodeJS processes. We went with a Linux VM because of WebSockets support and we needed a little more control than what Azure Websites provided. Also, the development team felt more comfortable with Linux VM instead of Windows and allowed us to easily start multiple NodeJS instances to monitor social media streams.
As you can see from the diagram, there are multiple NodeJS instances running each monitoring their own social network. In the case of Twitter, we were able to use their streaming API for realtime results while the others are using a polling techninque. Once we receive the data, we store it in a mongoDB instance and pass a message off to Azure Service Bus for downstream processing.
Windows Azure Service Bus
Social Cloud uses the Windows Azure Service Bus to detach the process of gathering the various social messages from the processing of said messages to ensure that we can receive the messages as quickly as possible. One of the different processes that subscribe to the Azure Service Bus topics are the Word Emitter that listens for text based messages and splits them into the words, processes them, then places new messages back onto the Bus. Another subscription listener is the Socket.IO process that passes incoming messages from the bus to each of the listening Socket.IO clients. This separation also provides the benefit of being able to withstand one component failing, as the messages are queued until the process is brought back online.
Windows Azure Websites
Social Cloud leverages Windows Azure Websites to run the administration dashboard which is written using NodeJS. This site also provided APIs to be accessed by iPhone, Android and Windows Phone apps. We leveraged the Git deploy feature available and the integration with BitBucket for automated deployments.
Windows Azure Mobile Services
Windows Azure Mobile services are one of the new features that is still currently in preview mode but we still did manage to use some of the features available for the Social Cloud solution.
Some of the features used are
- Data – this feature allows you to easily store data within your system from clients accessing the system. Specifically we used it to store device information when implementing push notifications. It also allows you to easily set permissions to read/write the data and also write custom scripts to run when an insert, update, delete or read operation is performed on the data
- APIs – APIs is a relatively new feature and essentially allows developers to implement some custom REST APIs required for the system. It also easily allows developers to add support for permissions to any operation performed.
- Push – this feature allows developers to create native push notifications to Windows 8, Windows Phone 8, Android and iOS clients. This is great as you can quickly get this infrastructure setup in minutes.
- Identity – authenticating users is usually required in mobile apps. Social Cloud required it as we only allowed authorized users to access the data. Using the Identity feature we were able to quickly add authentication to things such as Google, Facebook, Twitter and Microsoft Account.
Essentially, Azure Mobile Services allowed us to quickly implement features such as authentication on mobile clients, and let us build out the features of Social Cloud and not worry about plumbing required for things such as authentication.
Windows Azure Store
For Social Cloud, we leveraged various third party components to add features and functionality to the system. The store allowed us to quickly find and purchase the third party services relatively quickly to be integrated into the Social Cloud system. The following third party components were used in the system
- MongoLab - store all the streaming data coming in
- Twillio - send text notifications
- SendGrid - send email notifications
- Pusher - send notifications to clients connected on the web dashboard
- New Relic – monitor the health of the system
Social Cloud is a pretty extensive system requiring many different custom components and third party components to produce the required functionality. Using Windows Azure and the different features available such as Azure Mobile Services, Virtual Machines and Service Bus allowed us to build a robust system quickly and easily.
Over the next few days we’ll be posting some technical blog posts on the system but as of now all the source code is available on GitHub. Be sure to monitor this blog or follow me or the RedBit team on Twitter to get notified when the code is released.
When building out apps, there are some situations where you are required to get a unique ID of the device whether it be for analytic data or to potentially limit devices from accessing some private services.
This quick tip will show you how to get the device ID on different platforms such as Windows Phone 7, Windows Phone 8 and Windows 8.
Windows Phone 7
To get device ID on Windows Phone 7 you can use the following
private string m_DeviceUniqueId;
public string DeviceId
if (m_DeviceUniqueId == null)
if (Microsoft.Phone.Info.DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out val))
m_DeviceUniqueId = Convert.ToBase64String((val as byte));
Windows Phone 8
Getting device ID on Windows Phone 8 is slightly different the the previous version and can be accomplished with the following
private string m_DeviceUniqueId;
public string DeviceId
if (m_DeviceUniqueId == null)
m_DeviceUniqueId = Windows.Phone.System.Analytics.HostInformation.PublisherHostId;
On Windows 8, it’s yet another API to get the device ID and can be accomplished with the following
private string m_DeviceUniqueId;
public string DeviceId
if (m_DeviceUniqueId == null)
var token = Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null);
var hardwareId = token.Id;
var dataReader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId);
byte bytes = new byte[hardwareId.Length];
m_DeviceUniqueId = BitConverter.ToString(bytes).Replace("-","");
If you are using this code to get ID with your apps, be aware that the ID returned will be different in every app. For example, if you have APP1 and APP2, APP1 may return 12345 as the device ID and APP2 may return 09876 as the device ID even though they are running on the same device.
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
- Sharing Code Part I: Common Source File (source code download)
- Sharing Code Part II: Partial Classes (source code download)
- 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…