NFC NDEFMessageListener - ControlledAccessException again!

Set IV to develop an application that involves a simple NFC tag read.

When I try to add a NDEFMessage listener to a the ReaderWriterManager objectof I

Get the above error!

The code was working fine but when I added the most advanced code he divided the app in

several .cod files, after that reading several posts on this topic, it seems that there is a bug in

the version of the 7.0.0.335 software which has now been corrected in the version 7.0.0.337 (forgive me if these version are not accurate im just recalling the memory).

However im using a device of 9360 with software version 7.0.0.353

and im always getting this error!

After reading the posts, I tried several options with the NDEFMessagelistener... I put it in its own class, I put it in a class of the screen, with the same results... the listener currently resides in the main application class. It was originally (when it worked)

It is the line that does not work, the error is:

the listener:

(NdefMessageListener mMsgListener in overall)

 mMsgListener = new NDEFMessageListener()
        {

            public void onNDEFMessageDetected(NDEFMessage msg)
            {
                try {
                    NFCManager.getInstance().playNFCOperationSuccessSound();

                    byte[] mByte = new byte[mDataRecord.getPayload().length];
                    mByte = mDataRecord.getPayload();
                    //gets the mac address from the payload and dumps it in mMacAddress
                    mMacAddress = new byte[6];

                    for (int a = 0; a < 6; a++)
                    {
                        mMacAddress[a] = mByte[a + 1];
                    }
                    } catch (NFCException e) {
                    try {
                        NFCManager.getInstance().playNFCOperationFailureSound();
                    }
                    catch (NFCException e1)
                    {

                    }

                    UiApplication.getUiApplication().invokeLater(new Runnable()
                    {
                        public void run()
                        {
                            dialogDisplay("Error Getting NFC Tag Data");
                        }
                    });
                }
            }
        };

This code takes the listener:

            NFCManager.getInstance().enableNFCByPrompt();
            mNFC = ReaderWriterManager.getInstance();
            //tag type for out
            mNFC.addNDEFMessageListener(mMsgListener, NDEFRecord.TNF_EXTERNAL, "nokia.com:bt" , false);

I get this in the console:

[693.281] CMM: TapnPrint-2 (27242) No sig 0 x 33

to the point correct the fault and well sure the:

ControlledAccessException

Exception, if there is someone who has solved this problem or knows a solution I'd love help

as it has caused my app to hit a brick wall!

Make sure you only check the post following the correct minimum version necessary to 9900 or 9360 as it has been updated today:

http://supportforums.BlackBerry.com/T5/Java-development/listener-belongs-to-another-application-MODU...

Tags: BlackBerry Developers

