SEOUL/TAIPEI -- Hua Chunying, like many of her fellow citizens, is a big supporter of Huawei Technologies. So China's foreign ministry spokeswoman could not resist the opportunity recently to boast about the homegrown telecommunications giant's apparent advantages over U.S. rivals when reporters quizzed her about whether Beijing had eavesdropped on President Donald Trump's iPhone.

"If [the White House] is worried that their iPhones may be tapped, they should use a Huawei," she quipped in Beijing last week.

Hua's cheeky riposte in the face of U.S. suspicions about Huawei displayed China's confidence and pride in the country's largest smartphone maker. But for those feeling the impact of the company's aggressive growth ambitions, its meteoric rise in recent years is no joke.

Samsung Electronics is still the world's biggest smartphone company. It can even still claim to have the upper hand in mobile technology. But as each quarter passes, South Korea's mobile champion cannot deny that the gaps between the two Asian tech giants are narrowing quickly.

Just this year, Huawei overtook Apple as the world's second-largest smartphone maker in the quarter ended June. Now Samsung and Huawei are locked in a bitter fight for supremacy of the smartphone industry.

It is a battle that pitches not only the individual companies, but entire supply chains against each other. It has been fought in their retail showrooms, their research and development labs, and even in the courts, with tit for tat lawsuits over intellectual property infringement.

Huawei overtook Apple as the world's second-largest smartphone maker in the quarter ended June. © Reuters

The bell is about to sound for the next round as both sides prepare to launch their newest products: foldable smartphones. Samsung will unveil its user interface next week in San Francisco, and is expected to release the real product early next year. Huawei plans to roll out its first fifth-generation handset as a foldable phone in mid-2019.

The designs of the foldable phones have not yet been disclosed. But what is known is that the smartphones will be equipped with a flexible organic light-emitting diode, or OLED, display that folds to a smartphone size in hand, but can be unfolded to a tablet-size device when a user needs a big screen and more functions.

Both companies hope their products will knock Apple's latest iPhones -- unveiled in September -- into the shade, at least for the markets that they serve. Apple may draw headlines with its premium iPhones, but the Silicon Valley company occupies a niche segment of the market, unlike Samsung and Huawei who have products across the pricing spectrum.

That market adds up to nearly 1.5 billion handsets a year globally. But growth is slowing and both companies hope the foldable phone will be the key to reversing the trend.

The race now is to be the first big mover, as a successful launch could decide much more than a few million sales. The company that conquers the technology would be in prime position to shape the way consumers use these new flexible devices. They could replace not just old smartphones, but tablets or even personal computers -- opening up a whole new segment to exploit, say some experts.

There could be additional revenue streams, such as licensing technology or developing applications for these new multipurpose devices. Samsung is already exploring this potential.

"The foldable phone will offer multitasking environments for users," Lee Kyung-tae, a Samsung director, said this week. "We also need to make apps optimized for the device. For this, we are sharing related elements with app developers."

The lure of this new market is even stronger as the competitive landscape shifts at an accelerating rate. According to market analysis company IDC, Huawei's worldwide handset shipments more than quadrupled from just 29.1 million units in 2012 to 153.1 million in 2017, with its market share expanding from 4% to 10.4%. In contrast, Samsung's market share dropped to 21.6% from 39.6% during the same period, even though its shipments increased to 317.3 million units from 215.8 million.

In the second quarter of this year, Huawei claimed the title of the world's second-largest smartphone maker -- overtaking Apple -- by shipping 54.2 million units, or 15.8% of the market, up from 11.8% for the previous three months. For its part, Samsung suffered a 23.4% drop in the same period over the previous three months, shipping 71.5 million units, or 20.9% of the market.

Even though Samsung is still the market leader, the company is feeling the heat from Chinese competitors, and not just in China, say insiders. Others making inroads include Oppo, Vivo and Xiaomi, which is competing neck and neck with Samsung in India.

"They [the Chinese rivals] have come so close, [they are] just one step behind us," said a Samsung executive who requested anonymity. "It is hard to deal with them because [it] needs a customized strategy to fight each Chinese company."

The Korean company believes its advantage lies in its technological lead. Samsung "is confident that its technology is more advanced than Chinese rivals," said another industry source familiar with the company.

Even its competitors admit that Samsung excels in certain areas where Chinese companies struggle. "Samsung has a lot of hardcore technologies such as memory chips and displays," said one Huawei engineer.

