I've got a 2014 CX-5 that had the same NB1 system as yours beforehand, which I changed last year for a Sony XAV-AX100 that has CarPlay and Android Auto - it's brilliant and a great replacement for the rubbish original head unit.
Here's the original post from when I installed it
http://mazdacx5forums.co.uk/index.php?topic=337.msg5864#msg5864It took a bit of work as the only double-din adapter available here in the UK was not very well designed and mounted the stereo 'flat' against the dash which looked awful and didn't make using the head unit very easy either, so I modified it so the head unit would sit at an angle like it should.
Apart from that, I needed adapters for the wiring, camera, steering wheel controls and antenna. It's not worth trying to get the built-in USB ports working as they didn't work for me, I just ran a USB extension cable to the armrest.
Also, I wasn't able to find anything that could interpret the signals from the commander wheel and send them to a head unit so mine now sits unused.
Good luck!