Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
pavankumarragi
Posts: 63
Registered: ‎08-30-2012
My Device: 9900
My Carrier: Various

Creating BlackBerry add demo App

i have created a simple add demo application by referring this url,but when i execute this ,i am facing NoClassDefFound Error? i have downloaded and added BBAS SDK for java from this url,i am using blackberry 9900 simulator?

 

import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
import net.rimlib.blackberry.api.advertising.app.Banner;
public class AdDemo extends UiApplication{
public static void main(String[] args)
{
AdDemo theApp = new AdDemo();
theApp.enterEventDispatcher();
}
public AdDemo()
{
pushScreen(new AdDemoScreen());
}
}
class AdDemoScreen extends MainScreen{
public AdDemoScreen()
{
Banner bannerAd = new Banner(16741, null);
bannerAd.setMMASize(Banner.MMA_SIZE_EXTRA_LARGE);
add(bannerAd);
}
}

 

Please use plain text.
New Contributor
JD_development
Posts: 4
Registered: ‎09-20-2012
My Device: Blackberry Curve 9300, 8520
My Carrier: Orange

Re: Creating BlackBerry add demo App

are you working with eclipse?

try this in your constructor : 

public AdDemoScreen()
{

super();
Banner bannerAd = new Banner(16741, null);
bannerAd.setMMASize(Banner.MMA_SIZE_EXTRA_LARGE);
add(bannerAd);
}
}

Please use plain text.
Regular Contributor
pavankumarragi
Posts: 63
Registered: ‎08-30-2012
My Device: 9900
My Carrier: Various

Re: Creating BlackBerry add demo App

Hii  ,i am working with eclipse 3.7,if i place super() in my screen constructor,i facing the same issue noclass def found error

Please use plain text.
New Contributor
JD_development
Posts: 4
Registered: ‎09-20-2012
My Device: Blackberry Curve 9300, 8520
My Carrier: Orange

Re: Creating BlackBerry add demo App

did you set the build path to the correct jar files? 

Please use plain text.
Regular Contributor
pavankumarragi
Posts: 63
Registered: ‎08-30-2012
My Device: 9900
My Carrier: Various

Re: Creating BlackBerry add demo App

yes,initially i am having compile time errors,but after i added the jar file and set the buildpath,my compile time errors are fixed

Please use plain text.
New Contributor
JD_development
Posts: 4
Registered: ‎09-20-2012
My Device: Blackberry Curve 9300, 8520
My Carrier: Orange

Re: Creating BlackBerry add demo App

i think i found what was wrong, when you configure the build path, you must go to the "order and export" tab and select your advertising jar file that you imported before
Please use plain text.
Regular Contributor
pavankumarragi
Posts: 63
Registered: ‎08-30-2012
My Device: 9900
My Carrier: Various

Re: Creating BlackBerry add demo App

yaa,i selected the jar file which i imported previously, in the order&export tab,but still i am facing noclassdeffound error

 

Please use plain text.