Wednesday, February 27, 2013

More InPurgeable fixes - Steve Dunford is on fire!

The latest fix is for drawables - https://github.com/slodge/MvvmCross/pull/177/files

This fix is not likely to effect you much unless you used BIG images in your drawables.

No badge this time... sorry ;)

But you get to see Greg Broadmore's awesome art again


Tuesday, February 26, 2013

HUGE ANDROID MEMORY BUG - and bug hunting badge of awesomeness #2 to Steve Dunford

I received a really small but important bugfix today, containing:

new BitmapFactory.Options() {InPurgeable = true};

See https://github.com/steveydee82/MvvmCross/commit/460f71ed323b0b64386408341097de3b0c82987d

This bugfix is awesome and really very very important!



Without it, Android's Bitmap engine can fill up your device's RAM and will never give it back.

You can read about the inPurgeable and other options on http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html

For heroic work in hunting down this 'leak' ... and for this awesome bugfix, Steve Dunford, we salute you and reward you with our highest honour - a second Badge of Awesomeness:



Also a special note of thanks also to Greg Broadmore for permission to use his fabulous Bug Hunter picture - http://www.gregbroadmore.com/imgpg.php?page=126

Monday, February 25, 2013

MvvmCross v3 - the documentation plan....

For 'Hot Tuna' I'm planning to make much better documentation....

It's not written yet, but below are the headings for what I'm currently planning.

No idea when I'm going to get it all done - but will try. I may also try crowdsourcing these docs - not sure yet....

Anyone got any opinions on this? Please share them via comments or via the normal channels...


Behaviors for Windows 8 WinRT Store Applications - Nuget goodness and a Belgian Badge of Awesomeness

From StackOverflow yesterday I found an answer from :
If you are looking for behaviors in WinRT with MvvmCross, you can now use the Windows.UI.Interactivity nuget package for it (https://nuget.org/packages/Windows.UI.Interactivity).


When using it with MvvmCross, I made a copy with some small alterations to the existing MvxEventToCommand class (inherit from TriggerAction(FrameworkElement) instead of TriggerAction(DependencyObject)). Works like a charm.

This is excellent news - it's going to save me from so much ugly code behind work :)

Definitely awesome - and it bags GitteTitter a WinRT-flavoured MvvmCross Badge of Awesomeness - thanks!

(Sorry - I couldn't find any slick chips+mayonnaise clipart to make the look more Belgian!)

Thursday, February 21, 2013

MvvmCross Rocks - MVP Edition - Daniel bags badge #2

Right now the annual Microsoft Valued Professional Summit is happening at Microsoft's HQ in Redmond - #mvp13 or #mvpSummit

It's all very hush hush.

DNA has been taken, Irises have been scanned, Lawyers are briefed, Guns are pointed at Puppies - so no-one's saying much about what they see there.

However....

The odd very pleasant rumbling noise is coming out of Redmond



Behind closed doors, our friend @dsplaisted has clearly been spreading the love - and the wisdom - behind MvvmCross. Excellent!

Thanks Daniel - that is awesome!

Also really awesome some of the things Daniel's let slip this week - it turns out that the Microsoft dev teams *love* the MVP summit week - it's something they look forwards to every year. It's really fab to hear that!

All this, plus shipping some fab portable HttpClient code this week.... It's all definitely deserving of a second Badge Of Awesomeness - and this one is a special NDA edition ;)



Wednesday, February 20, 2013

1er Placa de Impresionante - MvvmCross Espanol!

Gracias a Juan M Gómez - http://geeks.ms/blogs/jmgomez

An introduction to MvvmCross in Spanish - how awesome is that!


A pleasure to award the very first....

MvvmCross Placa de Impresionante!


Monday, February 18, 2013

Saturday, February 16, 2013

An MvvmCross powered app for New Zealand coastguard weather and tide reporting

This app is iOS only for now - but built from the ground up using Test Driven Development and designed for portability and future platforms - https://itunes.apple.com/gb/app/coastguard/id584112438?mt=8



A MonoTouch AccordionView

One of my clients at Cirrious is CloudZync - they're an amazing startup with solid investment backing, some exciting lead customers and some really fun and relevant tech to work on.

They're also hiring....


As part of the work we've done for them, we ported an extended an AccordionView to MonoTouch - and they're very happy to contribute this back to the community.

You can play with this on https://github.com/slodge/MonoTouch.AccordionView

Hope you enjoy it.



If you spot any bugs or improvement, please do let us know :)




Somewhat shockingly... currently there are no bindings for MvvmCross - but hopefully one of us will add them soon :)

