Microsoft faces a slide into irrelevance in the next four years unless it can make progress in the smartphone and tablet markets, because the PC market will continue shrinking, warns the research group Gartner.

It says a huge and disruptive shift is underway, in which more and more people will use a tablet as their main computing device, researchers say.

That will also see shipments of Android devices dwarf those of Windows PCs and phones by 2017. Microsoft-powered device shipments will almost be at parity with those of Apple iPhones and iPads - the latter a situation not seen since the 1980s.

In a new forecast published on Thursday morning, Gartner says that by 2015 shipments of tablets will outstrip those of conventional PCs such as desktops and notebooks, as Android and Apple's iOS become increasingly dominant in the overall operating system picture. Android in particular will be installed on more than a billion devices shipped in 2014, says Carolina Milanesi, the analyst who led the research.

Operating system shares forecast from 2012-2017. Source: Gartner, April 2013

Meanwhile a new category of "ultramobile" devices - such as the Surface Pro and the lighter ultrabook laptops - will become increasingly important as people shift towards more mobile forms of computing.

For Microsoft, this poses an important inflexion point in its history, warns Milanesi. "Winning in the tablet and phone space is critical for them to remain relevant in this shift," she told the Guardian. "We're talking about hardware displacement here - but this shift also has wider implications for operating systems and apps. What happens, for instance, when [Microsoft] Office isn't the best way to be productive in your work?"

For Microsoft, income from Windows and Office licences are key to its revenues: per-PC Windows licences generate about 50% of its profits, and Office licences almost all the rest.

But while it dominates the PC market, it is a distant third in the smartphone and tablet markets. Latest figures suggest that Windows Phone, its smartphone OS, shipped on about 3% of devices in fourth quarter of 2012, compared to 20% for Apple's iPhone and over 70% for Android - of which 50% connected to Google's servers and 20% were "white box" Android phones in China which do not use Google services.

"Android is going to get to volumes that are three times those of Windows," says Milanesi. "From a consumer perspective, the question becomes: what software do you want to have to get the widest reach on your devices? BlackBerry may say that its QNX software [used as the basis of BB10 on its new phones] can go into cars and phones, but Android is already in fridges. That's the challenge."

BlackBerry, which has just released the first of its BB10 devices, is forecast to see a slow decline in shipments through to 2017, shipping 24.1m devices then compared to 34.7m in 2012. That will leave it well behind Windows Phone in the forecast.

Tablets will overtake desktop and notebook shipments combined, while 'ultramobiles' will grow, says Gartner

Milanesi added: "the interesting thing is that this shift in device preference is coming from a shift in user behaviour. Some people think that it's just like the shift when people moved from desktops to laptops [a process that began in the early 2000s]. But that's wrong. The laptop was more mobile than the desktop, but with the tablet and smartphone, there's a bigger embrace of the cloud for sharing and for access to content. It's also more biased towards consumption of content rather than production.

"All these things will get consumers to look for the OS and apps that can give them all that," Milanesi says.

A key problem for Microsoft is that it is the people who don't yet own PCs - in emerging markets such as Africa and China - who are most likely to have a smartphone and tablet as their first "computer". Milanesi says: "They're starting with a smartphone, not a PC, so when they're looking for something larger, they look at something that's a replacement smartphone experience - which is a tablet or ultramobile device. And Android or [Apple's] iOS are the two that they're looking at."

Microsoft could then face the vicious circle where developers considering which platform to develop apps for look at those with the largest user base - and that that will not be Windows. By 2017, she says, the number of devices being shipped with iOS, both iPhones and iPads, will be close to that with Windows and Windows Phone combined.

"And that's not assuming that Apple launches a low-end iPhone," Milanesi says. "Our numbers for Apple are conservative, because for a low-end phone it would be a guess about what price point it would use, and what the timing would be." A number of observers have suggested that Apple will launch a lower-cost iPhone in the next year to capture a larger market share, especially in the pre-pay (pay-as-you-go) market. But Apple has given no indication of whether it will do that.