BlackBerry developer Research in Motion (Nasdaq: RIMM) reported second-quarter results Thursday afternoon with a net loss slightly below expectations, revenue $500 million above estimates and a gain of 2 million subscribers.

The good news sent shares of the Waterloo, Ont., smartphone and tablet maker up more than 19 percent in after-hours trading to $8.52, up $1.38. Earlier, they closed at $7.12, up 12 cents.

Still, shares of RIM are down 51 percent this year and 69 percent in the past 52 weeks as BlackBerry has lost market share to the iPhone from Apple (Nasdaq: AAPL), the world's most valuable technology company, and Android-based phones, which combined have nearly a 85 percent market share.

RIM said its second-quarter net loss was $235 million, or 45 cents a share, including pre-tax costs for restructuring. That was 2 cents less than expected. Revenue was $2.9 billion, compared with the $2.49 billion expected by analysts surveyed by Thomson Reuters.

Nevertheless, the losses reversed last year’s net income of $419 million, or 80 cents a share, on revenue of $4.17 billion.

“RIM is progressing on its financial and operational commitments during this major transition,” said CEO Thorsten Heins, who briefed investors Thursday night.

The company also reported its cash and investments had risen to a surprising $2.3 billion, up $100 million in the quarter, during which it shipped 7.4 million BlackBerry phones but only 130,000 PlayBook tablets.

However, RIM still hasn't announced when it will ship the new BlackBerry 10, promised for sometime in early 2013, as it keeps shipping the current BlackBerry 7 models. That means it will likely miss the crucial holiday sales season, during which Apple is expected to sell as many as 50 million iPhone 5 models and rivals such as Samsung Electronics (Seoul: 005930) may sells tens of millions of Galaxy S III units.

As well, Microsoft Corp. (Nasdaq: MSFT) is expected to blitz the market with smartphones using its Windows 8 next month from partners such as Nokia Oyj (NYSE: NOK) and Asian rivals. RIM's market share has slumped to below 5 percent, estimates IDC, compared with 12 percent a year ago.

An executive phone in markets like the U.S. and Canada, and in many international markets like Indonesia, BlackBerrys are consumer electronics products. That may account for the surprising jump in subscribers, especially because most analysts had expected the number to fall from last quarter's 78 million.