Friday, February 15, 2013

Android TextView Color Binding

Not sure how I've never included any example of this in the source before - I use this sort of thing all the time!


A PCL Version of TinyIoC - awesome!

I've just received an email about a new TinyIoC fork that's ready for use inside Portable Class Library.

This is completely awesome - especially after some of the recent discussions about v3 and SimpleIoC, OpenNetCFIoC, etc.

The world is going Portable :)

The fork is on https://github.com/mgernand/TinyIoC - it's not quite perfect yet as there are a couple of tests still to go green - but it's almost there :)

Awesome stuff - love it - and it's a pleasure to give @mgernand  a Badge Of Awesomeness for the contribution!


Recap on 'what are AutoViews?'

There are a couple of blog posts on AutoViews available - but not that much info.


To try to help, here's a practical guide to what works today... All of this is based on the sample in http://slodge.blogspot.co.uk/2013/02/recap-on-what-are-autoviews.html



To add AutoViews:

You can use ViewModels in Droid and Touch only, although we do have some work in WP slowly underway.

If you want to use AutoViews, you have to add some more assembly references and a little bit more setup code.

After that, you can then provide AutoView definitions by a few routes...



AutoViews from C# in your ViewModels:
 
In each ViewModel you can add the IMvxAutoListViewModel interface and can then declare whether each ViewModel is a List or a Dialog, and you can also declare a Menu

See two examples of this:

AutoViews from JSON in EmbeddedResource files

In the ViewModel project, you can include AutoView JSON files - in a location found by convention.

See two examples of this in - https://github.com/slodge/MvvmCross/tree/vnext/Sample%20-%20CustomerManagement/CustomerManagement%20-%20AutoViews/CustomerManagement/ViewModels/AutoViews


AutoViews from JSON in Content/Assets in your UI
In you UI projects you can override the JSON files in the ViewModel projects.


For example, see https://github.com/slodge/MvvmCross/blob/vnext/Sample%20-%20CustomerManagement/CustomerManagement%20-%20AutoViews/CustomerManagement.Droid/Assets/DefaultViews/NewCustomerViewModel/Dialog.json


What MvvmCross does with AutoView definitions...
 
At runtime, when the framework navigates to a ViewModel, then the framework:

  • loads a normal View if one exists (a normal view always beats an AutoView)
  • loads a View-project based AutoView if one exists
  • then goes looking for an AutoView in the Core project - looking for either Json or for that IMvxAutoListViewModel inteface.
  • if it finds nothing, then the UI can also use Reflection to guess a Dialog to show... but this is normally really very basic - just shows UITextFields for string properties and UIButtons for ICommands


Why?

My first attempt at this code is mainly for rapid prototyping - for Sketchflow-level coding

But later on...  maybe apps can actually use this for some or all screens...


Next steps?

We will make Dialog's for WP and WinRT one day soon (one day...)

We also want to extend the AutoView idea to Tabbed/Pivot pages - and maybe to Dialog's too.

Beyond that.... who knows? :)



I don't get it - show me some sample code...

Sure - the working sample is in:

Thursday, February 14, 2013

Love Beautiful Animated Interfaces on Android

Needs no introduction....


http://blog.neteril.org/
http://blog.neteril.org/
http://blog.neteril.org/
http://blog.neteril.org/
http://blog.neteril.org/
http://blog.neteril.org/

Binding to Android's Horizontal Pager - Awesome!

Another awesome contribution!

This time from Steve Dunford and the Cross Platform app development team working inside SequenceAgency on some really awesome projects.

