Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

BlackBerry Advertising Service

Reply
Developer
lagunex
Posts: 45
Registered: 02-12-2011
My Carrier: Yoigo

Could the Advertising SDK cause an app to crash?

Hi all.

 

I have an app that has been working fine until I added the Advertising SDK.

 

The app has a HomeScreen that is always in Stack (until you close the app) and a GameScreen that gets pushed and popped from the Stack every time a game begins/ends.

 

The way I coded ads in my GameScreen is like this

 

 

protected void onUiEngineAttached(boolean attached){
  if(attached){
    startAds();
  } else {
    stopAds();
  }
}

private void stopAds() {
  banner = null;
  bannerManager.deleteAll();
  titleManager.delete(bannerManager);
  setTitle("");
}

private void startAds(){
  banner = new Banner(ZONE_ID, null);
  banner.setTestModeFlag(AdsConfig.TEST_MODE);
  banner.setMMASize(Banner.MMA_SIZE_SMALL);

  bannerManager.add(banner);
  titleManager.insert(bannerManager,0);
  setTitle(titleManager);
}

 

 

In order to remove and insert the apps when the Screen is pushed. "titileManager" is an HorizontalFieldManager that has the Banner and position 0 and some other info after that.

 

The HomeScreen doesn't handle attachment nor display events so I only call this method in the constructor

 

private void startAds(){
  bannerManager = new HorizontalFieldManager(Field.FIELD_HCENTER);
  Banner banner = new Banner(ZONE_ID, null);
  banner.setTestModeFlag(AdsConfig.TEST_MODE);
  banner.setMMASize(Banner.MMA_SIZE_LARGE);
  bannerManager.add(banner);
  setStatus(bannerManager);
}

 

 

I've notice two different things happening since then. First of all, every now and then (I haven't been able to detect the specific cause) the app suddenly close for no reason. I haven't changed anything else in my code except for what I wrote above. Secondly, checking the Event logs I've seen that my Banner is set with AutoSize->XXL even though I say I want them LARGE and SMALL. Hence, ads are display in the proper size (SMALL and LARGE) but they don't fit that size. It's like a XXL ad cropped.

 

Could there been a problem when requesting an Ad that cause the app to crash? maybe an Uncaught Exception I should handle?

 

This is what the Event Log tells me after the crashed:

 

 

