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

Native Development

Reply
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: Using the new NDK versioning macros to detect API versions

[ Edited ]

Thanks, dkonigs. I already know this, but I was referring about a cleaner mechanism for this purpose.

 

Thanks, Russell for your answer. We appreciate your hard work, and we are sure you will find a good solution to this problem.

 

Thanks guys.

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Developer
jamiejulius
Posts: 49
Registered: ‎06-06-2012
My Device: Bold 9700
My Carrier: Pelephone

Re: Using the new NDK versioning macros to detect API versions

DId bbndk.h ever make its way into bps.h?

I have the gold 10.1 SDK installed and I seem to still need to include bbndk.h explicitly, which as Russell said means I'm back at square one...

Thanks,

Jamie
Please use plain text.
Developer
jamiejulius
Posts: 49
Registered: ‎06-06-2012
My Device: Bold 9700
My Carrier: Pelephone

Re: Using the new NDK versioning macros to detect API versions

Small update:

I added an empty file name bbndk.h to C:\bbndk\target_10_0_9_2372\qnx6\usr\include.

 

Not that I would normally think that touching the installed files is wise, but in this case, it seemed like the cleanest solution. 

 

Jamie

Please use plain text.
BlackBerry Development Advisor
russellandrade
Posts: 19
Registered: ‎03-18-2012
My Device: Blackberry Z10
My Carrier: Rogers

Re: Using the new NDK versioning macros to detect API versions

Hi Jamie,

   We will be making the change to include bbndk.h into bps.h so its part of the platform.  The change will be coming out in a build that is is coming out by the end of the month.

 

 

Russell Andrade
Senior Product Manager, Native SDK
Twitter : @russell_andrade
Please use plain text.
Developer
jamiejulius
Posts: 49
Registered: ‎06-06-2012
My Device: Bold 9700
My Carrier: Pelephone

Re: Using the new NDK versioning macros to detect API versions

Thanks for the update. Will gladly include bps.h instead once it's ready.
Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: Using the new NDK versioning macros to detect API versions

Any news about this?
Thanks
---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
BlackBerry Development Advisor
russellandrade
Posts: 19
Registered: ‎03-18-2012
My Device: Blackberry Z10
My Carrier: Rogers

Re: Using the new NDK versioning macros to detect API versions

Build containing the changes should be posted on Wednesday May 1 by 3pm EST.

Russell Andrade
Senior Product Manager, Native SDK
Twitter : @russell_andrade
Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: Using the new NDK versioning macros to detect API versions

Thanks Russell !!
Great work, guys. It's a great improvement for all us !!
---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Developer
BB_shi
Posts: 90
Registered: ‎03-15-2011
My Device: Blackberry 9800
My Carrier: developer

Re: Using the new NDK versioning macros to detect API versions

For my application, I need to use 10.2 api(CellularDataInterface) in 10.0 code base. So it is required to detect API version at compile time. Is it possible now in 10.0?

Please use plain text.
Developer
BB_shi
Posts: 90
Registered: ‎03-15-2011
My Device: Blackberry 9800
My Carrier: developer

Re: Using the new NDK versioning macros to detect API versions

[ Edited ]

I tried below code and it has been build successfully on Native SDK 10.0.

 

#ifdef BBNDK_VERSION_AT_LEAST

#if BBNDK_VERSION_AT_LEAST(10,_2_,0)
     //add your logic for release 10.X here where _X_ is the number
    //of a new release
     #include <bb/device/CellularDataInterface>
#elif BBNDK_VERSION_AT_LEAST(10,1,0)
    //add your 10.1 logic here
#endif
#else
   // add your 10.0 logic here
#endif

 

/***************************************************************/

 

void SampleApp::callBB10APIDetect(){

 

 qDebug()<<"callBB10APIDetect called...";

 

#ifdef BBNDK_VERSION_AT_LEAST

#if BBNDK_VERSION_AT_LEAST(10,_2_,0)
   qDebug()<<"BB 10.2 is getting called...";
#elif BBNDK_VERSION_AT_LEAST(10,1,0)
   //add your 10.1 logic here

#else
   qDebug()<<"BB 10.0 is getting called...";
#endif

#endif

}

 

when i call callBB10APIDetect() function in constructor. It is displaying only callBB10APIDetect called... on console . It seems that macro condition is not getting called.

 

It's urgent.Please help.

Please use plain text.