They've taken binding code from MvvmCross and inspiration from @CheeseBaron's HorizontalListView and combined them with the Android v3 HorizontalPager in order to provide  a new implementation for fast fluid horizontal paging. Code is provided as MS-PL - so expect to see this integrated back into v3 :)

Thanks for contributing back to the project - totally awesome - a badge of awesomeness well deserved!



The code is here:

Android DatePicker and TimePicker binding - it's Awesome!

Following on from a StackOverflow question a couple of days ago, eMi- has released a new repo - https://github.com/eMi-/mvvmcross_datepicker_timepicker/

This provides the custom Droid View classes and all the instructions you need to use the code.

It's  awesome - and its Creative Commons licensed to it can be included in v3 :)

A pleasure to award Badge of Awesomeness Number #12 to eMi-



P.S. Yes, he really is that young and yes, I really do feel that old now!

"I want my MvvmCross app to start differently on Droid"

 I got asked this by email... please don't ask things by email - please ask by http://stackoverflow.com/questions/tagged/mvvmcross - thanks :)

If you want your app to start differently... then just use a different start interface.

For example, your app could register an interface and startup object like:


Then each platform could just call GetService for this interface and can choose it's own startup path....

Wednesday, February 13, 2013

A second take on Constructor Injection IoC in MvvmCross - and a Badge of Awesomeness

Received this today - fab contribution from @Asudbury

By changing some of the OpenNetCf IoC files (by removing some of the changes I made!), Adrian's managed to get 'proper' IoC working - i.e. he's using code that has constructors like:

        ///

        /// Initializes a new instance of the class.
        ///

        /// The service.
        /// The translator.
        [MvxOpenNetCfInjectionAttribute]
        public LoginModel(
            IAuthenticationService service,
            ITranslator translator)
        {
            this.service = service;
            this.translator = translator;
        }

This isn't the only way to do this sort of thing - I know that someone else has also got TinyIoC working really cleanly - using some techniques built around http://slodge.blogspot.co.uk/2013/01/navigating-between-viewmodels-by-more.html - hopefully will share that with you soon too.

The code changes from Adrian are in the attached gist....
But in the meantime... Adrian - thanks - a badge of awesomeness is your's :)


Tuesday, February 12, 2013

Open Source Contribution Etiquette Part II

As the current maintainer of MvvmCross, in the last 7 days I've had contacts via email, GitHub and forum private messaging and Skype from 8 separate individuals who've been looking to contribute.

This is awesome - really it is totally awesome - they've all been lovely and I love it.

Please don't stop!

And please don't have any doubt that I'm very open to people contributing....

If you have any ideas then get in touch via any of the mechanisms on http://slodge.blogspot.co.uk/p/if-youve-got-questions.html - if your contribution is good, you might even get a badge :)

However...

.... please also consider that I'm human, you're not the only user, I'm doing work for free, I care about my work passionately, and that I'm trying to find time to earn a living, write v3 and have a life too....

------

A few year's back Miguel posted about Open Source Contribution Etiquette

It's a post about trying to make sure that any code you submit as a patch fits well within the project you are contributing to.

-----

As some of you know, I'm not the best at sticking to that rule ... it's not my fault, it's resharper's ... sorry!

-----

However... it's not just about code formatting - there are some other important points that I think it's worth considering when you start contributing to an open source project.

In particular, please do try to have some empathy for the person who is maintaining the project - as Miguel said:
The maintainer is in for the long-haul, and has been working on this code for longer than you have. Chances are, he will keep doing this even after you have long moved into your next project. 

