Xamarin

Release 1.0 of XyrohLib,

Release 1.0 of XyrohLib, our multi platform C# interface to a number of common crash reporting and logging services;

– Log file recycles at 1MB or at a customisable int (bytes) value, eg

– Can get full log file path back from Lib

https://github.com/Xyroh/…

Oops – How to fix when you’ve upgraded Visual Studio for Mac / Xamarin iOS and now being forced to upgrade Xcode and to Catalina 😬

What went wrong?

So, here’s the scenario, fire up Visual Studio for the Mac, not enough caffeine in the system, an ‘updates’ box pop up,  a Xamarin iOS update amongst many, you click ok, then instant regret 😟. Why you may ask, an update is good? No? Well not here.  Like many developers I have a reluctance to go to Mac OS Catalina (a lot of changes, and too many issues) and am quite happy in the stable, stable land of Mojave. So what have I done?

In essence I’ve upgraded the version of Xamarin iOS from somewhere in the 12.x range to 13.16. I knew the second I’d upgraded it had gone wrong, but opening a Xamarin iOS / Forms project instantly told me.  My selected version of Xamarin iOS required an Xcode upgrade to 11.x.  Off to the App Store I go, just to confirm, and of course;

UntitledImage

Mojave of course is 10.14, Catalina 10.15, so I have to upgrade right, and lose a day of productivity (or more) with it? Wrong.

The fix

So, the solution, first off come out of Visual Studio for Mac, and then drop to Terminal app.  Execute these commands line by line (entering your admin password when required);

rm -rf ~/Library/MonoTouch
sudo rm -rf /Library/Frameworks/Xamarin.iOS.framework
sudo rm -rf /Developer/MonoTouch
sudo pkgutil --forget com.xamarin.monotouch.pkg
sudo pkgutil --forget com.xamarin.xamarin-ios-build-host.pkg
sudo pkgutil --forget com.xamarin.xamarin.ios.pkg

In the meantime I had downloaded the latest 12.16 release of Xamarin iOS.  For me this is https://dl.xamarin.com/Mo… however your requirements may vary.  Should be as simple as tweaking the download url to suit, you can find 12.x version numbers over here on the Xamarin iOS 12 release notes page.

Once downloaded simply double click and install the package.  Then fire up Visual Studio for Mac and fingers crossed, all worked fine for me.

About me

Andy Flisher is a Mobile App Developer based in the North East of England with over 20 years software development experience. He is available for hire and specialises in cross platform mobile app development, web applications, desktop software, bespoke cloud architecture solutions and providing outsourced project management services.

Xamarin Cross Platform Application Development – Book Review

This is a review of the recently published book “Xamarin Cross Platform Application Development” by Jonathan Peppers.

This book is openly marketed at existing, experienced C# developers so it’s certainly not for beginners, and whilst I don’t fall into this category the nature of projects I work in require mostly ‘linear’ development (Web, PHP, Perl, Python, VB etc over the years) so concepts like MVC, MVVM and in particular IOC (Inversion of Control) are newer and less clear. Thankfully this book has resolved that through it’s excellent practical examples.

One area this book doesn’t touch on hugely is the level of planning required for MVC applications, you can’t just ‘jump in and code’, but that’s potentially a book in itself, but what the book does very well for me, is explain the View, ViewModel, Model and Controller concepts in terms of the classes and data layers required. The book also introduces Interfaces (something I always saw as an unnecessary layer of complexity) which I now ‘get’ in terms of flexibility, and in particular to give the developer options in a cross platform environment.

The icing on the cake is ‘Inversion of Control’, whilst the book doesn’t particularly explain this convention in huge detail, I think it is actually to it’s credit, any more and the reader will be bogged down in unnecessary detail and complexity. It basically gives us the service layer that ‘glues’ the application together, allowing use to create and register our ViewModels as Services and thus make them available to use throughout the app with a single line of code. I’m sure that my description is not hugely more constructive than the words in the book themselves, but the working example of the XamChat application completes it.

