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

Adobe AIR Development

Reply
Contributor
sillyPanda
Posts: 42
Registered: ‎02-23-2011
My Device: Not Specified

How to check whether the target is simulator or real device

Hi All,

 

Is there a way to check whether the target is simulator or real device?

 

Thanks

Please use plain text.
Contributor
sillyPanda
Posts: 42
Registered: ‎02-23-2011
My Device: Not Specified

Re: How to check whether the target is simulator or real device

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How to check whether the target is simulator or real device

There are multiple ways to do it, so that's certainly "a" right answer.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
sillyPanda
Posts: 42
Registered: ‎02-23-2011
My Device: Not Specified

Re: How to check whether the target is simulator or real device

Thanks Peter.

 

Loading Capabilities causes lots, which I would like to avoid. Is there another easy way to do it?

 

Thanks

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How to check whether the target is simulator or real device

"Causes lots" of what?

Can you explain what you're trying to do in more detail, so we can provide a better solution if there is one? You haven't given any reason yet why this approach should be a problem for you.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
sillyPanda
Posts: 42
Registered: ‎02-23-2011
My Device: Not Specified

Re: How to check whether the target is simulator or real device

:-)  How bigger is the Capability? If we can avoid loading bigger class, should we do it?

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How to check whether the target is simulator or real device

I have no idea how big it is, but I try to avoid "premature optimization".

 

Given what that class does, it seems unlikely it's going to add much to your app, but if you're concerned, why not just try a build with and without it, and see for yourself?


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
sillyPanda
Posts: 42
Registered: ‎02-23-2011
My Device: Not Specified

Re: How to check whether the target is simulator or real device

Thanks Peter for your suggestion. I will do that for sure.

 

Go back to my original question, Is there another easy way to detect whether target is simulator or is a real device?

 

Thanks

Please use plain text.
BlackBerry Development Advisor
jdolce
Posts: 172
Registered: ‎10-25-2010
My Device: Not Specified

Re: How to check whether the target is simulator or real device

Yes this is the correct way to determine if you are running in the simulator or on the device.
Please use plain text.