In an effort to regain its position among smartphones, BlackBerry maker Research In Motion spent much of the first day of BlackBerry DevCon revealing new tools and services aimed at drawing mobile developers away from the Android and iPhone and back to BlackBerry. Chief among these developer-focused offerings are a new ad network, a Web application development tool, an Eclipse plug-in, and a new analytics service.

Earlier this year, Apple and Google both unveiled new ad networks from which mobile application developers can pull down advertisements to display within their applications. RIM now will provide that as well, letting developers take 60% of ad revenues from in-app ads in line with Apple and Google.

RIM also announced that its analytics service will allow developers to push information on usage out of their applications. This and the new ad network are both designed to be simple to implement, according to RIM. Specifically, advertisements can be added to an application with only three lines of code, said Tyler Lessard, vice president of global alliances and developer relations at RIM.

But RIM wasn’t only talking about developer revenue-generation tools. The company also unveiled BlackBerry WebWorks and BlackBerry Enterprise Application Middleware (BEAM). WebWorks is a new set of development tools aimed at Web developers who want to build BlackBerry applications. Portions of WebWorks are open source and available on GitHub under the same name. WebWorks allows developers to use HTML 5 and JavaScript to write applications that can take advantage of BlackBerry capabilities, such as calendaring, e-mail and push technologies.

BEAM, on the other hand, is designed to allow enterprise developers to build end-to-end BlackBerry applications.

Alan Brenner, senior vice president of BlackBerry platforms, said that BEAM solves many integration and security problems that make it difficult to offer internal enterprise services to external mobile devices. “We provide on the device a client-customizable container that enables most of the integrations for you in the core database,” he said.

“On the middleware side, we provide a set of libraries that can be hosted on any Java application server. They handle for you a number of the difficult tasks developers normally have to handle, in particular BlackBerry push technologies.”

Mac users also got a boost at the BlackBerry DevCon. RIM made available a technology preview of its new Eclipse plug-in for Mac, which will allow developers to create Java-based applications for BlackBerry devices on Mac OS X. A beta release of this plug-in should be available later this year.

RIM will be pushing its App World app store more heavily in coming months. The company has worked on making App World easier to use and is waiving all fees for developers who want to put their applications in the BlackBerry app store. Additionally, App World will offer 70% of application sales revenues to developers.

Brenner insisted that opening the BlackBerry platform to third-party applications would not compromise the security of this enterprise platform. To do this, he said the company has created a dual-persona model for data storage on devices, “with support in the BlackBerry Enterprise Server. This allows enterprises to protect enterprise data without having to inhibit the personal use of the device.

“With dual persona, enterprise data is protected. We limit the ability of the user to move data across the enterprise realm to the personal domain.”

Dual persona will keep enterprise data on the server, where third-party applications cannot access it without authorization, said Brenner.

Finally, RIM announced that BlackBerry Messenger (BBM), its social network for BlackBerry users, would be opened to third-party application developers. BBM will be available to developers to allow them to use peer-to-peer connections to other BlackBerry users, and will offer messaging as well as matchmaking services for games.