In particular, some of the things I'd ask you to consider are:
  • If the maintainer asks you to contact them via some mechanism then please try to do it - e.g. if they ask you to contact them via GitHub issues instead of Email, then please do not keep sending them emails. And if they then ask a second time, please do not then switch to sending them messages by Skype...
  • Consider that the maintainer owns the project and has final say:
    • They might have plans or dreams which conflict with your immediate requirements - in which case please respect that and find some other way forwards.
    • They should justify their decisions - but they don't deserve to be dragged into drawn out debates on issues - they can ask you to walk away, and you should
    • They can ask you to justify your decisions - and they can drag you into whatever level of justification they choose to - if this is too much, you can, of course, walk away
  • Relationships take time - you can and should always try to be courteous, but respect takes longer to build.
    • The maintainer has probably already earned some respect from you - after all, you want to use and contribute to their work.
    • If this is the first time the maintainer has heard from you, then don't expect respect from them - respect is like that - you have to earn it.
    • Be careful with what you say you are going to deliver - if you criticise a piece of the existing project, say you'll deliver something to fix it, but don't... then don't expect the maintainer to show you much respect when you move on to start criticising something else.
    • Consider that maintainers are often donating large chunks of their time to the project, that they may have other work and/or family matters to attend to; and that they may have recently had to deal with other contributors who did not contribute very well... so those other factors will influence how they deal with your request.
  • Constructive criticism is useful, but constructive action is better - sending criticism of lack of versioning, lack of unit tests, lack of documentation isn't as good as helping make a new build system, a new unit test, or some new documents.
  • The maintainer no doubt has a list of other priorities on his/her list - and those priorities may mean your current contribution is not welcome right now. If that's the case, try to be patient...
  • For whatever reason, if the maintainer says the time's not right for them to accept a contribution, then you should respect that.
  • Solutions to real problems and demonstrable advantages win over possible solutions to possible problems and vague promises of future benefits.
    • If you can show why your changes improve things now, then they can understand why it's worth doing.
    • But if you send them a patch telling them that this will enable something amazing next time, then they have every right to ignore you until next time.
  • Consider that maintainers sometimes want to work on their own project - there are interesting puzzles to solve and things to learn - maintainers love to get inputs but sometimes you also need to give the maintainer space to enjoy their own project too.
  • Regardless of who you are, IMO the best way to push changes into a project is to push small changes - these are easy for both you and the maintainer to qualify, to quality assure and to understand.
  • I understand, though, that sometimes bigger changes are needed, and that sometimes the only way to find out if things will work is to build a prototype - I totally 100% understand that's the way code is sometimes.

    If this is the case and you do need to make bigger changes, consider:
    • If there is any way to make these additions externally to the project - using an add-on pack of some description.
    • If there is some way you can make these change more slowly:
      • Whether you could work on building up a relationship with the maintainer before flooding them with new code
         
      • Whether you could ask about those changes before making them...
      • Whether you could make those changed by forking
  • Coders (Maintainers and contributors):
    • are all mainly lovely - so you can normally talk before making huge changes.
    • are all mainly ass-holes - we are often stubborn ego-driven psychopaths - we all know that no-one else on the planet understands problemX as well as we do. We all have to live with this - Apple, Microsoft, Facebook would never have happened if Steve, Bill and Mark weren't so special ;)
  • Maintainers have the upper hand and the final say
    • they have put in the hard graft and deserve some additional courteousy as a result
    • if a maintainer says 'no' you can query that once... but if you continue to query a point then the chances are you're going to get nowhere except burning up valuable time and getting deeper entrenched into argument... so stop arguing and find another way forwards independently.
  • Contributors aren't slaves - they have other options:
    • if a maintainer says 'no' you can still publish your changes - that's what the OSS licenses allow for.
    • this may not be perfect - it may not be what you want - but it may be what you need - http://www.youtube.com/watch?v=OagFIQMs1tw
  • No decision is final - if you fork today, then there are always ways of merging forks back together again later.
  • Forking isn't necessarily a bad thing - evolution is good. (IMO)
  • If you really need something then you can sometimes offer to pay for the maintainer to assist - but be very careful about how you ask that question!

Note that this isn't a one-way street - maintainers shouldn't be jerks - see http://lostechies.com/derickbailey/2012/12/14/dear-open-source-project-leader-quit-being-a-jerk/ for some very sage advice for maintainers!

----

Note also that you shouldn't listen to me....

I've broken the etiquette rules and been very, very naughty in my open source contributions.

If you don't believe me, take a look at what I did what Resharper did to MonoTouch.Dialog within MvvmCross!

----

Now, back to the code....

F5 ;)

MvvmCross on the Tablet Show

I suspect most of you have already seen this...

If not, then you can get an hour of me talking rubbish and sounding like Donald Trump on http://bit.ly/mvxTabShow


