BlackBerry developer Research in Motion (Nasdaq: RIMM), pulled off two surprises last week: It first reported it had gained 2 million subscribers, and then reported second-quarter financials that were much better than expected.

Shares of the Waterloo, Ontario, smartphone and tablet maker vaulted 16 percent for the week, closing Friday at $7.50, valuing the company at $3.93 billion.

Even critics like Victor Alboini of Toronto's Jaguar Financial, RIM's No. 1 investor critic who had said in March RIM “won't be the same company a year from now,” were pleased. The second-quarter net loss was only $235 million, or 45 cents a share, while revenue of $2.9 billion rose 2 percent from the first quarter.

Even more of a surprise: RIM sold 7.4 million BlackBerrys and 130,000 PlayBook tablets and boosted its cash and investments up a surprising $100 million to $2.3 billion.

So the big question is: Has RIM pulled out of its death spiral? Can it avoid the fate of earlier technology pioneers like Silicon Graphics Inc. (Nasdaq: SGI) and Eastman Kodak Corp. (Pink: EKDKQ) that went into bankruptcy and dozens more like Polaroid, Kaypro and Wang Laboratories that vanished?

There's a case to be a bear or a bull regarding RIM, whose shares have surrendered 65 percent over the past year, lowering its market capitalization to only $3.9 billion, compared with rivals like Apple Inc. (Nasdaq: AAPL), valued at $625 billion, and Google (Nasdaq: GOOG), valued at $247 billion or Samsung Electronics (Seoul: 005930), valued around $19.3 billion.

Here's the bullish case: Under new CEO Thorsten Heins, RIM has restructured, cut staff and costs, and pushed to get out the next-generation BlackBerry 10 phone early in 2013. Forty mobile carriers in 16 countries have promised to support it, and apps and software have been with developers since June.

As well, by pushing sales of BlackBerrys in emerging markets like Indonesia and Venezuela, where its messaging software is especially effective in so-so mobile systems, RIM is boosting its international footprint. Often an “executive” phone in the U.S. and Canada, BlackBerry is a consumer product abroad.

With 80 million global subscribers, all of whom are served by an internal network, RIM is a major enterprise, serving the corporate and consumer market. It's also approved by the U.S. government and other worldwide agencies for official use, a feather in its cap.

Furthermore, RIM has more than 3,300 patents valued around $3 billion, intellectual property investment bankers say. That's not factored into the share price now.

So if Heins can get the BlackBerry 10 ready now, maintain cash flow through the current third quarter and keep selling BlackBerry 7 and other models, maybe RIM can ease into 2013 and make it. Then BlackBerry 10 could be a hit.

You probably know the bear scenario: On Monday, Apple probably will announce sales of another 5 million iPhone 5s over its second weekend, Samsung may announce sales of Galaxy S III units have reached 20 million, etc.

Later in October, market researchers will likely issue their third-quarter rankings that will likely leave RIM's share around 5 percent in a market where Apple ranks around 25 percent and Google Android phones have about 65 percent share, leaving the scraps to RIM.

Microsoft (Nasdaq: MSFT) is also pushing Windows 8 into the market, with hook-ups with Nokia Oyj (NYSE: NOK), Taiwan's HTC Corp. (Taipei: 2498) and perhaps China's Lenovo Group (Pink: LNVGY), the No. 2 global PC maker.

As well, RIM's cash flow may not be enough to sustain the research and development required to finish BlackBerry 10. Heins predicts a third-quarter operating loss. Sales in emerging markets may require more support than in the developed world.

So what will it be? “Any company that has 80 million subscribers is a strong brand,” said Clive Chajet, one of the world's top authorities on brand equity. “They're not a fly-by-night company.”

Will we see a rash of BlackBerry ads soon? A push to customers to keep on using the model until next year? Will Samsung, Apple, Google'e Motorola and Asian giants make smaller players like Ericsson (Nasdaq: ERIC), Sony Corp. (NYSE: SNE) and Nokia obsolete?

For the sake of technology, it would be heartening if RIM can pull it off and flourish again like others in the past when they got into hot water. Reality may be different, though.