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
Developer
plevintampabay
Posts: 141
Registered: ‎02-27-2009
My Device: Not Specified

how can I know if I'm running in the simulator?

I've run into a problem where some of the CodeModuleManager methods do not work in the simulator.  They work fine when my program is running on a phyical device.

 

I would like to add code that avoids those methods when I'm running on the simulator.  How can my program know when it is running on the simulator?  Is there anything in the API that would tell it this?

 

 

Developer
Developer
gtj
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: how can I know if I'm running in the simulator?

DeviceInfo.isSimulator() should do it for you.

 

Developer
plevintampabay
Posts: 141
Registered: ‎02-27-2009
My Device: Not Specified

Re: how can I know if I'm running in the simulator?

Looks good - thanks!