For direct to MP3 try - http://bit.ly/mvxTabMp3

GitHub Badge

How's this look?




Get your's at http://githubbadge.appspot.com

P.S. No idea when I last worked on Python... but GitHub never lies ;)

Sunday, February 10, 2013

MvvmCross v3

What is v3?

v3 will be the most ambitious MvvmCross release to date.

For v3, my mission is to continue…

Native, Cross-Platform, Portable, Reusable C# delight for all.




Is it v3 or VeeThree?

It's pronounced Veeeeeeeeeee-Threeeeeeeeeee





What is MvvmCross?

It’s a cross-platform framework for efficiently and effectively developing delightful C# apps.

So far, MvvmCross has evolved through:

v0
Dec 2011
  • Interface-Driven Development
  • Shared ViewModel-based architectures
  • Available on Windows Phone, MonoTouch and MonoDroid
v1
Mar 2012
  • Data-binding layer added
  • MonoTouch.Dialog support
  • Samples and tutorials
  • Cross-Platform APIs for features like Camera and Location
vNext
Oct 2012
  • Portable Class Libraries
  • Plugins for Cross-Platform APIs
  • WinRT added.
  • MonoDroid.Dialog support.
Iterations
...
  • WPF added
  • Additional Plugins – like Sphero
  • ‘Swiss’ bindings
  • Initial AutoViews added



How has this happened?

Throughout the last 15 months I've been very lucky to have had:
  • wonderful customers;
  • skillful co-coders who continue to teach me so much;
  • a small number of utterly awesome contributors;
  • very thoughtful issues, problems and questions logged, discussed and resolved;
  • superb tools to work with - especially from Microsoft and Xamarin.
  • some donor sponsors - JetBrains (Resharper); PixelCut (PaintCodeApp); Infragistics (NetAdvantage); Microsoft (BizSpark); Nokia (Lumia)

Thanks to all!




What is V3?

All of the feedback I've had from the users of v1 and vNext have helped me shape the requirements and features that will be at the beating beautiful heart of v3.

They are:
  • Add Mono.Mac and Xamarin.Mac platforms
  • Add high quality documentation
  • Enable MvvmCross Plugins to be easily used by non-MvvmCross and non-Mvvm code.
  • Enable other Mvvm platforms to use the MvvmCross data-binding layers
  • Improve all platforms:
    • On Android, we will extend support for Android 3 and 4 features – it’s time for Android to move Android on from Gingerbread!
    • On Touch, we will provide better integration with existing developer workflows including both XIB and Storyboard workflows
    • On Windows Phone and RT, we will look for better designer and Design-Time data support, plus we’ll provide additional Live Tile and background service samples.
    • For Unit-Testing to provide additional helper classes so that tests can be written and maintained more efficiently
  • Make the MvvmCross APIs cleaner, simpler, easier to use and easier to extend
  • Extend Swiss Binding further - remove the dependency on JSON.Net (I'll still *love* JSON.Net, but you'll no longer have to share that love)
  • Consider using WeakReferences in Bindings
  • Tackle some key known open issues –including the infamous Heizenbugs
  • Make the MvvmCross ecosystem simple to navigate – making it easier for users to find 3rd party plugins and extensions.
  • To be NuGet ready – even if NuGet isn’t ready for all the MvvmCross platforms

Beyond these, there’s one big other goal I’d also like to add:
  • Async/await on all platforms
However, currently I’m not sure if this is going to be possible within the near-term timeline of V3 – it depends on external releases and on how things just generally fit together.


Beyond that, there are other things I’d like to achieve – like adding a CrossGraphics plugin, perhaps adding Tombstoning support, perhaps adding a showcase app sample, perhaps providing more Android service examples, etc, etc, etc, etc, etc, etc - but with time short all those can come in iterations beyond v3 if they don't make the cut.





So should I use vNext today?

Yes :)

If you write your existing apps today targeting vNext, then v3 will feel very familiar. It will continue with:
  • interface driven development,
  • portable class libraries for sharing code
  • plugins for the times where platform abstractions are needed
  • using INotifyPropertyChanged-based Mvvm to maximize code share