Which is my main point, am sure many people work differently, but for me working examples of code are what makes it stick in my mind, it helps it all make sense. Throughout this book you will be building bit buy bit a working chat application, firstly in Xamarin.iOS (but using the all important cross platform and code sharing concepts learnt at the beginning of the book), and then re-implementing the same application logic in Xamarin.Android. The nice touch, which some may see as lazy, was that with the Android example you are taken to a certain point and then left to finish off using the examples you already have. A real, and practical exercise which I think will do the reader good. It wouldn’t be a huge leap further to recreate in Windows Phone, for the ultimate practical extension.

The Xamchat application is then extended through the Windows Azure platform to use their backend for data storage (a good example of how the same Interface can be re-used to store on different platforms), and to implement cross platform push notifications.

Lastly there are chapters on using Xamarin Components (including Xamarin.Mobile for Contacts, Camera and Location functionality), and actual App Store submission and their different processes, processes that even the most experienced developer can struggle with (Apple Certificates and Profile expiry anyone!).

In summary, this is an excellent book for any would be cross platform mobile application developer, yes you need a good understanding of C#, MVC and similar concepts, and the individual mobile platforms and general development processes themselves, and those things don’t come over night, but this book binds it all together with real world examples, working code (a novelty for some books) and actual code and methods you can take away and use in the real world.

Buy it, read it, and take as much as you can from it – “Xamarin Cross Platform Application Development” by Jonathan Peppers

Native App, Hybrid App, or somewhere in between?

I quite often get told “I want an app for my business”, not that they “need” one, they want one, which can often be the wrong place to start, as we’re justifying a want by creating the needs. Underneath it all there are many complex technical considerations and decisions to be made, often by us and trusted by the client, but these considerations come on the back of the business’s “needs” not it’s “wants”, and the app platform, is one of these.

So first off, what is a native app, or what app platforms are there? The lines are grey in the middle, so feel free to disagree with these definitions (happy to engage in the debate!) but broadly we have;

  • Native Apps – In it’s purest sense these are apps written in the native programming language of the mobile device you’re targeting, eg;
    • iOS (iPad and iPhone apps) – Uses Objective C (and now Swift)
    • Android – Uses Java (not Javascript! More on that below)
    • Windows Mobile – C# (pronounced C sharp)
    • Blackberry – Java, however not the same as Android (Pre Blackberry 10), however the latest Blackberry Priv handset is in essence an Android device.
  • Hybrid Apps (With Native UI) – These include platforms such as Xamarin, or Telerik AppBuilder, which is based on C# and F#, but the end result on each device is a ‘Native’ App using Native UI elements so the app feels at home to users on that platform. The end result is these are compiled down to ‘Native Apps’ on the device so often indistinguishable from true Native Apps.
  • Hybrid Apps (With Cross Platform UI) – This is the biggest ‘app’ space at the moment, filled by vendors such as Phonegap / Cordova, Appcelerator Titanium, normally pitched at Web Developers trying to get into the mobile space as it appeals to their existing HTML5 and Javascript skill sets.
  • Web Apps – Not really an app! Not in the mobile sense, but a traditional web site hosted and accessible to all and heavily optimised and responsive for mobile users.

So what are the pros and cons, and which do I need! Well there’s the conversation, but sit down with us for a cup of coffee, or engage with us and we’ll look at your “needs” and help you come to an informed decision, but some points to consider;

  • So you want a mobile friendly, easily accessible, cheap (relatively) way to engage with a mobile audience? On any device, wherever they are connected. – Then consider a mobile optimised website, no need for app stores, or worrying about platform related decisions, just out there.
  • Do you want to engage with the mobile audience? Eg send Push notifications, Know where they are physically located, use the camera, microphone etc? – Then for a good experience you need an App, that has access to the devices hardware, eg GPS, Camera, Microphone. Most Hybrid Apps will allow this, Native Apps without question.
  • Do you want the user to work offline? Ie when no internet connection? – If the app is to work disconnected, without a live internet connection then you are in Native, or Hybrid with Native UI territory. The app will need to read and write to a local database to store your work when disconnected, and then ‘phone home’ when back online, this needs more complex cross platform background services and databases.

