Things haven't been going so well lately for Samsung (NASDAQOTH:SSNLF). The company announced its Q2 preliminary results this week, saying that operating profit would fall by 4% -- marking the seventh straight quarter of year-over-year declines.

Samsung's popular line of Galaxy smartphones helped raise the company to mobile prominence over the past few years and made mobile one of its most lucrative businesses. But lackluster demand for its Galaxy S5 and production miscalculations for its S6 and S6 Edge have left the company desperate for a mobile turnaround. 

Galaxys Models
The Galaxy S6 Edge and S6. Source: Samsung. 

Leading the pack while trailing in profit
Samsung is still the world's leading smartphone vendor by shipments, according to data from Gartner. And while its smartphone lead had previously led to higher revenue, recent missteps have caused Samsung to miss the profit it previously enjoyed. 

There are a few reasons for this. First, the Galaxy S5 failed to match the sales of the former flagship S4. Samsung still moved a lot of smartphones, but you can see from the Statista data below how its overall smartphone shipments have tapered off over the past few quarters. 

Samsung Smartphone Shipments
Source: Statista.

Then there's been rising competition from Chinese and Indian companies making low-cost Android devices that have started to eat into Samsung's mobile dominance in their respective markets. While Samsung's control of the high-end Android market has been consistent, many users in these countries have found mid- and low-priced smartphone options outside of Samsung's lineup. 

And if that weren't enough, Samsung's newest devices -- the S6 and S6 Edge -- were meant to be a way to rebound from the company's mobile slump, but have fallen short. While shipments of the S6 have outpaced the S5, Samsung failed to find the right production balance between the S6 and S6 Edge. According to The Wall Street Journal, Samsung manufactured far too many S6 devices and fell short of meeting demand for the S6 Edge. 

Meanwhile, consumers have found smartphone solace in Apple's iPhone 6 and 6 Plus. Apple posted its best and second-best quarters ever in fiscal Q1 and Q2 of this year, driven in part by record iPhone sales.

A long road ahead
While Samsung will report more detailed earnings numbers later this month, analysts expect a 28% drop in mobile operating income for Q2. To help reverse the current downward trajectory, Samsung is currently shifting more production to the S6 Edge devices, but that's unlikely to turn the company's mobile problems around.

At the end of last year, Gartner's research director, Roberta Cozza, said that Samsung will be able to fend off Apple and rising Chinese vendors with "a solid ecosystem of apps, content and services unique to Samsung devices that Samsung can secure more loyalty and longer-term differentiation at the high end of the market."

Clearly, the company has yet to do that, and perhaps now is the time for Samsung to heed that advice and build out a strong ecosystem that draws in users, similar to Apple's robust and profitable system. In the meantime, Samsung will have to lean on the current demand for its S6 Edge and hope that it more accurately estimates customer demand the next time around. 

Chris Neiger has no position in any stocks mentioned. The Motley Fool recommends Apple and Gartner. The Motley Fool owns shares of Apple. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.