Friday, April 1, 2011

BlackBerry Advertising SDK

On Some BlackBerry devices running BlackBerry Device Software 5.0, ads did not display correctly and a ClassCastException appeared in the event log

Please note: Developing for different versions has been slightly modified. Please refer to the steps below.

Full documentation for the BlackBerry Advertising Service can be found here or within the SDK zip file.

The new BlackBerry Advertising SDK can be found here

Have an older version of the Advertising Service SDK already integrated into your application? Here are the steps for replacing it with the newest version.
1)      In Eclipse, in the Package Explorer view, right-click your project.
2)      Click Build Path > Configure Build Path.
3)      On the Libraries tab, select net_rim_bbapi_adv_appXXXXX.jar and click Remove to remove the old library.
4)     




Click Add External JARs.
5)      Navigate to where you extracted the updated SDK, and select the appropriate .jar file. As with previous versions, the version of the library that you select must match the version of device software that your application is designed to run on.
6)      On the Order and Export tab, select the net_rim_bbapi_adv_app.jar check box. Selecting this check box ensures that the Advertising Service library is packaged with your application when you load it onto a device or simulator. No more loading a separate .cod file!
7)      You’ll also need to change your import statements in your source files. In previous versions of the SDK, the import statement contained a unique identifier for your version of the SDK. This is no long required. Replace the old import statement with this:
import net.rimlib.blackberry.api.advertising.app.Banner;

Now that you’ve integrated the new SDK, you’ll notice some changes with how you run your application. You no longer need to load a library .cod file onto the simulator or device for your application to work correctly. In Eclipse, just click Run and your application will launch in the simulator.

Developing for different software versions

The Advertising Service SDK contains a separate .jar file specific to each BlackBerry® Device Software version. To permit your application to run on multiple software versions, you must ensure that you use the correct .jar file with each version of your application. The Advertising Service SDK contains the following .jar file versions:

·         6.0: Required for applications that run on BlackBerry® 6.
·         4.7-5.0: Required for applications that run on BlackBerry Device Software 4.7 to BlackBerry Device Software 5.0.
·         Pre-4.7: Required for applications that run on a software version earlier than 4.7.

Should you require assistance with the BlackBerry Advertising Service Portal, please visit the BlackBerry Advertising Service Developer Support Forums or Knowledge Base. 

If you need further assistance , please contact AdvertisingService@BlackBerry.com

Best Regards,
BlackBerry Advertising Service Team

PS: Don’t forget that you can report, track and view BlackBerry Advertising SDK related issues via the Research In Motion Developer Issue Tracker.

BlackBerry Articles