Similar Questions

  • My iPhone needs a 'NFC SIM"?

    I know that my SE "works" with my old SIM, but I need a NFC SIM card for the full feature/best security?

    (I have not yet used, or tried to use all the FEATURES 'NFC' again)

    N °

  • 1200W NFC: new HP Officejet 100 with NFC 1200w slow printing

    I have been using a 1200w NFC to connect a HP officejet 100 mobile printing from my IPhone 6. The first impression would take less then 30 seconds to complete.  I had to get a new printer and 1200w, but the first impression now takes more than 3 minutes.

    I tried to update the drivers, but printing is still slow.

    I found the solution on youtube.

    "It is a problem with most recent firmware HP published to the 1200w, which included Secure active by default printing. Newly purchased of 1200w, as well as those who are upgraded to the new firmware, can experience this problem. To speed up the printing process, follow these instructions. Secure print crypt the print job and it unencrypts then to the printer, which adds a lot of time to print.

    Go to 192.168.223.1 in your iphone browser when you are connected to the printer. It comes to the management for the 1200w page. Click on "Network" and then click "Advanced settings". In the box "Enable the IPP", click the menu drop down and select "PIP Only". Click "Save". Restart the 1200w. Your print jobs should be fast again. »

    Thanks for you help and I hope that this post helps to another.

  • The cover of Style without NFC matching

    Hello

    I have reset my Z3 + dual and I want to pair my phone with the cover of style SCR30 again.

    Unfortunately, I have to take off the phone of the coverage of the NFC match user, I don't want to do because some say back feeding of the ould hard cover paste it again...

    is another way that NCF matching to get coverage for my style of work? (I have install Xperia theme Style coverage but it not the installer of the cover, only the theme).

    concerning

    Olivier

    It should work, you can actually pair the phone with one of the windows of cover Style (SCR30, SCR26 or SCR24) and it should work with your current. It is an option, find cover and pair your phone is attached to your.

  • NFC and direct Wifi does not

    I haver tried nfs and direct wifi on my z3.

    But today decided to try the brothers samsung galaxy s4.

    The problems:

    I can send files using nfc to s4 but s4 is not able to send anything for me via nfs. Quite strange!

    If force us again and again, only google game store opens automatically.

    We enabled wifi direct on our phones and it showed connected as well.

    But whenever we try to share whatever it is, it says "failed to send ' after a while on the S4.

    And on my phone it doesn't do anything even though it shows always connected in Wifi settings live.

    I tried using Commander file, select file, send via wifi direct, the s4 as connected watch and when I click it it that nothing happens at all!

    So, what's the use of direct Wifi on Z3?

    In this case seems to be the S4, I was able to transfer files between Z and Z1 Z1 with a Z3, I had hit and Miss with Xperias and samsung, but not with the Xperias and other androids.

  • start / stop NFC programmatically

    I am able to start / stop Bluetooth of cascades

    Is there a way to start and stop the NFC by programming?

    It has enabled for a business application in the perimeter of work where the NFC should automatically /disabled.

    THX

    Rodger,

    Thanks again. It works well - even in the scope of work

    Integrate this way:

    At STARTUP after UI is created from a QTimer delayed in QML, I call checkNfcState:

    void ApplicationUI::checkNfcState()
    {
        mPpsObject = new bb::PpsObject("/pps/services/unifiedradiomgr/status?wait,delta", this);
    
        bool res = connect(mPpsObject, SIGNAL(readyRead()), this, SLOT(onPpsReadyRead()));
        Q_ASSERT(res);
        Q_UNUSED(res);
        if (!mPpsObject->open(bb::PpsOpenMode::Subscribe)) {
            qWarning() << "E K K E  Could not connect to Radio object: " << mPpsObject->errorString();
        }
    }
    

    and here's the SLOT:

    void ApplicationUI::onPpsReadyRead()
    {
        bool readOk;
        QByteArray data = mPpsObject->read(&readOk);
        if (!readOk) {
            qDebug() << "N F C  !readOk";
            return;
        }
        bool decodeOk;
        const QVariantMap map = bb::PpsObject::decode(data, &decodeOk);
        if (!decodeOk) {
            qDebug() << "N F C  !decodeOk";
            return;
        }
        const QVariantMap ppsFile = map["@status"].toMap();
        if (ppsFile.isEmpty()) {
            qDebug() << "N F C  !ppsFile.isEmpty";
            return;
        }
    
        QString state;
        state = "nfc";
        if (ppsFile.contains(state)) {
            QString nfcValue = ppsFile[state].toMap()["state"].toString();
            qDebug() << "N F C   current   STATE: " << nfcValue;
            if(nfcValue == "OFF") {
                emit nfcOff();
            }
            disconnect(mPpsObject, SIGNAL(readyRead()), this, SLOT(onPpsReadyRead()));
            mPpsObject->deleteLater();
        }
        return;
    }
    

    As soon as I get a State NFC I disconnect subscription because there is already an NFC events bps events loop, where I'll be notified if NFC pass in review status:

    void ApplicationUI::handleNfcEvent(bps_event_t *event)
    {
        uint16_t code = bps_event_get_code(event);
        nfc_event_t *nfcEvent;
        nfc_target_t* target = NULL;
        nfc_result_t rc;
        uchar_t id[20];
        size_t idLength = 0;
    
        switch (code) {
            case NFC_TAG_READWRITE_EVENT:
                ....
                break;
            case NFC_SNEP_CONNECTION_EVENT: {
                ....
                break;
            case NFC_NDEF_PUSH_SUCCEED_EVENT: {
                ...
                break;
            case NFC_NDEF_PUSH_FAILURE_MSG_OVER_SIZE_EVENT: {
                ...
                break;
            case NFC_NDEF_PUSH_FAILURE_REJECTED_EVENT: {
                ...
                break;
            case NFC_NDEF_PUSH_FAILURE_IO_ERROR_EVENT: {
                ...
                break;
            case NFC_ON_EVENT:
                ...
                break;
            case NFC_OFF_EVENT:
                ...
                emit nfcOff();
                break;
            default:
                ...
                break;
        }
    
        // don't forget to delete the target
        if (target != NULL) {
            nfc_destroy_target(target);
        }
    }
    

    It works fine now.

    As yet I had no information if there is a way to start the NFC programmatically open settings NFC detection NFC OFF if:

    void ApplicationUI::nfcSystemSettings()
    {
        InvokeRequest cardRequest;
        cardRequest.setUri("settings://nfc");
        cardRequest.setMimeType("settings/view");
        cardRequest.setAction("bb.action.OPEN");
        cardRequest.setTarget("sys.settings.card");
        mInvokeManager->invoke(cardRequest);
    }
    
  • WebWorks, NFC and OS7.1 Java plug-in compatibility

    Hello

    I worked on building a WebWorks app that uses an extension of java to access certain NFC of OS7.0 functions.       OS 7.1 added functions that I would use it as well related to a number of NFC, but adding one of these new features gives me a CAP error when I try to package & sign in undulation.  I guess it's because the current SDK WebWorks support adding these new features of 7.1 as extensions again... what what happens?  Any idea on a time when WebWorks will be updated to support the new functions of 7.1 if this is the case?

    Thank you

    Drew

    I don't know when the final version of WebWorks support 7.1, but it's an easy thing to fix. You must change the net.rim.api.jar that refers to WebWorks which can be done in two ways.

    1. Replace the file real net.rim.api.jar found in the lib folder of your installation with the edition 7.1
    2. Edit the bbwp.properties file in your bin folder to point to the version 7.1 instead of the lib folder.

    Just for that you realize, that it is already an extension NFC community that supports MS tags here - https://github.com/blackberry/WebWorks-Community-APIs/tree/master/Smartphone/NFC . If you have knowledge, it would be great if you helped to complete since this way the API would support to 7.0 instead of 7.1 just.

  • Questions BB10 NFC P2P/SNEP (ping: mwoolley / jomurray)

    Hi Martin, Jo and all.

    I'm doing some research development trying to validation of data transfer between an Android (Galaxy Nexus - 4.0.1) device and the Alpha of Dev BB10 via NFC P2P/SNEP.  I grabbed your NfcTool and was able to transfer a vCard from the Alpha to the Android smoothly - vCard mailing (SNEP) running in the results of the tool in the Nexus receiving the vCard and saving it as a contact.  It's the other way I have problems with...

    I created a new task in the NfcTool by the framework of the task of duplicating sending vCard, stripping out and giving me a sandbox to play in.  On the side of Android, I wrote a trivial little activity to use the

    setNdefPushMessageCallback() method to send a TNF_WELL_KNOWN RTD_URI message.

    In my NfcWorker: prepareToTestSnep() I called him nfc_register_ndef_push(), and in my::handleTestSnepEvent() NfcWorker I get successfully NFC_NDEF_PUSH_EVENT code every time I put the devices back to back and touch the screen of the Android.

    The problem is, as far as I know, there is no method of support on the side of the operation of the SNEP (!) reading.

    The call to nfc_get_ndef_message_count() in parseNdefMessage() returns 0, so there seems to be no messages actually receive at this point, without doing anything else... I don't know what method to call or what to do to receive the message of the Android.

    As far as I know, the call of nfc_register_ndef_push() only lets you configure to be able to do a nfc_create_ndef_message() to send, but is not the right thing to you set up to make a reception.

    Can someone please shed some light on how the side reception of the SNEP transaction is performed on BB10 or if it's even possible yet?

    I've tried everything I can think, swim around in that time service of NFC platform without papers, without success.  I've implemented nfc_register_ndef_reader(), nfc_register_tag_readerwriter(), nfc_llcp_register_connection_listener(), but no matter what, I get only the NFC_NDEF_PUSH_EVENT code when devices are in the range, and it seems there is no way to receive the data.

    Please inform me!  Thank you!

    Ryan

    Hey once again Martin,

    I really appreciate the effort you spent on another tool tests and writing / confirming the SNEP feature in the Dev Alpha.  Your confirmation it works gave me encouragement to continue trying to get this to work - and I finally did!  As a result, I have some great results to share:

    The problem was not with the format of the URI registration, which was quite valid (TNF type 1, completely adhering to the definition of the Type of folder URI NFC Forum RTD - URI 1.0).  Has not solved the problem by trying a text record type instead.  The problem did not manifest itself between two Android Galaxy Nexus, who had no problem exchanging URI, text documents, etc.

    The problem was this: the NFC on my Dev Alpha does NOT work correctly when the device is connected to the computer via USB!

    It is a conclusion that is always reproducible.  When I reboot the Dev Alpha and never connect it to the computer, I can run the NFCTool and read properly URI valid TNF_WELL_KNOWN and text documents sent from the Android device.  If at any time I connect it to the computer, this feature stops working entirely and will resume only if I turned the unit off and it reboot again without connection to the computer.  I can't just unplug it without restarting, because it does not address the issue.

    Well, then!  Is this a known fault?  This documented anywhere?  Is this a fault with all Alphas Dev or just that we received?  Y at - it solution to address the State of the NFC system without requiring the long reboot of the device?  I'm really intrigued to hear what you / RIM have to say about it.

    I'm not happy all the time lost to spin my wheels with a configuration that was destined to never function properly... but on the other hand, I am incredibly relieved that I figured out the problems and can begin to move forward with development.  I hope that others can benefit from my troubles!

    Thanks for your help Martin - I'm happy just having someone to keep with me through this fiasco.  Ciao for now.

    Ryan

  • Peer-to-peer NFC - how to send multiple messages?

    I am able to send one message from a device and read on the other.

    I wanted to do a handshake 3 channels using NFC, my goal was to have:
    -App 1 writes a tag that begins app 2 served if it does not work
    -App 2 sends a piece of application data 1
    -On receiving app 1 sends another piece of data in response to app 2

    To receive the data, I use a
    invoke targe
    -With a:
    - Then I connect to InvokeManager::invoked, in which I extracted the payload

    To send the data, I use
    -nfc_create_ndef_record (NDEF_TNF_EXTERNAL
    -nfc_push_ndef_message
    -J' use the nfc_target_t that I get in the NFC_SNEP_CONNECTION_EVENT event.

    I'm able to push the message immediately NFC_SNEP_CONNECTION_EVENT, or later in an asynchronous event.
    But I can't push the message twice, otherwise it is received only once

    I have not found a way to use the native functions of nfc_ * to read the data of the NFC. I call nfc_register_tag_readerwriter (TAG_TYPE_NDEF), but AbstractBpsEventHandler::event is never called

    Hi Martin

    Unfortunately you can not send multiple push messages in the context of a single NFC "tap." You must have the users of separate devices and tap again before you can send your second push message.

    The way alternative and probably better to implement your handshake is to use LLCP.

    I work on a sample of code for this right now and will be published as soon as possible.

    Concerning

    Martin

  • ControlledAccessException

    I install my application through CodeModuleManager.every thing works very well, but at the start of my application throws an exception when it reaches app.addGlobalEventListener (app); and the exception is ControlledAccessException. can someone tell me why I get this exception

    Options / Security / Application permissions, the value 'Allow' and try again.

  • NFC Interaction between BB10 and Windows Phone 8

    Hello

    NFC Peer communication Peer is not the case between BB10 and Nokia Lumia 820 (phone 8 window).

    communications made using the Protocol of the SNEP.

    My request in BB10 able to receive Windows Phone data, but the application in windows phone 8 does not receive the data of BB10 when app in BB10 writing data on it.

    WIndows Phone 8 application works very well (to receive and write data) when I hit with BB 7.1 (curved) Mobile, does not work with BB10.

    app in BB10 works well with all mobile BB, the problem only comes with Windows phone 8. But I could not face this kind of problem with BB7.1.

    Problem is that when I type BB10 with Windows phone 8.

    If a question is existed in app BB10, it should not work with mobile BB

    If a question is existed in Windows Phone 8 App, it won't work with BB 7.1 Mobile also.

    I don't come to the solution where the problem is present.

    Please let me know where is the problem?

    Hello

    I got a more or less immediate response from BlackBerry NFC dev team. There are a number of problems known, all rooted in problems with the device of Lumia. I am told that the NFC open P2P connection Bluetooth transfer on the Lumia is inconsistent with the NFC Forum specification. In addition, there are a problem whereby the Lumia P2P server hangs when used with BlackBerry 10. Once again, our engineers are categorically that the problem is with the Lumia. BlackBerry 10 P2P works very well with devices Android and other Nokia devices.

    Concerning

    Martin

  • Code sample NFC in the development guide does not

    Hello.

    I just wrote a quick Hello world app for reading and writing NDEF records, based on the code provided in the development Guide.

    I use the MiFare Ultralight tags. However, it does not work.

    I could write NDEF only once during the tests, but after that I was unable to write the tags again or delete them using my application. However, the application of NFC demo included with the BB is able to write.

    Thinking that the tag doesn't have enough space to store the nested NDEF message of the dev guide, I changed the code (reader and writer) use only a title and url records, without success.

    I also tried to change the parameter listener of NDEFRecord.TNF_WELL_KNOW to NDEFRecord.TNF_ANY, so read the labels already written with the demo included in the BB application, but it has no effect. I have read that sporadically with the two types, but most of the time the BB does not detect everything just the tag.

    Now, I know that:

    • The tag is readable and writable, because I read and written in the plain format ISO-14443-3 and the BB demo readings and Scripture in NDEF.
    • The tag is unlocked and able NDEF (inspected a target using DetectionListener object)
    • A few times I was able to write an NDEF tag, but then it is not readable by my application nor by BB demo group.
    • I have read several times, but most of the time it fails.
    • Tried to erase the label before writing, but does not work.

    I use exactly the same code that appears in the development guide and a BB 9360.

    Finally, I solved the problem. It turns out that my tags (Mifare Ultralight) have only 64 bytes of total storage, so the example NDEFMessage in the development Guide (root NDEF Sp record with two folders nested inside) is too big to be stored when the text exceeds a few words.

    With regard to the NDEFTagConnection class, I found that the erase method throws exceptions, and that the append method is problematic. The only method that worked for me was the write method (who wrote the entire tag).

  • Re: NFC Mifare Ultralite

    Hello

    I tried the sample application in samples of blackberry, but I got an error (error NDEF data exchange) during the test of a Mifare Ultralite application. I read document Mifare Ul in this memory trace is described as pages. but I couldn't find a api to communicate with card Mifare Ul. And the target type is detected as NDEF format. But I do not understand how to communicate, write and read data from the card, to read and write data, I need to mention the page number is not t he? With the help of API of NDEF how write and read data in particulat page? What lock bytes and bytes OTP? How can I develop code for Mifare UL...?

    Please help me I am new to BB - development of the NFC.

    Reading and writing Mifare Ultralight tags should be simple, because they are a standard tag of type 2. Please take a look at our article on this topic that is listed in the index of NFC developer article here:

    http://supportforums.BlackBerry.com/T5/Java-development/NFC-article-and-code-index/Ta-p/1538775

    You will find that there are high level API for reading and writing of NDEF tags, and you don't need to worry about the structure of memory to the page/block level.

    We also provide applications open source for the reading and writing tags and you can download the complete source of our GitHub repository, which is also linked from the page above.

    Please post again if you still need help.

  • Mail and gmail don't agree in the Sierra, once again.

    I had resolved all the gmail against messaging problems in El Capitan, but after upgrading to Sierra problems are back.

    When I write and send an e-mail message, I find myself with a project in gmail attached to the messages thread which is waiting, despite having sent in Mail. The message is sent, but it remains as a draft in gmail. If I delete those, I'm deleting my copy of the message sent in gmail, but if I send them from gmail I'll send the same e-mail twice.

    Any who see other related issues with Mail and gmail to disagree again?

    I noticed that they have changed the settings in mail preferences you must specifically choose folder where you want to that mail to store drafts in. I have changed (back) to save them locally, which is always annoying, but I hope it will help with future messages, but what about all these projects message already sent? If I remove them, gmail sync sent versions of mail or delete?

    How did the years and years pass, and Apple can't do gmail and work well together? Is not gmail so widely used they would have fixed this now?

    I have problem with my IMAP accounts additional air currents. I suggest that you create a new user to test.

    Try to set up a test account, see if the problem is global, or just linked to your account.

    CREATE A NEW USER

    Go to system-> Preferences, create a new user in users and groups.

    Switch to the new user by logging incoming/outgoing or use the fast user switching.

    You can skip signature with your Apple ID, unless you test iCloud Mail.

    By default only the applications Apple will be in the dock in the new user. Go to Applications to open other apps, that you can test.

    If you see the same question in the new user, report it to the comments of the Apple in order to be connected and put in the queue to be fixed.

    http://www.Apple.com/feedback/MacOSX.html

  • If I purchase Logic Pro 10 now and later if apple releases Logic Pro 11 so should I buy the new version again or can I just switch to it free?

    And also how many sounds do I get with the Logic Pro 10.

    Is more than Garageband? If yes then how much more?

    Hello

    If you buy LPX now, and Apple should release LP11, you will probably have to buy it again (like us all).

    Regarding your other questions, A) Yes, B) charges

    These links should help provide the answers

    http://www.Apple.com/Mac/GarageBand/

    http://www.Apple.com/Logic-Pro/

    http://www.Apple.com/Logic-Pro/specs/

    TDC

Maybe you are looking for