So, if you start on an app using the stable vNext code base today, then you will be in a great position to leverage v3, with only the need to make small adjustments to shift to v3. To switch you should only need to perform relatively simple tasks like changing some base class names; adjusting some of the namespace names you are using; and perhaps shifting some code between generics and non-generics.





I like the pain of working with Beta code. Can I use v3 today?

Not today... today the code is pre-Alpha and changing very quickly...

... but I will blog details of in-progress v3 changes very soon :)





When will this happen?

I’m working on v3 now.

It’s ‘spare time’ work only for now - and work commitments are doing their best to reduce that time.

However, I expect customers and partners to start being able to use versions of v3 almost from the start – so I expect to be committing the source and blogging about the changes in the coming weeks – and I expect to recommend v3 as the stable platform sometime in the next 3 months.





When is v4 arriving?

I’ve no concrete plans for v4… and no roadmap in my head beyond v3.
Just as with vNext, after the v3 release we can continue to easily add small iterations … so I’m hopeful that v3 will be followed by much smaller releases (commits), each one adding new features without any significant breaking changes.

I’m 100%  sure:
  • MvvmCross will be driven by its use - both in my projects and in your's
  • The future will surprise us all!




Can YOU help?

Yes.
  • as long as you can agree to contribute under MvvmCross’ Ms-PL license.
  • as long as you can put up with @slodge OCD…
There’s lots to do - including thinking, coding, sample authoring, idea and issue logging, testing, documentation writing and beyond.
 Some significant code changes are already underway now. If there’s some way you want to help, please don’t hesitate to get in touch!

However, please remember I am doing this for free, I am trying to do this quickly, and I am learning and solving as I go. Please always think of using StackOverflow, Xamarin forums or GitHub Issues for questions before interrupting me by email, chat or skype; please don't get upset when I don't take on-board one or more of your ideas; please don't get upset when someone else does the work you wanted to do; and please don't be off when we don't implement some inferior way...

Please also remember that the code is Ms-PL - so you can always fork...






Can I donate?

The vast majority of gear and time needed for MvvmCross is funded out of my company's own time/money and out of my own evening, weekends and early mornings. I use MvvmCross in most of my customer projects - so it is partly a commercial investment - but I've been careful to choose an open 'free' license for the code, and I 'freely' try to promptly answer all queries and issues that get logged on StackOverflow and on GitHub. 

The time and money I invest in MvvmCross is all about 1 coder, 5 laptops, 6 phones, 3 tablets, 999 problems, and the thrill of F5 :)

However, a few companies have provided some things for free - thanks:
  • JetBrains (Resharper), 
  • PixelCut (PaintCodeApp) 
  • Infragistics (NetAdvantage); 
  • Microsoft (BizSpark)
  • Nokia (a lovely Lumia!)
Further, almost all of my customers have been very open to me sharing MvvmCross-level code that has been developed within their projects - especially noteworthy are McCann London, without whom this project might never have started.

If you know of a business that is interested in MvvmCross, and they want to contribute to the project in some way, then please do get them to get in touch.

These contributions are all very much appreciated.

Now... back to the code....

Friday, February 08, 2013

CentraStage - a new MvvmCross Monotouch app published on iOS - and since it's awesome...

CentraStage have this week published their iOS app on iTunes:

https://itunes.apple.com/gb/app/centrastage/id588264037?mt=8&ign-mpt=uo%3D2

It's a full IT asset management app for the award-winning CentraStage service - including search, alerts, secure login, alerts and remote console functions (and plenty more that I haven't found yet).

You can use it free for up to 5 devices - so you can give it a go today




The reason I'm listing it here....

It's an MvvmCross MonoTouch app - released only on iOS so far, but with work for Android and for Mac already underway - all from a shared PCL code base :)

Check out the videos of the early prototypes on:




This is all *clearly awesome*...

.... so I have no choice ....

@Deapsquatter on behalf of CentraStage gets a third MvvmCross Badge of Awesomeness!





He's also now blogging some of his experiences - check it out on http://deapsquatter.blogspot.co.uk - also leave him some comments - just to encourage him to keep blogging ;)



