Showing posts with label portable class libraries. Show all posts
Showing posts with label portable class libraries. Show all posts

Friday, November 1, 2013

October 2013, What a month this has been...

October is about to pass. But what an amazing months it has been...

The greatest skill a developer has to have is to adjust within a group of people. Believe me, this is even difficult than developing a technical skill. Interpersonal communication is a craft and one needs to master it in order to better survive for selling the ideas. Since we are in the business of consulting for software services, we need to move between organizations every few months and years. Not all the people are welcoming, they have different psychologies and motivations. These events prove to be a practice. You need to go to the venue, introduce yourself, present in the presence of total strangers - you have no idea about their backgrounds.

Few Advices & Lessons Learned
Humor is an interpersonal lubricant. Since we are interacting with the audience for the first time, we need to break the barrier of being strange. Humor is the universal lubrication of friction between people. You are never strange for the people who smile with you. Although this is the most effective technique, but this can go either way. You need to pull off the joke really well. Like an actor, the punch line has to be effective. Practice it, tell it a few times to your friends no matter how annoying they become.

One must go through the session material before the session. I have realized that we try to be very detail oriented when are creating slides for our presentation. These conferences and code camps are not class room sessions. People are interested in links and ideas they can take home. This give them direction for their technical development. We need to give them as much as possible in the limited time we have. But the most important thing is to motivate them enough about the stuff that they study further after the event. We need to be fresh for the event, so take a nap before the event.

We can also record the session if possible. This is one of the take away item for yourself. A recorded session can be useful for preparing yourself if you are speaking about the same stuff later on. This is specially useful if you have been away focusing on some other technological stuff for a few months. You can also publish them for general audience if you think this might help them learning about the topic.

We must time box our session. A session has a list of agenda items. We need to make sure that we time box the agenda so that we are able to cover each item and still be able to finish our session in time. If there is an item which is taking more time, tell about some pointers the audience might take away with them. We must also be ourselves, confident and to the point. Call your family or friend for a little chit chat in the morning.

Session Slides
I have presented my thoughts and ideas over two areas from a huge list of Microsoft technology stack. They are as follows:
  1. Cross Platform Development using Portable Class Libraries
  2. Event Source API, ETW and Semantic Logging Application Block
I have uploaded the session slides on my sky drive. You can view it here or download it if you want to view them offline.



Session Videos
Here are the session videos from the events in Silicon Valley, Boston and Southwest Florida Code camps.

semanticLogs from Muhammad Siddiqi on Vimeo.


Portable Class Libraries - Boston Codecamp 20 from Muhammad Siddiqi on Vimeo.


slab from Muhammad Siddiqi on Vimeo.


Cross Platform Development with Portable Class Libraries from Muhammad Siddiqi on Vimeo.

Download Code
You can also download the code from these sessions. I even uploaded that to my sky drive.

Wednesday, October 30, 2013

Adding PCL Reference to Mono Touch and Mono for Android Applications

October has been a fun month. I got to travel across the country to three different places, met with amazing people and shared the common enthusiasm about technology. It's like our souls know each others. Code camps are opportunities for learning for everyone; including presenters and attendees. For one, presenters in one session like to go to other sessions as attendees, the other is, when they are asked thought provoking questions covered with practical problems of the individual developers. Most of the times, it makes the presenter think about the specialized area; it makes them see it in a different perspective.

I am planning a separate post about the experiences about the October. I think this would be a good idea to discuss some questions on the blog. Let's discuss first question in this post. The question is:

Can we add PCL references in Montouch and Mono for Android applications?

The short answer is Yes; and we can also do that in Visual Studio. I have Xamarin Starter edition installed on my machine. It also includes a trial version of Visual Studio extension for Xamarin tools.

Xamarin Studio
Here I have a sample solution called NameReflectorApp. It has a portable class library project Xamarin.Core. It also has an android application project NameReflectorApp.Android.



The portable class library project is targeting a number of frameworks as shown below:



This is targeting Profile 158 of .net portable subset. There are still some issues with Xamarin Studio like you see a warning message at the bottom of the target frameworks. But don't worry, this should still work. We cannot see here Mono for Android as one of the target frameworks but we can still add such references. In Xamarin's term, this is called Edit References, funny...



Visual Studio Support
Xamarin has support for Visual Studio. But this is not available for all the editions. Generally speaking, it is available for more expensive ones. But we can still play with the extension during the trial period available when we install the starter edition. The best thing is we can decide when we want to start the trial period. We can use this option to first familiarize ourselves with the technology and when we need to see how well it integrates with our current Microsoft technologies, we can start the trial period.



