Extending Xamarin Forms

XamerinFormsPart2

This is Keith’s second part to his earlier session on Introduction to XAML Forms.

Below are my in-session notes:

  • JetBrains dotPeek is a Windows app to help with XAML.  Extremely valuable according to Keith.
  • Demo was in Xamarin Studio (on Mac).  A little more stable than Visual Studio 2015 right now.
  • When starting new project, you have check boxes for target platforms (iOS & Android).
  • UITests projected created for you, by default.
  • Be sure to get latest packages because they’re updated frequently.
  • Creating a new XAML form creates a XAML file and a C# code behind file.
  • Inside XAML <ContentPage>, type in your new controls.
  • He created an Audio Recorder class to record some audio.
  • He’ll be targeting iPhone for this demo.
  • Data binding with BindableProperty type:
    • public static BindableProperty fileNMeProperty = BindableProperty.Create(“FileName”, typeof(string));
    • public string FileName{ get{ return (string)this.GetValue(FileNameProperty);} set{this.SetValue(FileNameProperty, value);}
  • MessagingCenter class lets you communicate between the layers (I presume he means between the code behind layer and the XAML layer).
  • C# code that’s native to the target platform is auto-generated (I think).
  • He built and deployed his demo to his iPhone and recorded his voice.  We didn’t hear the playback, but he swears it played back.  Don’t worry, we trust you Keith. 🙂
  • He created a “renderer” for a platform specific feature (>> on list items on iOS).  It will not fail on other platforms, it just won’t show it.

Introduction to Xamarin

CodeStock 2015 is the biggest CodeStock, by almost double this years hosted at the Knoxville World’s Fair park Convention Center.  It’s our first year having it at this convention center.  Below are my notes on the intro to Xamarin Forms session.

Xamarin is a cross platform development tool to let you write mobile apps once and deploy to Android, iOS, or Windows Phone.  It’s not from Microsoft, but it’s a .Net platform that allows you to write  your code in C# (and now supports F#).  Below are my in-session notes.

IMG_20150711_105821

 

  • Xamarin FORMS adds shared UI Code (this is new) – No more platform specific.
  • Xamerin has been around since 2000, so not a new or fly by night company.
  • They negotiate on pricing.
  • You have to pay TWICE if you want BOTH iOS And Android. UGH!
  • Xamerin forms is only for Enterprise. DOUBLE UGH!
  • Mac is required for iOS. TRIPPLE UGH!
  • Cloud testing available
    • Automatically test your app on hundreds of mobile devices. Select what to test on. They have a room in Europ filled with hundreds of phones and tablets.
    • Captures screen shots, etc…
  • Xamarin University – $1,995 per developer – Instructor live training. Free for a month right now – but there’s a catch. Only 2 of the courses are available
    • intro – what we’re about
    • and very first one (how to use it)
  • Paid gives you 3 months access to business tier – because you need it to go through the training.
  • Not only can you use C#, but you can also use F#.
  • You HAVE to know the specifics of each platform (iOS & Android)
  • Tools
    • Xamarin Studio (PC or Mac)
    • Visual Studio plugin for VS 2010 and higher (requires biz or enterprise or starter, just not indie)
  • If you want to build for Windows Phone, you have to have Visual Studio.
  • Xamarin Studio doesn’t support iOS
  • VS supports both iOS and Android
  • Xamarin Android Player (emulator) faster than Google’s. Runs on Windows & OSX
  • They have a few images (Lollipop image is available)
  • Doesn’t work well with Windows Phone emulator.
  • Xamarin supports Android Wear, Apple Watch, & Microsoft Band
  • about 90% of code can be shared across platforms
  • PCL = Portable Class Libraries used for the “core” code in multi-platform applications.
  • About 80% of a Xamarin Forms app will be located here.
  • Rosylin compiler already supported in Xamarin.
  • Xamarin Forms
    • Xamarin UI controls are an abstraction above each platform’s native controls, but compile down to platform specific controls. Provides a native experience on each platform.
    • Layouts are common screen layouts that you can choose from.
    • Yes, you can nest layouts in them.
    • Forms made with XAML. — MVVM as a result.
    • Can also do it with code.
    • Extensibility
      • Can embed custom views anywhere.
      • Call platform APIs via shared services.
      • You can go full native API if you want (kind of defeats the purpose of using Xamarin though)
  • Custom Renderers
    • You can override a renderer for a specific platform.
  • Xamarin Forms
    • Reflection will be a problem on iOS because there’s no runtime on iOS.
    • App Quality control
    • Xamarin Insights
      • Real time monitoring, track crashes, know of user problems before they report, get user’s e-mail address, etc…

 

Understanding the Android App Store: ArsTechnica.com doesn’t understand it nor risk vs freedom

imageIn this story on ArsTechnica.com, I find it funny, annoying, and pointless that people point out that there are some malware apps in the Google Android app store. The Google app store (now called “Google Play”) is nothing more than a consolidated place for apps that would otherwise be available on the creator’s on web sites. But, unlike the web, Google can and does take down apps that are proven to be malicious. Just like on Windows, it’s the user’s responsibility to not download junk from sources they don’t trust and to use common sense. It’s the difference between freedom on an open system vs. a closed system. With freedom, there are risks. With a walled garden, there are fewer risks (not zero), but much less freedom. Each has its own merits and no one can be blamed for which they choose. I personally choose freedom. I’m a big boy and I’m educated and can manage my own risks. But that’s just me.

Click here to follow me on Google+.

Follow me on Twitter @CSharpner.

See also:  Understanding what Android actually IS

Take this quote from the ArsTechnica.com story:

“The apps, which were reported here by McAfee researcher Carlos Castillo, masqueraded as video players offering trailers of Android games and anime content. In the background and without warning, they also obtained the phone number and a unique identifier of the infected device and sent the information in clear text to a remote server under the control of the software developers”

Whenever you install an Android app, you’re given a list of the phone’s data and features the app is requesting access to from the OS. So, I call bull sh!t on “and without warning”. If you’re downloading a video player and the app store says it asks for access to your contacts, you simply refuse to let the app be installed. I have refused the installation of several apps based on this simple logic — apps whose function has nothing to do with what it’s requesting access to. Simple. BTW, the “unique identifier” is normal for all apps that have ads to support them. Not much different than a web site getting your IP address or a Windows/Mac/Linux desktop app that sends your MAC address and/or other hardware IDs, but unlike Windows/Mac/Linux desktop apps, Android apps can’t be installed without you being told, point blank and openly, what they’re requesting access to from the OS.

Pointing out that there are malicious Android apps is no more relevant than pointing out there are malicious Windows apps or malicious Mac apps or malicious Linux desktop apps. Yep. We know that. That’s the price of freedom — risk. And, for people that “don’t know any better”… I call BS on that too since the app store shows you what any Android app you’re about to install is requesting access to. It’s usually a very small list and takes only seconds to see and decide. I have no pity for morons that blindly click “Allow” and neither should you. If you’re intelligent enough to read and install an app, you’re smart enough to decide if a video player should have access to your contacts.  Hint:  The answer is “NO!”

Click here to follow me on Google+.

Follow me on Twitter @CSharpner.

See these images?

imageimage

You’ll find an actual working versions of them at the top and bottom of this article. Please click the appropriate buttons in it to let your friends know about this article.

Check back later for updates too!