Go Mobile with C# and Xamarin

Download this episode

Download Video

Download captions

Download Captions

Description

The mobile revolution has seen an onslaught of new requirements for modern developers. Apps have to be fast, they have to be everywhere, but they also have to be native - all features that are accounted for in the foundations of .NET. The unique combination of great tools, great language features, and a runtime that excels at surfacing native APIs has brought about a C# Renaissance. This talk will explore how today's mobile landscape plays to the strengths of C#, and will explore the possibilities unlocked by the proliferation of .NET as the best platform for all devices.

For more information, check out this course on Microsoft Virtual Academy:

Tags:

C#, .NET, Android, iOS

Day:

2

Code:

3-653

Room:

Room 3rd Floor Ballroom

Embed

Format

Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image
      ameser

      The course doesn't appear on MVA

    • User profile image
      CaRDiaK

      @ameser: The content might only be available post the conference perhaps.

    • User profile image
      vbullinger

      PLEASE get this video up before Saturday morning!

    • User profile image
      Ron J

      **!! Wrong video. Please post correct content. Thanks

    • User profile image
      Paul Batum

      Its fixed now.

    • User profile image
      Ilias Jennane

      I don't have the iOS designer in VS , is that included in the current version?

    • User profile image
      Hakime

      I find weird that the presenter claims that Objective C is similar to JavaScript, this is totally utterly wrong. Objective C is mostly strongly typed with a few dynamical features.

      You can with Xcode and Clang get code completion for the entire API and similarly Clang will only allow you to give the valid value for a given API, basically the compiler does everything to ensure that you pass the right argument and value type as the code is being written. Then he goes to a bizarre statement that you wouldn't be able to debug Objective C code for some reasons that makes no sense since he seemed confused trying to make any sense.

      I have the feeling that he tried here to over sale his product and just said something completely BS.

    • User profile image
      Andrii

      Could someone post a link to XamarinStore sample app?

    • User profile image
      Andrii
    • User profile image
      atticusalien

      @Hakime: You misunderstood him completely and took his comments out of context. He was referring to the particular CIVignette code when it comes to code completion and debugging.

      You are referring to 27:04 in the video when he said:

      "C# really shines over objective C, because we've strongly typed the API with full code completion for these things. It knows what things you can do and you are only allowed to put the values that are valid. In objective C it's a little bit like javascript, you can throw anything its way and maybe it will work, maybe it won't, it's anybody's guess. It's just a dictionary and you can't really track down bugs, I mean you gotta inspect every single property figure out if you've got the right value, the right constant. So with strongly typing we let the compiler do all this work for you."

      The code he wrote in C# was as follows (with full code completion as he showed):

      var vi = new CIVignette()
      {
      Image = CIImage.FromCGImage(tmp.CGImage),
      Radius = 10,
      Intensity = 2
      };

      To do this same thing in objective-c you have to use a key-value dictionary to specify the "property" values of the CIVignette filter That looks like this:

       CIImage *image = [CIImage imageWithCGImage:tmp];
      
      
      
      CIFilter *filter = [CIFilter filterWithName:@"CIVignette"
      
      keysAndValues:@"image", image,
      
      @"inputRadius", 10,
      
      @"inputIntensity", 2, nil];

      Notice that if you misspelled CIVignette, image, inputRadius or inputIntensity you would have a hard time debugging this code finding the exact member you misspelled. Also, the only way to know what keys are valid would be to look at the CIImage documentation.

       

    • User profile image
      miguel.de.​icaza

      @Hakime, what @atticusalien is what I was getting to.

      In general, many of the Objective-C APIs use the untyped NSDictionary to configure various parameters of the API.    

      There are 475 public APIs in the iOS API that expose NSDictionary as either return values, or parameters.   The keys and the values for these configuration parameters usually require a trip to the documentation.

      Getting the key wrong will make your software not run.   Getting the value of the type wrong might or might not work.  It really depends, you can search bug databases and stackoverflow for examples of both typos causing unexpected behavior in your application.

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.