Problem with the receiver of messages in Backgroundlisterner Application user interface Thread

Hi all

I have a UI application with earpiece in the background with MessageListener interface and I'm regestering it to receive Notification of incoming text Messages on a particular port.

But the notifyIncomingMessage() is never called and sms always comes in the Inbox.

If using port 8855, and

_mc = (MessageConnection)Connector.open("sms://:8855");
_mc.setMessageListener (this);

Detail of my code.

I have one user interface application with the other point of entry, in the background I register mylistener, so he notifys me message inbound, and then I can launch my application with user interface.

Code:

My Application user interface.

public static void main(String[] args)
    {

        if(args != null && args.length > 0 && args[0].endsWith("gui"))
        {

            MyUiApplication mb = new MyUiApplication();
            mb.enterEventDispatcher();
        }
        else
        {
            //Entered through the alternate application entry point
                BackgroundListener.waitForSingleton();
        }

    }

And my bottom Lisnter looks to...

public class BackgroundListener implements PIMListListener, javax.wireless.messaging.MessageListener

public BackgroundListener()
    {
        try
        {
            System.out.println("Adding the Message Listner");
            //Implementing the Message Listner:
            _mc = (MessageConnection)Connector.open("sms://:8855");
            _mc.setMessageListener(this);

        }
        catch(Exception e)
        {
        }
    }

public void notifyIncomingMessage(MessageConnection conn)
    {
        System.out.println("BBBBBBB Received the SMS,Read Message Thread Start BBBBBBBBBB");
        Logger.log(DEBUG, "BBBBBBB Received the SMS,Read Message Thread Start BBBBBBBBBB");
        //startMessageReadThread();

        new Thread()
        {
            MessageConnection connection;
            Thread set (MessageConnection con)
            {
                this.connection = con;
                return (this);
            }
            public void run()
            {
                try
                {
                    Message m = connection.receive();
                    String msg = null;

                    if (m instanceof TextMessage)
                    {
                        TextMessage tm = (TextMessage)m ;
                        msg =tm.getPayloadText();
                    }
                    if (msg.equals(CBConstants.SMS_CMD_SYNC))
                    {

                    }
                    //if ()
                }catch(Exception error)
                {
                    System.out.println(error.getMessage());
                }
            }
        }.set(conn).start();

    }

public static BackgroundListener waitForSingleton()
    {
        //Ensure this is a singleton instance.
        //Open RuntimeStore and obtain the reference of BackgroundListener
        Logger.log(DEBUG, "In the Listener class");
        RuntimeStore store = RuntimeStore.getRuntimeStore();
        Object obj = store.get(RTSID_LISTENER_ID);

        //If obj is null, there is no current reference to BackgroundListener
        //Start a new instance of BackgroundLIstener if one is not running
        if(obj == null)
        {
            Logger.log(DEBUG, "In the Listener class obj is null so newBackgroundlistener");
            store.put(RTSID_LISTENER_ID, new BackgroundListener());
            return (BackgroundListener)store.get(RTSID_LISTENER_ID);
        }
        else
        {
            Logger.log(DEBUG, "In the Listener class, already a instance so will return the obj");
            return(BackgroundListener)obj;
        }
    }

Can someone please suggest me where I am doing wrong.

I also saw all the methods for sms listening, with the datagram and messagelistener.

As this will be contineously run in the background, I thought about MessageListener.

Any help appreciated.

Thank you

Anne Laure

I received the demand for labour,

I changed the port to '0', although it is in the Inbox. But now its okay for me, because the unit does not receive it IDE oucederomsurlesecondport 8855.

Thank you

Anne Laure

Tags: BlackBerry Developers

