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
Contributor
Posts: 24
Registered: ‎06-16-2011
My Device: Blackberry Z10
My Carrier: O2

NFC antenna is turned on?

Hi,

I am working on an NFC application and would like to know if the device NFC antenna is turned on or off on the device.

 

I am using the following method to check  the same

DeviceCapability.isNFCAvailable()

 

But some times the OS if giving me wrong information.

So started looking for a class which gives exact information but could not find.

Could anyone help me.

 

 

 

Developer
Posts: 648
Registered: ‎09-26-2012
My Device: Limited Edition Z10, Playbook 16GB/32GB, Dev Alpha A/B/C
My Carrier: Mobile Vikings

Re: NFC antenna is turned on?

Can this post help ? http://developer.blackberry.com/native/reference/bb10/nfc_libref/topic/nfc_settings_t.html


A like is always appreciated,
but a nomination for BB Elite even more :-)
You can also contact me on Twitter: @ndsmyter
Contributor
Posts: 24
Registered: ‎06-16-2011
My Device: Blackberry Z10
My Carrier: O2

Re: NFC antenna is turned on?

Sorry to say that I am working on Blackberry java. The link you pointed is for BB10.

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: NFC antenna is turned on?

[ Edited ]

I've used a combination of isNFCSupported and isNFCEnabled isNFCAvailable.

 

Can you expand on the behaviour that you are seeing?

 

Thanks!

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 24
Registered: ‎06-16-2011
My Device: Blackberry Z10
My Carrier: O2

Re: NFC antenna is turned on?

Hi robbieDubya,

I need to show a customised popup informing the user to turn NFC antenna ON if it is OFF. Some times when using this method

DeviceCapability.isNFCAvailable()

it returns true even if antenna is turned off. So I cannot rely on this method.

 

Started looking for alternative methods in the API but could not find.

Hope this inormation helps.

Note : There is a method available in NFCManager.enableNFCByPrompt which might serve my purpose but I want to customise the message.

Developer
Posts: 648
Registered: ‎09-26-2012
My Device: Limited Edition Z10, Playbook 16GB/32GB, Dev Alpha A/B/C
My Carrier: Mobile Vikings

Re: NFC antenna is turned on?

Whoops, sorry my mistake.

I don't have a lot of experience in Java Development, but there will be probably somebody more experienced who can help you.
I hope you can find a solution to your problem.


A like is always appreciated,
but a nomination for BB Elite even more :-)
You can also contact me on Twitter: @ndsmyter
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: NFC antenna is turned on?

Should be accurate, can you confirm which build is running on the device(s) where you're seeing this behaviour?

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 24
Registered: ‎06-16-2011
My Device: Blackberry Z10
My Carrier: O2

Re: NFC antenna is turned on?

Device : Blackberry 9900

Build : 7.1 Bundle 2061, (v 7.1.0.714,platform 5.1.0.532)

 

Most of the times it gives me correct NFC antenna status, but at times api gives me wrong information.

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: NFC antenna is turned on?

Do you have any steps to reproduce?

--
Rob is no longer associated with BlackBerry.
Highlighted
Contributor
Posts: 24
Registered: ‎06-16-2011
My Device: Blackberry Z10
My Carrier: O2

Re: NFC antenna is turned on?

No particular steps, it occurs randomly.