Another consideration is user experience, end users engage with their mobile so much these days that functional apps should be second nature, they should pick up your app and start using it, it should be obvious, which is where Native Apps, or Native UI based apps win every day. The best example is deleting a record from a list. On an iOS device you swipe left, and tap delete. On Android it’s press and hold, then Delete. On a Native App, or a framework such as Xamarin which uses the Native App user interface (in fact it uses the same user interface tools as Native Apps so you don’t get any closer!) then that’s what you get, your end user feels at home. Yet on Cordova / Phonegap based apps, which pitch themselves as code once, run everywhere, you have exactly the same user interface and design on Android as you do on iPhone (sounds good, right?), except what you’ve achieved is an interface that all users find confusing, it’s not ‘natural’ on an iPhone, or Android, so your users have to learn to use your App.

tablet mobile app with phone mobile app

So what about the benefits to you, the customer? Well that comes down to price. Using a hypothetical example of an ‘app’ that needs to be on Android and iPhone, downloads user content from a web based Content Management System, that the user can interact and send content back including photos taken within the app, and the app owner can send push notifications based on GPS Location, your year 1 project prices differ as below;

  • If you go fully native, and certainly if you want your app available on more than one platform then you need to write the app twice, once in Objective C for the iPhone, and again in Java for Android apps, near enough double your cost – £9500.
  • A Hybrid, non native Cordova solution will be significantly cheaper, it gets written once, but your user experience suffers, based on the requirements above it’s possible though – £3000
  • Somewhere in the middle, a Hybrid App with a native UI, such as a Xamarin, the back end and core workings of the app only have to be written once, in C# for example, so a considerable development time saving, but the user interface is written individually for each platform using Native tools to get the perfect experience – £5500. The clever ones amongst you will notice that we’ve not mentioned Xamarin Forms, which is the Amber Nectar, negates the need to design the UI for each platform, but still gives the benefit of native UI on each device, if this is appropriate for you (and often is for line of business apps), then the price could drop further to near £4500 suddenly less than half the price but all the benefits

So what’s the conclusion? There isn’t one, the best answer is to engage with your chosen app developer (us we hope!), have a cup of coffee or two and talk through your requirements and come to a sensible conclusion based on your “needs”. What’s more concerning, is for those of you out there that have already had a mobile app commissioned did you have a conversation along the lines of the above? Have you got what you “needed” or what you were given?

I make no pretences that I love Xamarin, more so now they’re backed by Microsoft, be it Xamarin Classic, or Xamarin forms I can offer you and your business incredible value, especially across multiple platforms, but I’m by no means restricted to them (I actually spend the majority of my time working on a Java / Groovy based Android app for tablets). I’m just as happy dropping into true Native technologies, or a quick win with Cordova, but the choice is yours, not mine.

For more information on Mobile App Development please Contact Me

PS: For the avoidance of doubt, anything generated by someone with a ‘mobile apps for bizness’ account costing you about £500, they’re not apps, they are badly hosted websites pretending to be an app (turn airplane mode on your device and start the app, what happens!). The reality is that you won’t get any return on your ‘bargain’ £500 app, you’re just £500 poorer, sorry 🙁

Andy Flisher is a Mobile App Developer based in the North East of England with over 20 years software development experience. He is available for hire and specialises in cross platform mobile app development, web applications, desktop software, bespoke cloud architecture solutions and providing outsourced project management services.

Footnote: Originally written in June 2006 but edited to make more current in January 2019 when republished

Xamarin announce UrhoSharp 3D Framework version 1.8

From: https://blog.xamarin.com/…

Been a while coming but Xamarin have pushed version 1.8 of Urhosharp, the .net binding to the Urho 3D engine.  This allows use across iOS, Android, MacOS and Windows applications.  Looking forward to giving this a play, especially the ARKit and ARCore Augmented Reality options for mobile.

Andy Flisher is a Software Developer based in the North East of England with over 20 years software development experience. He is available for hire and specialises in cross platform mobile app development, web applications, desktop software, bespoke cloud architecture solutions and providing outsourced project management services.