[Update] 11/23/18
Mazda has released official details on what the retrofit upgrade process entails. For 2014 models that have the Mazda Connect infotainment system they will be eligible for the retrofit upgrade to get Apple CarPlay and Android Auto.
For those eligible for the upgrade they will need to pay $199 plus and additional two hours of labor (around $200) from the dealership. What you are getting with this upgrade is pretty much just a new USB port. The original USB ports are not compatible with either CarPlay or Android Auto so they need to replaced with 2.1 amp fast charging ports.
With everything said and done, expect to pay over $400 to be able to use Apple CarPlay or Android Auto.
[Original] 4/2/18
Mazda was one of the launch partners in 2014 for both Android Auto and Apple CarPlay, yet none of their vehicles had thus far offered this feature. However during a recent press event for the redesigned 2017 Mazda CX-5 Brian Wong of Cars.com was able to speak to Mazda spokesperson Jacob Brown who said:


“Mazda has been a CarPlay and Android Auto partner since 2014, so it is no secret that we are developing both systems to interface with our Mazda Connect infotainment system. Both software systems should be retroactively upgradable onto all Mazda Connect systems with a potentially minimal hardware addition needed. Mazda does not yet have an official timeline for when these should be available or at what cost, however.”
So the good news for Mazda owners is that Apple CarPlay and Android Auto compatibility is coming, you’ll just have to wait a little longer (and possibly fork out some cash upon release). It is important to note that Mazda Connect first came out in 2014 with the Mazda3 so any cars older then 2014 or that do not have the Mazda Connect infotainment system will be out of luck.