Visual Studio is not as forgiving in adding references in such case. There are issues with the Xamarin's Visual Studio extension. As we add our portable class library's reference to Android application, it shows up the following error dialog.



Xamarin developer community terms this situation as a lie. In order to fix this, we need to use some xml hack. I would totally recommend the following post where we discussed how we can add additional frameworks options for Portable Class Library projects.



As we discussed in the above post, we can add options for additional target frameworks by adding files the Supported Frameworks folder for a target profile. Let's add two new Xml files to our selected profile as follows:



The contents of these files are as follows:

After adding the above files, we need to restart Visual Studio. After that, as we go to the PCL's property page, we see that there are already Xamarin.iOS and Xamarin.Android in the target framework list. If we hit Change button, we see additional options for Xamrin.iOS and Xamarin.Android. These options are checked.



Adding the reference to the Android application project goes through just fine. Here is the portable library's reference added to the project's references list.



If you have Xamarin Studio running then restart this and open the same solution again. You can see that these new frameworks are also available in Xamarin, which is amazing.



Download



Thursday, October 10, 2013

VS2013 RC: Portable Class Libraries Target Frameworks

In this post we are going to discuss the changes in target framework selections in Visual Studio 2013 RC. Up until, Visual Studio 2012, Visual Studio has supported the following framework selections:
  1. .Net framework 4.0, 4.0.3 & 4.5
  2. Silverlight 4 & 5
  3. Windows Phone 7.x & 8.0
  4. Windows Store Apps
  5. Xbox 360
With Visual Studio 2013 RC, now Portable Class Libraries can also support targeting .net framework 4.5.1 and Windows Store Apps (Windows 8.1). But Visual Studio 2013 has mainly reduced other target frameworks for PCL. The following is the list of frameworks which are not supported in Visual Studio 2013 for PCL development.
  1. Silverlight 4
  2. Windows Phone 7.x
  3. Xbox 360


Supported Framework Xml Changes
In order to support a combination of target frameworks for PCLs, Visual Studio keeps a list of xml documents in Supported framework folders for each profile. Actually, a profile is selected based on target framework selection matching the profile.



Now we can develop PCLs in three different versions of Visual Studio. They are Visual Studio 2010 SP1, 2012 and 2013 RC. It appears that in order to limit target frameworks for PCL development in Visual Studio 2013 RC there are some changes in the Xml schema for these documents. Let's see the document for Silverlight 4 in Profile44 in Visual Studio 2012.


Visual Studio 2013 has added a few new attributes. They are FamilyName, MinimumVisualStudioVersion and MaximumVisualStudioVersion. We must remember that the version of Visual Studio 2012 and 2013 RC are 11.x and 12.x respectivly.


The above is the Xml document for Silverlight 4 in the Supported Framework folder in the same profile after the installation of Visual Studio 2013 RC. We can notice that the maximum version for the framework is "11.0", so the framework is not supported in Visual Studio 2013 RC. Below is the framework xml for Windows Store apps (Windows 8.1) in \v4.6\Profile\Profile44\SupportedFrameworks folder. From the xml document, we can clearly figure out that this profile can only be used for a Visual Studio version 2013 RC at minimum.


Converting Project for Unsupported Frameworks
Opening a PCL project in Visual Studio can convert the target frameworks to one of the supported frameworks. A Silverlight4 project is converted to Silverlight5 project.



We can opt to not migrate the project to a new framework version but we wouldn't be able to work on it in Visual Studio 2013 RC then. The project is shown in Solution Explorer as follows:



There seems to be a bug in the current version, which shows the following error message if we don't opt to convert, by not checking the check box. It is shown as follows:

Wednesday, October 9, 2013

Silicon Valley Code Camp 2013 Session Material

It was a great experience speaking at Silicon Valley Codecamp this year. As promised, here is the recording of my session.

Cross Platform Development with Portable Class Libraries from Muhammad Siddiqi on Vimeo.

This is the slide deck from my session:



You can get the code from my sky drive. Here is the download link:



Following, you can see further details about the event and sessions. You can also evaluate the session.

Sunday, March 10, 2013

Boston Code Camp 19 - Mar 2013

Thanks for attending my session in Boston Code camp on March 2013, if you did. Here are the slides:


You always meet the most amazing people in such events. This time I had the same pleasure of interacting and discussing about the how technology is shaping up specially Microsoft stack of technologies.


Me with Julie Larmen

This time I also tried walking a bit around town. Here are some beautiful pictures. Unfortunately, the battery died down, otherwise, I was planning to have the whole catalog here [I mean my cell phone's battery :) (not mine)]