Google (NASDAQ:GOOG) (NASDAQ:GOOGL) might often seem like an invincible beast, but one of its core weaknesses is the fragmentation of Android. Android is an open source operating system, which means that anyone can modify it.

Amazon.com (NASDAQ:AMZN), for example, replaced Google's services with its own in Android to create Fire OS. That practice, known as "forking," prevents Google from monetizing Android with app sales and search revenue. According to ABI Research, forked Android devices accounted for 29% of the entire Android market in 2014.

The removal of Google services from Android opens up an interesting opportunity for Microsoft (NASDAQ:MSFT). Windows Phones accounted for less than 3% of the global smartphone market last quarter, but the company started launching first-party apps including Office 365, OneDrive, and Bing on iOS and Android to expand its ecosystem.

Convincing die-hard Google users to install those apps on Android can be tough, but Microsoft recently forged partnerships with several major smartphone OEMs to exploit Google's weakening grip on Android.

Samsung: Google's frenemy is now Microsoft's ally

Samsung (NASDAQOTH: SSNLF), the world's largest Android device maker, recently agreed to pre-install Microsoft Word, Excel, PowerPoint, OneNote, OneDrive, and Skype on its new phones and tablets. Pre-installing these apps could tether more Samsung owners to Microsoft's ecosystem instead of Google's.

This deal also helps Samsung, which has been looking for ways to free itself from Google's ecosystem. It wants to do this for two reasons: it's tired of competing against hordes of cheaper Android devices, and it's sick of Google setting rules for how much it can modify Android.

To loosen Google's grip, Samsung launched replacement services for several of Google's apps. It launched its own Galaxy App Store and streaming music service, Milk, to compete against Google Play. It launched a fitness tracking app, S Health, to replace Google Fit. It also introduced Samsung Pay to compete against Android Pay. Samsung further launched Tizen, its own mobile OS. That's why Samsung teamed up with Microsoft -- the latter's cloud-based productivity apps fill in the gaps in Samsung's vision of a Google-free ecosystem.

Unfortunately, that grand plan recently ran into some problems. AT&T and Verizon, the two top U.S. wireless carriers, refused to pre-install Microsoft's apps on Samsung's new S6 devices for unknown reasons. Nonetheless, Microsoft also signed similar deals with 11 other OEMs, including Dell, so carrier interference is unlikely to cripple the entire effort.

Cyanogen: Making Android-powered Windows Phones

Cyanogen, which modified Android into its own OS, CyanogenMod, is an outspoken opponent of Google. Its CEO, Kirk McMaster, recently told Forbes that his company was "putting a bullet through Google's head" by reclaiming Android from the search giant. Cyanogen's approach is similar to the one employed by Amazon and Samsung -- it strips Google's services out of Android and encourages users and OEMs to replace them with alternative apps.

Microsoft recently formed a strategic partnership with Cyanogen to help McMaster's company boot Google out of Android devices. Like Samsung, Cyanogen agreed to install Microsoft's main mobile apps and services -- including Office, Skype, Bing, and Outlook -- on its devices. That move essentially turns Cyanogen's Android devices into Android-powered Windows Phones.

Cyanogen is still a small player in the mobile market. It last reported about 10 million installations in December 2013, but analysts cited by Forbes believe that rising demand in emerging markets could help Cyanogen eventually reach 1 billion handsets -- more than all the iPhones sold to date.

Xiaomi: Helping Microsoft replace Android with Windows 10

Xiaomi, the top smartphone maker in China, is also the fifth-largest in the world. The company claimed 4.4% of the global smartphone market at the end of 2014, according to IDC -- up from 2% a year earlier.

Xiaomi devices run on MIUI, a forked version of Android. Google can't generate revenue from most of Xiaomi's devices, because the company's phones in mainland China are barred from using Google search and buying apps from the Play Store. Owners of Xiaomi phones in China use Baidu's (NASDAQ:BIDU) search engine instead of Google's, and its own Mi App Store instead of Google Play.

Since Bing isn't banned in China, Xiaomi seems like the ideal partner for Microsoft. But instead of just bundling apps to MIUI, Xiaomi is helping port Windows 10 to its Mi 4 flagship phones. Xiaomi and Microsoft have even developed a tool that lets users convert Android devices into Windows 10 systems. If these plans work out, Microsoft could gain a valuable mobile presence in mainland China -- something Google's can't accomplish.

The takeaway

Google's entire mobile strategy is based on other companies doing the heavy lifting and taking the overhead risks. It leverages user dependence on Google Search and services to tether OEMs to its ecosystem. But if OEMs try to break free from Google's ecosystem, forking occurs and fragmentation worsens. Simply put, that's bad news for Google, but great news for Microsoft.