Similar Questions

  • Having a problem with the script error message

    The error message and web page script error every move I make now. I tried to check and uncheck boxes tab in advance internet options. I also ran a check of the system that did not help either. Any suggestions? Thank you

    Hi Mic,

    From the description, it seems that you have a problem with the script error message in Internet Explorer.

    To better understand the question, please answer the following questions:

    1. is specific to a particular Web site question?

    2 have you made changes on the computer before this problem?

    3. What is the exact full error message and web page of script error message?

    4. When you get exactly the script error message and web page error message appears?

    5. what exactly you're talking about when you say "system check"?

    See the article mentioned:

    How to troubleshoot script errors in Internet Explorer

    http://support.Microsoft.com/kb/308260

    Hope the above information is helpful. If you have any question back to us, we are happy to help you.

  • my iPhone 6s has problems with the GPS when I use some applications, it does not work well and give especially the bad road. Can someone help me?

    my iPhone 6s has problems with the GPS when I use some applications, it does not work well and give especially the bad road. Can someone help me?

    My iphone 6 has started having the same problem. Its literally the GPS. Saying that it does not find me at all. Ive seen say location for more than an hour in the suburbs of chicago. It started to happen to me after I downloaded the latest update for the iphone. I hope they react and let you know what is happening because I'm dying to know as well.

  • problem with the drive skypoker, message reads. ascipt in this movie is causing flash player 9 to run slowly, your computer can become unreponsive. all other programs are OK

    Ideas:

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    stewartmac,
    Since this problem only occurs with the SkyPoker website I would say check with their support for all the problems they know.  Here is a link I found on their site that contains information on this subject.  http://help.Skybet.com/display/4/KB/article.aspx?aid=1227&n=1&docid=188546&tab=search

    Also, make sure you have the latest version of Flash Player.  If you are using IE8 then you can set this page Web is running in compatibility mode.  Here's an article that explains the IE8 Compatibility mode: http://support.microsoft.com/kb/956197/ Mike - engineer Microsoft Support responses
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Problem with the MDB warning messages layer.

    Hello

    I modeled with the following tables in MDB layer.
    Dimension of table: country, departments, regions, communities, employees, jobs, history of the work
    Fact table: facts of HR (columns measured as salary, salary max, min salary, commission)

    The model is compatible with the following warnings:

    Logical dimension PARTS table has a source of REGIONS which do not adhere to any source of fact.
    Logical dimension DEPARTMENTS table has a source DEPARTMENTS that do not adhere to any source of fact.
    Logical dimension COUNTRY table has a source from COUNTRIES that do not adhere to any source of fact.
    Logical dimension LOCATIONS table has a source LOCATIONS that do not adhere to any source of fact.

    and also in the answers (presentation services) section, that I could not able to view the data, it gives the following error (when I try to display the field values of NAME of REGION)

    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 14026] Unable to navigate the requested term: REGIONS. REGION_NAME. Correct metadata consistency warnings. (HY000).


    I couldn't able to trace the problem where exactly should be fixed.

    concerning
    Chandra Khalil.

    The reason why you are getting the result today is that alteast now is an indirect join between employees (salary containining table column) and the table Region (properties, regionName containing table column). i.e. through departments and situation Contries. If you can get out the physical sql and verify a query (for the report that contains columns of the region and salary), you will notice that the region and employees aren't the only paintings recovered in the query. Here, even the other paintings Department, city and country are included in the clause to provide appropriate data. It makes sense because if you manually really want to write the query to obtain details of salary and the region, you will need to include all of these paintings in your from clause.

    Thank you

  • Problems with the ColdFusion Extensions and CF/Flex Application Wizard

    I configured the Eclipse RDS according to the instructions in the help documentation. The RDS Fileview and Dataview work OK, but I did have luck with the browser Services: when I try to increase (+) the element localhost, the only thing that appears is the message "Unable to get the metadata for CFCs."

    The components Panel in Dreamweaver 8, which has exactly the same information, works very well.

    Perhaps related to the above: when I create a Flex with the CF/Flex Application Wizard project and examine project properties, in the Flex Server section, I get "because this project does not use a server, these settings do not apply. I find it strange: a ColdFusion project that does not use a server? In any case, the wizard, I not was able to create a simple project that works.

    If anyone has had similar problems and was able to solve them, I would be grateful little light on the subject.

    Carlos

    Well, I could solve this problem by CF UN-installing and reinstalling.

    I did some more tests (UN/reinstall once again) and it seems that this problem occurs when CF is installed in devnet version mode and not if in developer mode.

    To check if CF is installed in devnet mode look in the administrator of the CF under "server settings-> analytical settings-> version information", you will see a notation for devnet.

    I also did a little poking around and it happens whenever you install CF using a certain range license keys. The keys of this range are valid keys for installation, but they alter some critical parameters in CF (watermark paper/pdf flash and apparently some RDS stuff), the solution is to install with a key dev-net or in developer mode.

  • Guys have a problem with the Panel, whenever I have open application in there, says Windows cannot find rundll32.exe I can do...?

    I tried the following things...
    Tried the expand command given in your site... nothing happened... a cmd windows opened and closed...
    Then, I tried to expand the file to another drive and tried to copy in the system32 folder... Access denied.
    I tried to use the command line to copy the file into the sytem32 folder... problem of the soul again. Access denied...
    I found a copy in the file $ $ntservicepackinstall or the Dllcache folder...
    Then I tried the repair option by using the... used xp CD and tried to unzip the file in the system32 folder, nothing happened...
    I started with a linux distribution, tried copying the file...
    Miracle I found it in the system32 folder...
    So I rebooted using Windows XP and searched for the file but I can't find...
    Help me please...
    I'm just a learner...

    It's me aruldd...
    It is myself...
    It was due to a software called 'lock folder xp', just now uninstalled, rebooted and wow the pc works fine...
    Thank you...
    Kind regards
    Aruldd

  • Problem with the HP 430 (bluetooth and teredo tunneling Pseudo-Interface) drivers

    Hello

    recently my bluetooth function cannot to connect to other devices... This is what happens to the Device Manager:

    What is teredo tunneling pseudo-interface is for? is it important?
    If so, how to solve this problem?
    How to solve the problem of the bluetooth?

    Generic Bluetooth adapter:
    USB\VID_03F0 & PID_311D & REV_0001
    USB\VID_03F0 & PID_311D

    Teredo tunneling pseudo-Interface:

    * TEREDO

    Go to Device Manager, right click on the device and select Update driver. Path to the .inf file that you downloaded for use.

  • Problem with the display new message and forward messages in outlook express

    I have Windows xp, IE 8, outlook Express 6.0.  A few days before, Outlook express auto off refreshing, corrected, but now when I try to foreword or send a new message, the message is barely visible on the right side of my screen.  I can only move it by right click on the mouse is on the edge of the screen, and maximize hitting her, then it's full screen.  Other users on that account appear correctly, screens.  How can I get the screen to display correctly

    Right-click on the tab of the window in the task bar and select move. Now, use the arrow keys to get to the screen. Close all other windows except this one and use the cursor to drag the message to the desired size. File | Output and Windows will remember the size and location when you open it again.

    So who disobeys, try in a new identity. File | Identities | Add the new identity. Create a new one and try it. If all goes well, you can import your messages and address book from the old identity and delete it.

    Note: Do not use the main word in the name of the new identity.

  • Problems with the law in a native android application service.

    Hello

    I assemble version native android app 31, but law service does not work.

    When I try to log in with my test account, I get the message login or password are incorrect. Legacy android app works correctly.

    Law Branch does not DPS Android app that was built as a Native version 31 application.

    I still got the message that login or password is incorrect when I try to log in with my test account.

    A same application works correctly if it was built as a legacy android app.

    Where can be a mistake?

    Thank you.

    When you last built the native android app? Until this morning the app only supported direct v2 of the API right, and I'm guessing that your service uses v1.

    The good news is we delivered our latest publication this morning and v1 is now supported. If you rebuild your application in the App Builder and try again it probably will work.

    Neil

  • Problems with the update of CS6 of Adobe Application Manager

    Hello. I already bought and installed Photoshop CS6. A few days ago, I signed up for but also signed up for the monthly subscription of CC in order to get all updates and future versions. As soon as my Adobe Application Manager has been installed it tells me that a few updates were available and that they have downloaded and installed correctly. Yesterdat I was tild that another major update was available. No problem to download, but the payment is interrupted and told me that the update failed. Journal error reports attached:

    13.1.2 for cloud creative Photoshop

    Failed installation. Error code: U44M1P7

    Hope someone can help. Thank you.

    Please refer to the solution mentioned in the following threads:

    http://forums.Adobe.com/message/5396792#5396792

    http://forums.Adobe.com/message/5409050#5409050

  • OfficeJet 6600 - reports HP Connect "problem with the printer.

    I just bought an all-in-one OfficeJet 6600 and immediately installed on my MacBook Pro. Installation went smoothly, and I used it for scanning and printing. I am very happy. However, I noticed that HP Connect reports "Issue with printer." Well, it worked fine, so I ignored the error and continued to work.

    Tonight, I have installed the printer on a Windows 7 laptop. At HP Connect, it is always now reports "Problem with printer." That's it - no further details and no symptoms of any kind of problem. How to diagnose the 'problem' and how to fix it?

    Hi there, I know this may seem illogical, but I wouldn't worry too much about the problem with the printer State message in connected HP. I saw myself sometimes, and I was able to print successfully from a mobile device to the printer which connected HP indicated that there is a problem. Have you tried to send a job by using either the application mobile ePrint or to the e-mail address of printers for the printer in question?

    On the Windows 7 machine, you can also download and run the HP print and Scan Doctor to confirm there is no problem with the connection to the computer on which is installed the software of the printer or the printer hardware. Be aware, however, that the application is compatible with the Windows operating system only, so you cannot run it on the Mac computer, but unless you are having problems printing from Mac to the printer, there is no reason to suspect that anything is wrong.

    Hope that makes sense, but post comes back with other questions.

    Best.

  • Problem with the ISATAP #3 map

    Hi I have a problem with the ISATAP #3 card. I read a previous thread who recommended to uninstall and then put it back, which I've tried, but the pilot does not re - installed. Can someone help me with this? Thank you

    Jack

    Hello

    Control Panel - Device Manager - do a right-click on the two - UNINSTALL - REBOOT

    Nothing else to do, Windows will do the rest. And you can ignore the errors altogether if you want and
    on some computers, it will always be there but don't cause any trouble.

    On a Windows Vista-based computer or on a Windows Server 2008, Microsoft computer
    ISATAP map appears with a yellow exclamation next to it in Device Manager and you also
    error message.
    http://support.Microsoft.com/kb/932520

    Check the answer by Diana D. here:
    http://social.answers.Microsoft.com/forums/en-us/vistahardware/thread/a75e8bf1-9a63-4CF4-BF6C-d43a26175959

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • Problem with password reset link - "there is a temporary problem with the service. Please try again. If you continue to receive this message, try again later. »

    Hello, account Windows Live from my wife was hacked a week ago and has been used to send many spam emails. As a result, his account has been disabled or closed (we are not sure). Whenever she asks to reset a password and a link sent to a different e-mail account, when she clicked it gets this message 'there is a temporary problem with the service. Please try again. If you continue to receive this message, try again later. "She is tried repeatedly, but get the same message. Someone knows how to go beyond that, so she can recover her account? Thank you.

    Hello BBB34,

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums to www.windowslivehelp.com.

  • How can I add an ID related when I get this message (there is a temporary problem with the service. Please try again. If you continue to receive this message, try again later.) ?

    How can I add an ID related when I get this message (there is a temporary problem with the service. Please try again. If you continue to receive this message, try again later.) ?

    Hello

    an answer your other thread

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-networking/why-do-i-keep-getting-your-Windows-Live-ID-cant-be/268ff99c-E459-E011-8dfc-68b599b31bf5?page=1&TM=1301396733390#footer

Maybe you are looking for