But there has been speculation in the industry about whether the pace of Samsung's innovation has slowed -- or at least lost its edge. The troubled launch of its premium Note 7 model two years ago did serious damage to the group's reputation. It was forced to kill the Note 7 in 2016 after hundreds of consumers saw their smartphones burst into flames while being charged.

That incident has given an extra boost to Huawei, already buoyed by its popularity in its home market. "Samsung is really losing the competition -- especially in China," the Huawei engineer said.

Huawei had a 26% market share in the second quarter of this year, according to research company Counterpoint. Apple only controlled 8% in the same period, while Samsung's market share has shrunk to less than 1% since the fourth quarter of 2017.

Analysts attributed Samsung's struggle in China in part to the Note 7 debacle, but also the fact that telecom carriers offer more subsidies to local brands for mid-and low-level handsets than high-end segment. "Huawei enjoys benefits in its domestic market where the playground is biased," said C.W. Chung, an analyst at Nomura Securities.

With the foldable phone, Samsung hopes to regain momentum, but Huawei is equally determined not to let its rival take the advantage.

In preparation for the forthcoming battle, both companies are building defenses around their supply chain.

Market watchers say that Samsung pressured its subsidiary, Samsung Display, to withhold its flexible screen technology from Huawei's foldable phone. Samsung Display is expected to provide the bending screens exclusively to Samsung Electronics in the first stage, and later offer them to other set makers, as it did for the parent's Galaxy and Note smartphone series.

The group has also brought in-house the manufacture of many components and its handset assembly to ensure exclusive access.

Huawei, meanwhile, has formed a close partnership with BOE Technology Group, China's top display maker, to develop flexible OLED screens. It is also backed by many of the industry's top Chinese and Taiwanese electronic component makers -- many of which are also major Apple suppliers.

Analysts say that Samsung's approach could give it an advantage -- for a while at least. "Samsung stands to gain the most... given its vertically integrated supply chain," said Peter Yu, an analyst at BNP Paribas.

But it may not be long before Huawei catches up. The Chinese company launched its first smartphone in 2010 and rose quickly through the ranks, not just by copying the innovations of its rivals, but by investing heavily in research and development. By 2013, Huawei had climbed to third place globally, overtaking the once-glorious HTC, Nokia and many Chinese homegrown players, such as Coolpad Group and Lenovo Group.

Its success has given added weight to China's ambitions to be a leader in cutting-edge technologies by 2025. "Most of the Chinese are very proud of having a company that really has core technologies despite the fact that Huawei never advocates patriotism in its marketing campaigns," said Huang Haifeng, a veteran tech writer and deputy editor-in-chief at Communications World.

Huawei still has issues to overcome, however. The company has been banned in the U.S. and Australia from selling its telecom equipment and 5G technology to local wireless network operators. There have been accusations that it has been a conduit for espionage, given its state-linked background. So while it is the biggest smartphone brand in China, it struggles to make inroads into the U.S. market.

Yet that has not made any apparent dent in its growth rate -- or its ambitions to knock Samsung off its perch. The chief executive of Huawei's smartphone division, Richard Yu, said in July that his company expects to replace Apple as the world's No. 2 smartphone maker on an annual basis by the end of 2018. He also vowed to surpass Samsung within one to two years.

Huawei is putting considerable resources behind these ambitions. This summer, the group said it planned to increase research and development spending to between $15 billion and $20 billion. The company spent 89.7 billion yuan ($13 billion) on R&D in 2017, accounting for nearly 15% of its total revenue of $92.5 billion. By contrast, Samsung Electronics' R&D was 16.8 trillion won ($14.8 billion) in 2017, but that accounted for only 7% of its revenue.

Huawei may yet encounter obstacles to its global ambitions, however, according to Credit Suisse. The tensions created by the U.S. trade war with China could make it difficult to expand in some markets.

"For developed markets, Samsung may have an edge over Huawei as Samsung does not have those political risks to overcome given the current political climate," Credit Suisse said. "But for emerging markets as well as China, Huawei has the upper hand with its local presence and track record exporting fairly advanced technology at a reasonable price for emerging markets."

It is still far too early to tell who will emerge triumphant from this latest battle. Credit Suisse believes that both Asian companies want to innovate and both have the capability to win. Now, "it is really up to the execution" the bank said.