MvvmCross tutorial updated - Awesomeness from Wosi!

There's been a fun discussion thread on the Xamarin forums recently - all about how to get started with MvvmCross

From that, the project now has a new fabulous/amazing/stunning/beautiful contribution

Wosi - whoever Wosi is - has updated the Tutorial:


Thanks Wosi - totally awesome - I and everyone who will read the Tutorial thank you with a Badge Of Awesomeness. Thanks!


A patched MonoDevelop for PCLs - AWESOME!


A patched MonoDevelop for Portable Class Libraries is available:
For those doing PCL stuff, I've posted a patched MonoDevelop 3.1.1 build with improved PCL support here: files.xamarin.com/~jeff/MonoDevelop-3.1.1.dmg - it's still not perfect, but it's better than the official builds so far (my patches will be in a future official release) – jstedfast 


I've tested this patch and:
  • It allows you to target .Mac projects with PCLs
  • It allows you to target profiles other than 104


To install it:
  • Download the .dmg to your Mac
  • Mount the drive
  • In Finder, drag the MonoDevelop.app icon to the Applications shortcut
  • When asked, if you want to replace the existing MonoDevelop click 'Yes'


Thanks @jstedfast - this is totally **totally** awesome - it makes me bounce with excitement - makes me want to code all weekend - this badge is most definitely your's:





From http://stackoverflow.com/questions/14764011/monotouch-creating-multiplatform-apps-using-portable-class-libraries/14767926#comment20684486_14767926

Thursday, February 07, 2013

VeeThree

I received an email today asking what was on the vNextDialog branch and whether it was worth looking at....

The answer is that I'm currently playing with VeeThree prototypes on that branch... By all means look - but don't expect it to build!

I will post about what VeeThree is soon... just as soon as I know!

Creating a Custom UIView in MonoTouch and using it in the XCode XIB editor

This was my answer in response to:

  I cannot figure out how to add a custom control to the XIB.

in http://stackoverflow.com/questions/14738964/how-do-you-add-a-custom-uiviewcontroller-to-existing-xib/

----


For a normal UIView, the basic steps you need to go through are:
  1. Create your custom view in C# as a class

    public class MyView
    {
    }
    
    
  2. Add the UIView base class to it, add a Register attribute and add two constructors:

    [Register("MyView")]
    public class MyView : UIView
    {
        public MyView() {}
        public MyView(IntPtr handle) : base(handle) {}
    }
    
    
  3. To make it do something useful, then add a Draw implementation:

    public override Draw(RectangleF rect)
    {
        var context = UIGraphics.CurrentGraphics();
        UIColor.Red.SetFill();
        context.FillEclipseInRect(rect);
    }
    
    
  4. Save and Build your project
  5. Now double click on the XIB for the UIViewController in which you want to use your custom view.
  6. This will open up the XIB editor in xCode
     
  7. In the editor, add a UIView to the design surface
  8. Select that UIView and in the Identity Inspector, set the UIView's "Custom Class" to "MyView"
  9. Save everything in XCode
  10. Return to MonoDevelop, build and run
There's a video of this flow available at: - http://www.youtube.com/watch?v=ggwO46dd-50&feature=youtube_gdata




For a custom UICollectionView, UILabel, UITableViewCell, or any other UIView base class, then you follow similar steps, just with a different base class and with different constructors too in order to support the specific View.

For a video about custom Table cells, see: http://slodge.blogspot.co.uk/2013/01/uitableviewcell-using-xib-editor.html

MonoDevelop Tips


Head to http://mjhutchinson.com/tags/monodevelop_tips

Wednesday, February 06, 2013

More Code Analysis

Today I handed over a small initial project on to a customer.

Following on from http://slodge.blogspot.co.uk/2013/01/mvvmcross-is-90-maintainable.html , I thought it would be good to run code analysis on it.

The results were interesting:


The app itself is a '4 page' project that has some nice polymorphic lists driven by a slightly unusual data structure. I delivered it only on Droid and WP - and only to the proof of concept level.

