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 ;)