Xamarin: Multi Platform Development

In the past I wrote some applications for the Windows Phone Platform. A few of them can be even found in the store. They are not perfect, but they gave me good insight in how it works. What does a little screen mean for development and what does it need to get in the store?


The first of the list is still in the store, but I lost the code Knipogende emoticon. Even then the rules of the store are tighten a lot, so this app would not stand these current rules.

I have a app for the Windows 8 platform too. Well in fact a few more, but they are not available for download. One is a demo app for Azure Mobile Services and one is the SDN evaluation app I talked about previously.



But anyway, I wanted to make an app for Android and iOS too. I have tried on my iMac with Xcode, but I got lost in Objective C language and could not find my way with the Apple tools. In the Microsoft world Xamarin is the environment to do it. A super tool to exploit your current skills for the other platforms.

I had this need to develop for the other platforms for some time, but could not find the time. But I found time. It is a kind of Hello World app, although the usage is bigger. But almost no shared code and no server side code.

At my former employer Ronald Hubert made a Scrum app for Windows Phone. I have used his idea and design of the cards. I did not reuse his code and wrote it myself.

You make two windows, draws the cards on the first and in the Click event you open the second window. In the second window you load the correct scrum card with a Click event to get back to the first window.

In code:

private void imageV_Tapped(object sender, TappedRoutedEventArgs e)
{     Frame.Navigate(typeof(DetailPage), "V");

So in the Click event of the image, tell where to navigate to with a parameter. Clean and simple Knipogende emoticon


For Android development you have two choices. Or you develop with Visual Studio or you develop with Xamarin Studio. The first is more the way you always work as a C# developer. I haven chosen to work with Xamarin Studio.

In fact the same ritual like Windows Phone is used.

ImageButton imButton1 = FindViewById<ImageButton> (Resource.Id.imageButton1);
imButton1.Click += new EventHandler (PictureBtn_Click);
void PictureBtn_Click(Object sender, EventArgs e)
	ImageButton imgbut = (ImageButton)sender;
	var intent = new Intent (this, typeof (NextScreenActivity));
	intent.PutExtra ("picture", (imgbut.Tag == null ? "" : imgbut.Tag.ToString()));
	StartActivity (intent);

Different is, you need to find the button on screen (like in HTML) and connect to an event. In the event a new Intent created and with the Intent an Activity must be started.



Apple/iOS uses a Story board and forces MVC. There lot’s of events and codeblocks for the iOS part.


Screen Shot 2015-02-14 at 13.37.40

Although I could use C#, it was three time different developments.

There is also something like Xamarin Forms. Then the frontend for the different operating systems will be more alike. That will be my next project.

To get the apps in de Stores wasn’t that easy like before. Windows Phone and Android were much alike, but the Apple appstore was more trouble and takes more time to be validated.

To download this app::

Posted in dotnetmag, Gadget, Windows Phone | Comments Off

Windows 10 and Office Apps

Since some weeks I am running the newest Windows 10 Technical Preview on my Surface Pro 3. The first version of Windows 10 was getting the worst behaviors of Windows 8.1 out of the system. Windows 8 was very Touch oriented, the first Technical preview of Windows 10 was more oriented on keyboard and mouse. This new version combines them better.

Some other new and nice additions are Cortana and Continuum. We know the first from the telephone and in same way from the XBox. You can speak to your PC in a natural language and she will understand you. Not like the old days where the computers had a small vocabulary. On the Phone and now on the PC you can activate Cortana by saying ‘Hey Cortana’. (At this moment only available in some countries)

During the first presentation of the Windows 8 successor they showed a slow movie about Continuum. Removing a keyboard will be detected and gives you the possibility to go into tablet mode.

10-2-2015 01-41-26

I have played with it and it works pretty nice. Even if you put the Type cover on a Surface to the back, it detects it as removing the keyboard. Now they should implement it detects a dockingstation too, because then you probably will stay out of tablet mode. One annoying thing when going into Tablet mode the desktop is not available anymore. Documents, shortcuts, apps etc on the desktop cannot be moved/executed or changed in Tablet mode.

Also the startmenu freshed up. On the left hand side the list with all applications is ordered and sorted. Grouping is possible again like we did on the Start screen.

Screenshot (4)

In de first version the icons were changed a little, they have changed more of them.

Screenshot (5)

Screenshot (6)

New in this version, Windows Store apps have more buttons on the title bar. On the right side there are Close, Full screen, maximize and minimize. On the left there is a little menu, with the items of Windows 8 with a Swipe from the right. They had to do this, because the store apps are now running in their own Window.

Screenshot (7)

This will not be the last changes, many will follow in the way to Build and during Build.

There is a new Touch based version of Office available. On all mobile platforms like Android, Apple and Windows Phone we had nice mobile versions of Office. The Android and Apple versions were a little further than on the Microsoft platform itself. But now in Windows 10 a preview of Word, Excel and PowerPoint is available. These have to be installed and downloaded from the store.

10-2-2015 01-34-51

They are rather complete and look very tight and nice.

10-2-2015 01-36-46

New documents will be placed by default on your OneDrive. Very handy, this makes your documents available on all your devices. This makes collaborate with others very easy. In each of the Office products there is a “Collaborate with others” button. Your document on OneDrive will be shared with the person you want to collaborate.

Screenshot (2)

Changes can be seen real time.

PowerPoint is for presentation of course. But like every App store app, it is Windowed so not full screen. Like you used too.

Screenshot (3)

I need some time during real presentations to get acquainted with this. Strange is though, the new menu items and buttons on the Title bar are not there with Office apps. Which I did not expect.

This version of Windows 10 is leaner and meaner, but there are still some rough edges. The Office apps are a real nice addition.

Posted in dotnetmag, Gadget, Gadgets, Office365, Surface, Windows 10 | Comments Off

IoT (3) Intel Galileo

In my last blog I already told about Microsoft Windows on a Intel Galileo board.  I showed how to show some texts on a LCD display with C++ code. Not long after that the second generation of the Galileo board came. It was a little more powerful.

In my last blog I had to connect my LCD display via a breadboard to my Galileo. Not uncommon in the Arduino world, but it doesn’t look nice and is very error-prone for not very technical people. So I bought a Seeed Grove Starter Kit. Another advantage of this kit it contains different sensors etc. Very nice to start something.

So why this new post then? This time I did not want to just lid a LED or show some text on a display. But I wanted to combine some stuff. A led on port 13, a LED socket on port 7, a button on port 3 and a LCD display.

The single led blinked permanently, but the other should lid up when you push the button and the display shows that too.

First I did it again in the Arduino environment. On the Galileo there is noting special needed.


He, that is no fun. Windows can be run on this thing, so I had to use that. So move the code from Arduino to a Visual Studio solution. Include the rgb_lcd.h header file and compile. “Rebuild All succeeded”.


Then start the Remote Debugger.


And we break in the first breakpoint.



Before debugging the application is deployed and copied to the Galileo. On the C-disk (the SD card) is a directory Test with the executable. By using telnet you can start the executable. Like you see below, and it stays running till you stop it. Of course there a possibilities to let it start after starting the Galileo.


Next challenge is waiting for the next version of Windows for Galileo, Windows 10. I hope with support for .NET / C#. I am very curious how the many Arduino modules will be available via C#. Microsoft also announced Windows 10 support for Raspberry PI. I bought one, so I will play with it.

At Xpirit and Xebia started a IoT Makers lab. Together with colleagues we are making and designing nice IoT solutions. I will get back on that later!

Posted in dotnetmag, Gadget, Gadgets, IoT, Visual Studio, Windows 10 | Comments Off

API Management

It is for vendors of products very difficult to make mobile applications for every possible mobile platform. Of course by preparing and making a good responsive mobile website available will enhance your reach. Not getting the most out of the mobile devices is the downside of a mobile website.

Because of this vendors make their back-office via API’s available to the world. As a vendor you want earn some money on the usage of your API. This means you need a Developer portal where you can divide developers in groups, generate help pages, provide demo/example code, monitoring of the usage, place to get issues, FAQ, but also block or blacklist certain developers/users/applications. In short there is more needed then simple provide some webservices.

A while ago I had such a dream too. I wanted to create an evaluation app for the SDN. Attendees of a SDN event should be able to fill in a evaluation form via their mobile devices. The evaluation was stored on Azure in a datastore. Of course I did not want to store my tokens/connectionstrings/passwords etc with my mobile app. And I am not able to create a app for every platform, so I definitely did not want to share my secrets with some unknown/wild developers.

Screenshot (1)_thumb

So I thought of preparing some Webapi services and expose them. But like I described above, I needed a portal to explain my services and their responses. That is a lot of work for a small API like this. This is my portal now; http://sdnevalapp.azurewebsites.net/.

1-7-2015 4-34-32 PM_thumb[2]

Luckily there is a solution on the Azure platform. The API management service (documentation site).

1-7-2015 4-40-33 PM_thumb[1]

1-5-2015 9-53-21 AM_thumb[4]

After creating the service, there is a different portal (https://marcelmeijer.portal.azure-api.net/admin) to do the settings, looking at the metrics, the applications, the usage etc.

1-5-2015 9-53-33 AM_thumb[2]

At the settings is the place to make the webservices available. The different operations, HTTP actions, the response codes, which URL, description and informational texts.

1-5-2015 9-56-59 AM_thumb[4]

1-5-2015 9-57-15 AM_thumb[2]

The URL to the source services can also be hosted on-premises. Of course it is smart and wise to secure the endpoints on this URL with Certificates, UserName/Password combination or with OAuth.

This was the management portal for the admin of the API(https://marcelmeijer.portal.azure-api.net/admin), for the developers there is a separate portal (https://marcelmeijer.portal.azure-api.net/). Which can be styled and changed within limits.

This Developer portal is rather complete. All the mentioned functionality can be found on it.

1-5-2015 9-53-44 AM_thumb[1]

There is a handy overview of the available API’s.

1-5-2015 9-53-59 AM_thumb[2]

From the available API you can see the endpoints. You see the descriptions and the URI for calling the endpoint. To use the endpoint in an application the addition of a subscription key. The whole idea of this portal is to regulate usage and with these subscription key is bound per API to an application/developer. Because the base endpoints are secured by Certificaten, Username/Passwords or with OAuth, bypassing the API management is useless.

On this Developer portal there is even a possibility to try out the API method for the different HTTP actions. The trace and the result is shown.

1-5-2015 9-54-38 AM_thumb[1]

1-5-2015 9-54-56 AM_thumb[2]

1-5-2015 9-55-30 AM_thumb[1]

At the bottom of the page you can find example code for a lot of programming languages. Everything to help your ‘customers’ of your API.

1-5-2015 9-55-45 AM_thumb[1]

As I told in the beginning of this blog, making an API available is one thing, but document/manage it is another thing. By using the Azure service you can focus on the fun and most important part of the API, the functionality.

Why develop it yourself, when you can use the expertise of others. “You can reach further while standing on the shoulders of giants”

Posted in Azure, Cloud, dotnetmag | Comments Off

Azure Webjobs

During the past Dutch Microsoft Techdays 2014 I did a session about Azure Cloud Services. A recording (in Dutch) can be found on Channel 9. In the beginning of Azure, Cloud services were the “way to go”.

Cloud Services is a very powerful concept, but it had some small cons. Existing applications could not moved to the Cloud via a Lift and Shift method. Mostly because the application wasn’t well designed itself. Most applications were not pure stateless, a-synchronic in base and most applications were not able to run in concurrent identical instances.

In the past years the Azure platform has become much richer with lots of different services. In stead of making something new or copying something from others, Microsoft takes existing products or tools makes it available/better suitable for Azure (like Hadoop, Docker, etc).

Also IT development itself became more mature. Developers and architects realize that Scale up doesn’t support availability, services/servers will break down and an internet application has the potency of a big audience.

Standard dogma’s like SOA architecture, Servicebusses or SOAP webservices are losing their power, Microservices looks more promising and are getting better tooling. About this I will blog in the near future.

Back to my Techdays demo. It looked something like this:


The solution looked like this. The code can be downloaded or ask me. As said I exists of a WebRole and a WorkerRole. The WebRole is used for uploading and viewing the pictures.


The flow of the application looked like this.


As you see besides uploading the WebRole has to add a message to a queue for the WorkerRole. The WorkerRole needed a mechanism to read the queue. Like I told in my session, you have to handle the Busy waiting problem. Reading from the queue is a transaction and a transaction costs money. An important part of the architecture on Azure is Cost Based design. So reading from for example a queue has to be efficient and effective with costs in mind.

Nowadays on Azure there is the possibility of Webjobs. With these webjobs it is possible to let it be triggered after a new blob is added to your storage. In my case this reduced the usage of a message on a queue and a own check on the queue in the WorkerRole. This part (checking new blobs on storage) is handled and controlled by the platform. And what I don’t have to do, save time and the platform can do this much more efficient. So the WorkerRole can be released by a Webjob. The WebRole can be replaced by an Azure Website. Did I need special skills for the WebRole, like reading the configuration settings. With an Azure Website I can use the technical skills I always used. And about the settings you can read about it in my previous blogpost.

The process looks like this.


After a little redesign the website looks like.


The code of the Webjob is only this, some 55 lines of code.


The WorkerRole used double lines of code, of which the most was used for processing and not the real deal.

As I always tell during presentations, we can focus on the functionality and the real work, the rest is done by the Azure platform.

Ok, now the part of the web Client to get a message of the queue to see the job is done should be done otherwise.

NB In this blogpost I am not telling Cloud Services are useless. In the scenario above the extended possibilities of Cloud Services are not necessary. Look at this page for a detailed comparision.

Posted in Azure, Cloud, dotnetmag, Storage | Comments Off

Macro in Excel not working after update

I am using an Excel 2013 sheet to create invoices. It is powered by macro’s a lot. After the latest Office updates the Excel sheet did not work like it use to. It reported unclear errors.

After some searching on the internet I found the solution to this situation. Just search for file MSForms.exd, which shall be located in temporary folder C:\Users\user.name\AppData\Local\Temp\Excel8.0\ and delete MSForms.exd. The file will be rebuild during the next Excel 2013 launch, and all VBA macros will work.

It worked and so did my Invoice sheet.

Posted in dotnetmag, Microsoft Office 2013, Tip | Comments Off

ConnectionStrings / AppSettings Azure

During my actions to understand Azure webjobs I stumbled upon this nice feature.

A Webjob is deployed with an Azure website. With a Webjob there belongs a dashboard for logging and details on processing. After I deployed my Webjob on this Dashboard I saw errors and warnings. Although my Webjob was running according to the status.


As the error/warning told, I had to add the Connectionstring to the connectionstrings part on the configure part of an Azure website. That cleared the error/warning.


First thought was now I have to configure the Connectionstring on two places. Once on the portal and once in the app.config of the Webjob. This is not I would like it. I don’t like a setting configured on two places. But that is not necessary.

In your code you use:
var storageAccount =

But the value of the Connectionstrings or App settings are entered on the Configure tab of the Azure Website.


And this also works for the App.config of an Azure Webjob.

More information: http://www.asp.net/identity/overview/features-api/best-practices-for-deploying-passwords-and-other-sensitive-data-to-aspnet-and-azure

Posted in Azure, Cloud, DevOps, dotnetmag | Comments Off

Microsoft Azure: Linux

During the past Connect(); event in New York Microsoft made clear they love Linux and Open Source. Their .NET framework is now open source which shows this love. But Satya Nadella earlier already stated Microsoft Love Linux.


In the beginning Azure only exists of Microsoft related products. In fact Azure was only PAAS. Virtual Machines like with Amazon wasn’t possible. There has been something called VM Role but luckily this was replaced very quickly by the real IAAS.

Since the new HTML portal (http://manage.windowsazure.com) IAAS or Virtual Machine belong to Microsoft Cloud landscape. And Linux images belonged to them on day one! Many frowned their eyebrows, the number of images just went up. On the current preview Portal (http://portal.azure.com) the list of Linux images is really big. And I think it is not the end yet. Perhaps in the Marketplace other vendors will sell and service other Linux images. The bigger the demand, the bigger the offering.

11-23-2014 15-36-59

During my daily walk through the Azure portal (Microsoft Azure grows very quick) I saw I could service my own Minecraft server. The only thing you need, a name and 15 minutes. After that you got your own Minecraft server. How cool! This one runs on a Linux image by the way.


What is your reason not to use Microsoft Azure?

Posted in Azure, Cloud, DevOps, dotnetmag | Comments Off

Visual Studio 2015 Preview: C# 6

On November 12 and 13 Microsoft organized the Connect(); event in New York. the keynote was live and the Dutch communities (WAZUG, DotNed, VB Central and of course SDN) had organized a evening event to watch the keynote together. If you weren’t there or missed the event completely, you can still watch via Channel 9. Not the least speakers were there: Scott Guthrie, S. Somasegar, Brian Harry and Scott Hanselman.

During this event Microsoft showed the words of CEO Satya Nadella, Mobile First, Cloud First, weren’t just a hollow remark. The statement is part of whole Microsoft and in all the do. The keynote showed it.

They did a lot of announcements, one was the fact Microsoft made the .NET platform Open Source via GitHUB. Which means anyone can do a Pull request and solve bugs etc. Microsoft will pick up these changes (after testing etc.) corporate in the branch. How cool is that! The first pull request came within a hour after opening.

An other announcement was a preview of Visual Studio 2015. Besides that also new previews of ASP vNext and C# 6. However there are no new language elements added, but the language and tooling is cleaned and optimized. All adjustments are meant to make it easier for the developer.

In this blogpost a few of the changes.

Code must besides easier to read also cleaner. Take this simple method, we could do without the function body.

11-22-2014 15-57-00

By using the Lambda arrow (=>) it is possible to make it shorter. The Lambda arrow was already in the language, but now you can use it for this too. There is an other usage.

11-22-2014 15-57-00

Clean code, understandable and readable. Self documenting code Knipogende emoticon

Other change. You will recognize the next code construction.

11-22-2014 16-00-57

With the new Elvis operator it can be shorter and more readable. The ?. (image some Elvis hair and eyes) operator checks for the object to be NULL.

11-22-2014 16-01-07

Also posisble with methods in a Class: x?.Calc(1,2); Personally I find this dangerous, because the Calc methode is not executed if x is NULL. And if your tests or structure of the application is not good, this will unpredictable situations.

Another construction you and I use a lot. We make strings for messages and we use of course the string.Format method. Super easy and rather readable, disadvantage you need to count the position and it is not always clear in a blink of an eye.

11-22-2014 16-03-39

So this should be different. Simple \{<variable>} and the code is more documented. Of course the formatting rules of string.Format are still possible, complete freedom for the text.

11-22-2014 16-03-39

The above line makes the variable a field of a class/object. By making it public, you can manipulate it. You better use properties. But nowadays properties need to have a getter and a setter. In C# 6 there is the notion of a read-only property, a property with a getter and no setter.

This in the above example done with the lambda arrow, it will transfer in a read-only property automatically. You see this by the Code lens reference counter. But if you want to change the property in code you get a compiler warning.

11-22-2014 16-04-47

11-22-2014 16-01-54

There are lots more, more about that later.

Posted in dotnetmag, Tip, Visual Studio, vNext | Comments Off

Windows 10 Technical Preview

Since this week Windows 10 is available in a Technical Preview. This version is not for faint harted or inexperience users. Other advice is not to install it on your main computer.

So I did download it and installed it on my Surface Pro 3. I choose not to upgrade my existing version of Windows 8.1. As a result I missed an awful lot of drivers ;-) Luckily I could download them on another laptop. 

10-8-2014 12-37-21 10-8-2014 12-37-42

In the near future there will be a real beta for everyone. This version just scratches the surface on all coming changes.

What did change? If you are still using Windows 7, you probably look at Windows 8 on occasions and found the Startmenu is not there. Well not completely true, in fact your Start menu is now a complete screen. But when using Windows 8 for the first time, it is difficult to use. It looks like they moved all the cheese around.

Windows 8 was built for tablets or laptops/desktops with touch. Windows 7 was perfectly usable with a mouse and keyboard. In fact Windows could be used with just a keyboard. With Windows 8 (and with the introduction of the Surface RT) Touch came as a new dimension.

If you used a Metro or Windows 8 app from the Store, you had to swipe from the right to get to the settings of the app. There Charms bar with the settings of the active app became visible. With the mouse you had to go to the one pixel in the right upper corner of the screen. Or the key combination Windows-key + I of Windows-key + C(harms).

What was the problem? These ways of using Windows were not in our muscle memory and it felt very strange compared to the other versions.

With Windows 10 Microsoft is trying to solve this problem. Windows 8 was mainly made for touch/tablet, Windows 10 is built with the existing/normal desktop user without touch in mind.

And this Technical preview version feels good. Even on a tablet.

A quick tour. The most important change for many the start menu is back. But they tried to improve it too. The live tiles and the pinning capability like on the start screen are added.

Screenshot (5)

The search box is also back. In Windows 8.1 with the Windows-key + Q(uery) combination you could do a search. With this search option is it easier to search for apps. Clicking on ‘All Apps’ gives you the same experience as in Windows 7. You will see the folders of installed x86 apps not from the Windows Store.

On the Taskbar is also a magnifier. With this you can perform a desktop search. But the addition it does not only search for files of apps, but also gives search results from search engines. Which can be pretty handy.

The startmenu can be adjusted in height and width, interessting for a 4K Monitor.

Back to the Windows 8.1 way of working? Also possible. According to some clips on the internet switching between a Start menu and a Start page will be automatic when detaching the keyboard on a Surface. That would be logical and a real handy.

On the taskbar perform a right mouse click and go to properties. On the third tab ‘Start Menu’ change the setting. It will be affective after logging in again.

Screenshot (9) Screenshot (10) 

The Windows key and hardware button show you the Start screen again.

Screenshot (13)  

Another design thingy all windows now have some sort of halo/shadow. The picture below does not show it clearly, but it is funny.

Screenshot (11)

The change which is only noteable when comparing it to Windows 8, all windows now don’t have an edge. The screens below show this, on top Windows 8 and on below Windows 10. It makes it easier for the eyes.

10-8-2014 13-45-13 10-8-2014 13-45-43

Of course the icons are also changed and refreshed. And they cleaned up some useless spacing.

In Windows 8 a Store app / Metro app / Windows 8 app was always full screen. Not anymore, they are now filling up the screen. But you can change the size.

Screenshot (6)Screenshot (7)

The necessity to go to the Charms bar is removed. In the title bar there is a button with three dots (…). With this menu you can go to the settings. That is logic, because an app is not anymore full screen.

The resizing of a Store app is limited to the height. At this moment (?) there is a minimal height for a Windows Store app, the width is not yet is less limited.

In all versions of Windows ALT-TAB is the way to flip through the open apps. The Windows key–TAB was added and the opened applications was show more graphical manner. In Windows 8 this worked too, but the Windows Store apps were not shown. Now they do.

Screenshot (3)

Other news in the black bar ‘Add a Desktop’ is shown. In Windows 10 you can have multiple desktops. On one physical screen you can split your apps and desktops.

Screenshot (1)

In Windows 7/8 desktop with the key combination Windows key+arrow right/left, the active application could be docked to the left of right. Handy to read two documents next to each other. There are just a few possible ways: left, right, full screen, normal.

In Windows 8 metro there were no key combinations and less possibilities. At first there two Windows Store apps side by side and in 8.1 it was changed to 3.

In Windows 10 the screen is divided in 4 quadrants and with the Windows key and the arrows. This is also possible for Windows Store apps, with respect of the minimal height.

Screenshot (4)

The last part of Windows not changed for a very long time; the command prompt. A modern environment but not modern Command prompt. But now the Command prompt is really changed.

Cut/Copy/Paste is now possible with the well-known keystrokes. Selecting of text on the screen is possible. You can make the prompt transparent. Lots of little things we already wanted for decades.

 10-8-2014 13-55-32 10-8-2014 13-56-04 10-8-2014 14-01-21      

We are talking about a Technical Preview, but it feels very stable. The many changes look very good. It is not the end, because some functionality is broken. ALT-F4 does not work for Windows Store apps at this moment. On my Tablet/Laptop Surface it feels very good and natural.

Disclaimer: This post is based on a preview and all items are subject to change in the future.

I love to see the next updates. During the Build conference in April more details and probably a public beta will come.

Posted in dotnetmag, Surface, Windows 10, Windows 8 | Leave a comment