You can see from the stats:
  1. We managed to make all our code maintainable :)
  2. The vast majority of the complex code was in the Core
  3. Droid was particularly code light :)
  4. WinPhone had a bit more code in it - but when I looked for it, most of it was 'boilerplate' code - code generated in App.xaml.cs
  5. There really wasn't much code in this project - the frameworks - MS, Mono and Mvx - took care of most the work for us.
I like this new toy - will try to keep running it on all my projects :)

Tuesday, February 05, 2013

Tool to check how PCL portable a class library is

If you've got an existing class library, and you are wondering how big a task it will be to make it PCL, then check out this new PCL analyzer tool

It's open source (code on GitHub) and it uses reflection and the data from a spreadsheet from Microsoft's PCL team in order to tell you which non-portable APIs you are currently using.


I love it!

Monday, February 04, 2013

Abbreviated Namespaces for your custom Android controls

Just a reminder... and an excuse to link to @CheeseBaron's blog again.

If you are writing custom Views in your Mono for Android MvvmCross apps, then you don't have to use xml like: myNamespace.App.Controls.controlname

Instead you can declare an abbreviation like: foo

Which then allows you to write abbreviations like: foo.controlname

For a full description: http://blog.ostebaronen.dk/2012/12/adding-view-namespace-abbreviations-in.html

Saturday, February 02, 2013

The future is Portable

Yesterday was a big day for Portable Class Libraries.

Yesterday, Miguel from Xamarin sent out this tweet:



This is really good news - it feel like the future of PCLs will include Microsoft and Xamarin working together to achieve true portability of code.

As a warning - please don't expect this to necessarily be a quick or painless ride... but do expect it to be an exciting one - and one that leads to more productive coding.

Through going portable, I predict we'll see:

- greater sharing of code and pre-built assemblies through reusable portable components
- greater sharing of code and pre-built assemblies through shared portable interfaces with platform specific implementations - i.e. things like MvvmCross plugins
- greater reliability of code - because it'll be easier to write tests for them
- greater speed of development - because people can genuinely write, test and refactor their code across the platforms
- out-of-the-box cross-platform functionality - we're already seeing this a bit - NuGet 2.3 will ship with some PCL and some MonoDroid functionality
- an explosion of platforms - really, I can't wait to see Calliburn, MvvmLight, Prism, Simple-Nancy-Mobile, Fubu-Mobile, Jounce and many more besides all joining the portable revolution - and I'll see if I can free up some of the MvvmCross code (especially the data binding) so that it can be reused more easily by some of them!

I already love coding C# cross-platform

... and I'm really excited about the future

Daniel (dsplaisted) and Miguel (miguelDeIcaza)... thank you both. An MvvmCross Badge of Awesomeness to each of you:


Android - databinding a listview to a grouped data collection using Monodroid and MvvmCross

If you've ever wanted to group data together into sections within your Android listview, then Kevin Knoop - @deapsquatter - yesterday released the first of his extensions for MvvmCross to allow you to do just that:

It's available today from:

https://github.com/deapsquatter/MvvmCross.DeapExtensions

and he's blogged about it at http://deapsquatter.blogspot.com/2013/02/mvvmcrossdeapextensions.html - see it action like:



My tip - star and watch the repo today - Kevin's a proven really good mvvm iOS and Android dev - and he's demoed MvvmCross running on Xamarin.Mac too



This is an easy and very happy decision to make....

.... Kevin, you're the first person to get a second MvvmCross Badge of Awesomeness - thanks!


MvvmCross explained - and @gshackles gets a Big MvvmCross Badge of Awesomeness

Published today in Visual Studio magazine  - Building Android Apps with MVVM and Data Binding

This is a really good intro to Mvvm and to achieving it in Android

Top work by @gshackles - it's really great having an experienced author writing an intro like this.

Thanks Greg! This badge is really well deserved:


Friday, February 01, 2013

An update on my Flurry for Mono for Android post... and how to do native Java calls in MonoDroid

I don't need to say anything else...

If you want to learn how to create a Java binding, or if you just want the code to use flurry, then read: http://blog.martinlegris.com/2012/11/14/flurry-api-in-mono-for-android/