#BlackBerry Event Log (cpt)
#HwID: 0x4000f07
#DPIN: 0x27d2f59a
#PVer: 6.6.0.223
#AVer: 6.0.0.600
¿ System - JVM:INFOp=27d2f59a,a='6.0.0.600',o='6.6.0.223',h=4000f07 - 20/12 21:54:44
¿ System - AMNF net_rim_event_log_viewer_app(320) - 20/12 21:54:43
¿ AppManager - Foreground is set: net_rim_event_log_viewer_app(320) - 20/12 21:54:43
¿ UI - NPWE RibbonLauncherApp@7a303c1b 5 - 20/12 21:54:43
¿ UI - NPWE RibbonLauncherApp@7a303c1b 6 - 20/12 21:54:43
¿ UI - NPWE RibbonLauncherApp@7a303c1b 7 - 20/12 21:54:43
E UniversalSearch - UniversalSearchUtilities : Unable to get grid column count from theme.Using default value - 20/12 21:54:42
¿ UI - NPWE RibbonLauncherApp@7a303c1b 5 - 20/12 21:54:38
¿ net.rim.browser - RMen - 20/12 21:54:38
W net.rim.networkapi - Tfil  4 - 20/12 21:54:38
W net.rim.networkapi - Tadd  3 - 20/12 21:54:38
W net.rim.networkapi - Tadd  5 - 20/12 21:54:38
W net.rim.networkapi - Tadd  6 - 20/12 21:54:38
W net.rim.networkapi - Tadd  1 - 20/12 21:54:38
W net.rim.networkapi - Tsbd - 20/12 21:54:38
¿ net.rim.browser - RMen - 20/12 21:54:38
¿ net.rim.hrtRT - ESbk 0x0 - 20/12 21:54:38
¿ net.rim.hrtRT - ESbk 0x0 - 20/12 21:54:38
¿ net.rim.browser - RMen - 20/12 21:54:37
¿ net.rim.browser - RMen - 20/12 21:54:37
¿ net.rim.browser - RMen - 20/12 21:54:37
¿ net.rim.browser - RMen - 20/12 21:54:37
¿ net.rim.browser - RMen - 20/12 21:54:37
¿ net.rim.browser - Dsta - 20/12 21:54:37
¿ System - AMNF net_rim_bb_ribbon_app(85) - 20/12 21:54:37
¿ AppManager - Foreground is set: net_rim_bb_ribbon_app(85) - 20/12 21:54:37
¿ AppManager - Restarting net_rim_bb_browser_daemon - 20/12 21:54:37
¿ AppManager - Foreground is requested: net_rim_bb_ribbon_app(85) - 20/12 21:54:37
¿ System - AMFD LagunexDomino(318) - 20/12 21:54:37
¿ net.rim.tcp - clos - 20/12 21:54:28
¿ net.rim.tunnel - Clos  2 - 20/12 21:54:28
¿ net.rim.browser - OpAP LagunexDomino - 20/12 21:54:28
W Banner-XXXXX - Temp_URL to Browser. http://ads2.mocean.mobi/redir/77b487f3-2b7a-11e1-90f6-001ec9fd3a50/0/76164 - 20/12 21:54:28
W Banner-XXXXX - URL to Browser. http://ads2.mocean.mobi/redir/77b487f3-2b7a-11e1-90f6-001ec9fd3a50/0/76164 - 20/12 21:54:28
W Banner-XXXXX - Final scheme for navigation = http - 20/12 21:54:28
W Banner-XXXXX - Final location: http://ads2.mocean.mobi/redir/77b487f3-2b7a-11e1-90f6-001ec9fd3a50/0/76164 - 20/12 21:54:28
¿ net.rim.tcp - disc  1 - 20/12 21:54:28
W Banner-XXXXX - Following URL to end: http://ads2.mocean.mobi/redir/77b487f3-2b7a-11e1-90f6-001ec9fd3a50/0/76164 - 20/12 21:54:28
¿ net.rim.tcp - clos - 20/12 21:54:28
¿ net.rim.tunnel - Clos  2 - 20/12 21:54:28
¿ net.rim.tcp - clos - 20/12 21:54:28
¿ net.rim.tunnel - Clos  2 - 20/12 21:54:28
¿ net.rim.tcp - disc  1 - 20/12 21:54:28
¿ net.rim.tcp - clos - 20/12 21:54:28
¿ net.rim.tunnel - Clos  2 - 20/12 21:54:28
W net.rim.networkapi - Fats  6 - 20/12 21:54:28
W net.rim.networkapi - Fats  6 - 20/12 21:54:28
W net.rim.networkapi - Fats  6 - 20/12 21:54:28
¿ net.rim.udp - clos - 20/12 21:54:27
¿ net.rim.tunnel - Clos  2 - 20/12 21:54:27
¿ net.rim.dns - RetQ - 20/12 21:54:27
¿ net.rim.dns - DnsR  2 - 20/12 21:54:27
W net.rim.networkapi - Fats  6 - 20/12 21:54:27
W net.rim.dns - RXst - 20/12 21:54:27
¿ net.rim.tunnel - Open  2 - 20/12 21:54:27
¿ net.rim.tunnel - Read  2 - 20/12 21:54:27
¿ net.rim.tunnel - Open  (ALREADY)pId=971793349,id=2,state=3,waf=4 - 20/12 21:54:27
¿ net.rim.tunnel - Stat  2  0  1 - 20/12 21:54:27
¿ net.rim.tunnel - Read  2 - 20/12 21:54:27
¿ net.rim.tunnel - Open  2 - 20/12 21:54:27
¿ net.rim.tunnel - Open  (ALREADY)pId=971793349,id=2,state=3,waf=4 - 20/12 21:54:27
¿ net.rim.tunnel - Stat  2  0  1 - 20/12 21:54:27
¿ net.rim.tunnel - Open  2 - 20/12 21:54:27
¿ net.rim.tunnel - Read  2 - 20/12 21:54:27
¿ net.rim.tunnel - Open  (ALREADY)pId=971793349,id=2,state=3,waf=4 - 20/12 21:54:27
¿ net.rim.tunnel - Stat  2  0  1 - 20/12 21:54:27
W net.rim.dns - TXst - 20/12 21:54:27
W net.rim.dns - DnsT  2 - 20/12 21:54:27
¿ net.rim.tcp - open - 20/12 21:54:27
W net.rim.networkapi - Fatt  6 - 20/12 21:54:27
¿ net.rim.tcp - open - 20/12 21:54:27
W net.rim.networkapi - Fatt  6 - 20/12 21:54:27
¿ net.rim.tunnel - Open  2 - 20/12 21:54:27
¿ net.rim.tunnel - Read  2 - 20/12 21:54:27
¿ net.rim.tunnel - Open  (ALREADY)pId=971793349,id=2,state=3,waf=4 - 20/12 21:54:27
¿ net.rim.tunnel - Stat  2  0  1 - 20/12 21:54:27
¿ net.rim.tcp - open - 20/12 21:54:27
¿ net.rim.tcp - open - 20/12 21:54:27
W net.rim.networkapi - Fatt  6 - 20/12 21:54:27
W net.rim.networkapi - Fatt  6 - 20/12 21:54:27
¿ net.rim.tcp - clos - 20/12 21:54:27
¿ net.rim.tunnel - Clos  2 - 20/12 21:54:27
W net.rim.dns - TXst - 20/12 21:54:25
¿ net.rim.dns - DnsQ  2 - 20/12 21:54:25
¿ net.rim.tunnel - Open  2 - 20/12 21:54:25
¿ net.rim.tunnel - Read  2 - 20/12 21:54:25
¿ net.rim.tunnel - Open  (ALREADY)pId=971793349,id=2,state=3,waf=4 - 20/12 21:54:25
¿ net.rim.tunnel - Stat  2  0  1 - 20/12 21:54:25
¿ net.rim.udp - open - 20/12 21:54:25
¿ net.rim.tunnel - Read  2 - 20/12 21:54:25
¿ net.rim.tunnel - Open  2 - 20/12 21:54:25
¿ net.rim.tunnel - Open  (ALREADY)pId=971793349,id=2,state=3,waf=4 - 20/12 21:54:25
¿ net.rim.tunnel - Stat  2  0  1 - 20/12 21:54:25
¿ net.rim.tcp - open - 20/12 21:54:25
W Banner-XXXXX - Transport string: ;deviceside=true;interface=wifi - 20/12 21:54:25
W Banner-XXXXX - Navigation event for http://ads2.mocean.mobi/redir/77b487f3-2b7a-11e1-90f6-001ec9fd3a50/0/76164 - 20/12 21:54:25
W net.rim.networkapi - Fats  6 - 20/12 21:54:23
¿ net.rim.udp - clos - 20/12 21:54:23
¿ net.rim.tunnel - Clos  2 - 20/12 21:54:23
¿ net.rim.dns - RetQ - 20/12 21:54:23
¿ net.rim.dns - DnsR  2 - 20/12 21:54:23
W net.rim.dns - RXst - 20/12 21:54:23
W net.rim.dns - TXst - 20/12 21:54:23
¿ net.rim.dns - DnsQ  2 - 20/12 21:54:23
¿ net.rim.tunnel - Open  2 - 20/12 21:54:23
¿ net.rim.tunnel - Read  2 - 20/12 21:54:23
¿ net.rim.tunnel - Open  (ALREADY)pId=971793349,id=2,state=3,waf=4 - 20/12 21:54:23
¿ net.rim.tunnel - Stat  2  0  1 - 20/12 21:54:23
¿ net.rim.udp - open - 20/12 21:54:23
¿ net.rim.tunnel - Read  2 - 20/12 21:54:23
¿ net.rim.tunnel - Open  2 - 20/12 21:54:23
¿ net.rim.tunnel - Open  (ALREADY)pId=971793349,id=2,state=3,waf=4 - 20/12 21:54:23
¿ net.rim.tunnel - Stat  2  0  1 - 20/12 21:54:23
¿ net.rim.tcp - open - 20/12 21:54:23
W net.rim.networkapi - Fatt  6 - 20/12 21:54:23
W Lagunex Domino - MainApp.makeMove valid=true righCorner=false - 20/12 21:54:13
... 

 

 

Please use plain text.