Running the background (sms listening thread) connected to the GUI (another point of entry) application thread

Hi, I'm new to the development of Blackberry, I read everything on the application running at startup and have a different point of entry for this application. I still need help with my application

I use BB JDE 4.7

Simulator: BB 9530 4.7.0

I'm developing an application of SMS. (extends UiApplication)

1) there is a thread that listens for incoming messages

2) there is a wire which is a SMS sender

3) there is a main screen and two full screens. for example, when the user clicks a button in one of the screens full... I send you a message

(4) when a message is received, based on the content of the message I push either a full screen

(5) I have, all the wires and screens as the class internal to the main class that extends from the UiApplication.

I got the basic features. I need help making that demand the application of autostartup

(1) I need to start listening to the sms thread when the BB phone starts

(2) I need to have the application icon in the applications screen as another entry point for the application (only for the GUI), and the listening thread must remain active in the background.

(3) when an incoming message is detected, the application GUI should be brought to the foreground (if it isn't already forground) after posting a popup (instead of bring the application to the foreground, is it better to display a flashing icon in the status bar of the home screen blackberry and perhaps global popup)

(4) when the GUI of the application part is closed, I need to stop the sms sending thread, and when the system shuts down, I need to stop the listening thread.

Please help me guys... I have read many articles and discussions regarding the automatic start-up of applications, another point of entry, the # of background threads...

but I couldn't find how to implement my needs.

(1) should I need to create two different projects (applications [GUI thread, a sender] and one for the listening thread)? or I can achieve in single application?

(2) should I have to sign in the background thread to the GUI app? If so, how?

(3) it is necessary to use the RunTimeStore object? If so, I don't know how I can bring to the foreground the application GUI of the background thread.

(4) if I have to stop the thread of listening by overiding onExit() method, the important question I have is, if the onExit() method is only for applications that extends from the Application class and not for the UiApplication class?

(5) if I should have two projects (one main and the other as a spare point entry), which project should I do as "autorun at startup" and a "system module".

As I need to have the background still running thread when the GUI application is active. I don't know how I do.

Hello world...

I reached my needs thanks to a single application. I used an other entry point.

To refer to chk my other post

http://supportforums.BlackBerry.com/T5/Java-development/how-to-avoid-creating-two-instances-of-the-a...

Tags: BlackBerry Developers

Similar Questions

  • Thread in another point of entry of spawning

    I'm looking to develop an application that has a background service and a front end GUI (2 points of entry).  I understand how to have a runtime shared store so that the GUI can access data/events from the basic service.  But how do I generate a thread in the background entrypoint, while in the entrypoint GUI.  Should I call app.invokeLater () on the background application?  Is - illegal to do if you're not in the context of this application?

    Send your background request a notification using the global event.

    invokelater on the instance of the application should also work, but seems a little dirty to me

  • Running a Seq file when running the GUI (command line option) return an error

    Hello

    I use a LabVIEW based UI to run/execute a file in sequence by using the command line option. My command line is "Test DUT' D:\QF\GUI-test-Sequential.seq D:\QF\GUI-Test.exe - runEntryPoint

    When I ran the get 3 popup saying that some of the perameters 'is not a valid file of LabVIEW"(see attachments). No idea how to avoid these messages? (The user interface works very well and runs the entrypoint of the USE Test)

    LabVIEW 8.5

    TestStand 4.1

    Thank you.

    Hi Tom,

    When you create a new application to your specification to Build, you must set the 'Pass all arguments for application command line' in the Advanced tab.

    Once you do that it should all work.

    Concerning

    Ray Farmer

  • KB3057839 breaks the windows services that run the GUI programs

    For reasons of inheritance, one of our tracks to windows service applications a 3rd party tool which is a graphical application in general. but also has command line switches to run in batch mode. The 3rd third party provider does not (and will not) provide a lot of command line application that is stand-alone/separated from the GUI, which leaves us with no alternative at the moment.

    So far, this approach has worked on Windows 7, Windows 8, Windows 8.1, Windows Server 2008 R2, Windows Server 2012, and Windows Server 2012 R2 - regardless of the registry setting 'NoInteractiveServices' in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows.

    But since the installation of the KB3057839 (which relates to the MS15-061) this approach has stopped working and caused the application GUI stuck, to consume 100% of one heart. The only way to get the old behavior is the following:

    1. Change NoInteractiveServices to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows to the value '0' (Windows 8 and later versions; Windows 2012 and later only)
    2. Start the UI0Detect Service ("Interactive Service detection"), defining eventually it starts automatically. and according to the other settings the same set up a recurring task to restart the service (because it stops after a while).

    As soon as UI0Detect is running, the application GUI thaws and works as expected; but also long UI0Detect is running. And since the application GUI does not in fact all the message boxes or similar which require user input, this is the kind of a workaround longshot.

    Uninstallation of KB3057839 Gets the old behavior back, but I doubt that this should be the recommended way of going. And after a search, users also have many problems with this patch.

    We checked on a virtual machine that has been reset to a snapshot prior to installation (where the intended behavior is always given); installation of KB3057839 breaks, and arranges the uninstallation of KB3057839 once again.

    Is this behavior with the installation of KB3057839, or is it a bug/pervert of the fix MS15-061 effect?

    Thanks to Ståle L. Hansen

    KB3070102 (exit 14. July 2015) replaces KB3057839 and will most likely solve your problems.

    KB3070102 / MS15-073: vulnerability in the Windows kernel-mode driver could allow elevation of privileges
    https://TechNet.Microsoft.com/library/security/MS15-073
    https://support.Microsoft.com/kb/3070102

  • Bring the app to the forefront of another point of entry that runs in the background

    in my case, I have two entry point is main which is used ti open ui and the other who work in the background to receive the push. I'll call you

    Application.getApplication () .requestForeground ();

    to bring the app to the first plan but it create instance of the application and opens the app I don't want this, I want the main application to be in the foreground, any help please...

    Please click on these links to open and transfer data from main application context.

    1)

    http://StackOverflow.com/questions/11555165/BlackBerry-alternate-entry-point-start-app-from-backgrou...

    2)

    http://StackOverflow.com/questions/11582112/BlackBerry-how-to-transfer-data-from-background-to-main-...

  • How to test the SMS listener using 2 emulators in SDK5 running Windows 7

    Hi all. Writing a SMS listener I want to test. But can someone please pass me how I can configure the SDK BB 5 (not the Eclipse plugin) running on Windows 7, so that I can send a test SMS from an emulator to another to see what is happening in the debugger. Thank you so much as always.

    Found answer in another post from Kanaksony. His response has been to make the source and destination for even 1 emulator ports. His post was:

    You need to sms-source port and sms-destination ports even in Simulator. Go to JDE-> Edit-> preferences-> tab-> port sms-source Simulator: 21316 and port destination sms: 21316

  • Client/server Push application: how to run the thread listening on basis of the necessity?

    Hello

    To receive the broadcast content from the server, a thread of listening to the need to run in the back ground on the BlackBerry.

    For a client application to receive the server put grows optimally updated, what is the best way?

    1. run the thread listening on the installation of the client application using auto-run on start up?

    What happens to the thread if there are reboot the device? The listener would start again?

    2. run the thread listening on the launch of the client application?

    (or)

    3. is there a way to run the thread to listen according to the need, when there is dissemination of the server, as some notification (called by server) to the client that there is dissemination of the server and the client then begins the listening thread?

    Please contribute your valuable and suggest most commonly followed and best practices.

    Kind regards

    Suresh.

    you don't know. If it's a good thing to do is another question.
    You can use an inboxlistener to receive an email or even a text message with a command to start the pushlistener. But why you want to do something like that? listening on a port, there's nothing that drains the battery.

  • SMS for outgoing SMS listener throws IOException immediately after the open call

    I had already created a class for sending SMS messages which worked perfectly until I added the listener. When the listener is added as soon as I start the thread throws an IOException exception who am I hurting? The only thing I can think is some kind of wire problem, please help.

    Here's the SMS & Listener class:

    private static final class SmsMessage    {        private String _address;        private String _msg;
    
            public SmsMessage(String address, String msg)        {            _address = address;            _msg = msg;        }
    
            public Message toMessage(MessageConnection mc)        {            TextMessage m = (TextMessage)mc.newMessage(MessageConnection.TEXT_MESSAGE,"sms://" + _address);            m.setPayloadText(_msg);            return m;        }    } // SmsMessage
    
       private final class SendThread extends Thread    {        private static final int TIMEOUT = 500; // ms        private Vector _msgs = new Vector(10); // Queue of 10        private volatile boolean _start = false;
    
            // queue requests        public synchronized void send(String address, String msg)        {            _start = true;            _msgs.addElement(new SmsMessage(address, msg));        }
    
            public synchronized void stop()        {            _stop = true;            try {                if ( _mc != null ){                    _mc.close();                }            } // catch (IOException e ) {                catch (Throwable t) {                t.printStackTrace();                System.exit(0);            }
    
            }
    
            public void run()        {            try {                //closed by the stop() method                _mc = (MessageConnection)Connector.open("sms://");
    
                    if (_mc != null)                {                    // set a listener to trap outgoing sms messages                    _mc.setMessageListener(new OutboundSMSListener());                }                for(;;)                {                    while( !_start && !_stop)                    {                        try {                            sleep(TIMEOUT);                        } // catch (InterruptedException e) {                            catch (Throwable t) {                                t.printStackTrace();                                System.exit(0);                            }                    }                    if ( _stop )                    {                        return;                    }
    
                        while(true)                    {                        try {                            SmsMessage sms = null;                            synchronized (this)                            {                                if ( !_msgs.isEmpty() )                                {                                    sms = (SmsMessage)_msgs.firstElement();                                    // take it out of the queue once we sent it                                    _msgs.removeElement(sms);                                }                                else                                {                                    _start = false;                                    break;                                }                            }
    
                                _mc.send(sms.toMessage(_mc));
    
                            } // catch (IOException e) {                            catch (Throwable t) {                                t.printStackTrace();                                System.exit(0);                        }                    }                }            } // catch (IOException e)              catch (Throwable t) {                t.printStackTrace();                System.exit(0);              }        }    } // SendThread
    
        private static final class OutboundSMSListener implements OutboundMessageListener    {        public void notifyIncomingMessage(MessageConnection messageconnection)        {            // we don't care about incoming sms messages right now        }
    
            public void notifyOutgoingMessage(Message message)        {            Dialog.alert("Detected An Outgoing SMS Event");        }    }
    

    Thank you. Makes sense.

  • network drive mapped 2003 server need stay connected after journal so that when my script is scheduled to run the player will always be mapped.

    2003 network drive server need mapped stay connected after journal so that when my script is scheduled to run the player will always map. ??

    Hello Scott,

    This is not the right forum for issues with Windows Server 2003.
    Please click the link below to ask your question in the appropriate forum TechNet.
    http://social.technet.Microsoft.com/forums/en-us/winserverPN/threads

    Thank you

    Marilyn

  • How to configure Task Scheduler to run the program when the connection is established

    Windows 7 64 bit
    Dial-up Internet access

    I want to use the Windows 7 Task Scheduler to run a program IMMEDIATELY AFTER a dial-up connection is made to the internet.

    How can I configure the Task Scheduler in Windows 7 to do this, please?

    I am familiar with the Scheduler of tasks with the command line parameters.  Any help is appreciated.

    Thank you

    FYI: If an example is needed, Microsoft Security Essentials can be configured to update virus through this path with the argument definitions:

    C:\Program Files\Microsoft Security Essentials/MpCmdRun.exe SignatureUpdate

    Maybe someone can use it to show how to configure the Windows 7 Task Scheduler to update MSE virus definitions, once the connection dial-up was made?

    Otherwise, for example, another program to run once established a dial-up connection would be OK, thanks

    Hello

    Scheduler of tasks is time driven.

    For order-driven event, you need a script.

    Question like that is much better treated in the TechNet IT Pro Forums.

    My moderator tools cannot transfer messages on Windows forums, please re - ask you question there.

    http://social.technet.Microsoft.com/forums/en-us/w7itprogeneral/threads

    Jack-MVP Windows Networking. WWW.EZLAN.NET

  • Running the thread of the child until the end even after that the main thread is terminated

    I run a background task by using the task and the Service Api. When the main application creates little son, the main thread can be terminated without completing the child thread. Is this possible. Thank you.

    Find out about the son of the devil.

    Multithreading - what is Daemon thread in java - Stack Overflow

    Read also the

    Application section of the lifecycle in the javadoc.

  • Configuring the listener pending side before running the RMAN DUPLICATE

    Version: 11.2.0.3
    Platfomrm: Solaris 10

    We will create a DB physical standby for our primary database using RMAN Duplicate.

    Our primary DB details
    DB_NAME          = ADPTGMS
    DB_UNIQUE_NAME     = ADPTGMS
    Names for standby
    DB_NAME          = ADPTGMS
    DB_UNIQUE_NAME     = ADPTGMSDG
    Question1.
    Next to the day before, before I run the duplicate RMAN, I need so that it starts the empty instance in NOMOUNT State. Right? Can I configure export ORACLE_SID DB_NAME or DB_UNIQUE_NAME?

    Question2.


    I understand that it is a precondition not to have the listener towards the top pending side make the RMAN Duplicate (otherwise how RMAN will connect to the dummy instance in the side standy)
    Next to Eve, there is no DB turns again. But for the RMAN to connect to the Instance of a model, I configured and started a listener as shown below. Is this really?
    $ cat listener.ora
    # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    
    LISTENER_DG =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 10.80.16.179)(PORT = 1524 ))
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2012))
        )
      )
    $
    $
    $
    $ lsnrctl start LISTENER_DG
    
    LSNRCTL for Solaris: Version 11.2.0.3.0 - Production on 20-DEC-2012 00:14:19
    
    Copyright (c) 1991, 2011, Oracle.  All rights reserved.
    
    Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
    
    TNSLSNR for Solaris: Version 11.2.0.3.0 - Production
    System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
    Log messages written to /u01/app/oracle/diag/tnslsnr/tigris179/listener_dg/alert/log.xml
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.80.16.179)(PORT=1524)))
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2012)))
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.80.16.179)(PORT=1524)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER_DG
    Version                   TNSLSNR for Solaris: Version 11.2.0.3.0 - Production
    Start Date                20-DEC-2012 00:14:24
    Uptime                    0 days 0 hr. 0 min. 3 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/diag/tnslsnr/tigris179/listener_dg/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.80.16.179)(PORT=1524)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2012)))
    The listener supports no services
    The command completed successfully

    Hello

    The link I gave in my previous post features a display of very good example:

    Primary:

    Pfile/Spfile name: initprim.ora/spfileprim.ora
    db_name=prim
    db_unique_name=prim
    

    Standby time:

    Pfile/Spfile name: initstnd.ora/spfilestnd.ora
    db_name=prim
    db_unique_name=stnd
    

    In your case:

    While adding a static entry to the listener of the day before, SID_NAME should be the DB_UNIQUE_NAME of the database pending. Also the pfile/spfile Eve must be associated with the DB_UNIQUE_NAME of the previous day.

    The pending database ORACLE_SID would be the DB_UNIQUE_NAME of the database pending. Hope that's clear!

    Kind regards
    Shivananda

  • I just installed a new router and now my desktop running Windows XP computer does not connect to the internet.

    Hello

    I just installed a new router and now my desktop running xp computer does not connect to the internet. I know that it is not the router because I plugged the cable into my laptop running 7 and it works fine. When I try to dhcp I get 169..., when I put manually the IP just get no access to the internet and can not ping to the router address. I tried to run the net work Assistant, emptied my dns, disabled all firewals, still nothing.
    Any suggestions?
    original title: connectivity Limeted

    The zero configuration utility works very well. But it is a desktop computer and on cable. All other wired and wireless PC in the office is working well, then it's definitely this PC. He came out of nowhere, I install a network printer on the PC but that's all.

    Your messages are a bit terse, but if I understand correctly

    • You have a router connected to the Internet and multiple computers connected to the router, some Ethernet cable and others by wireless.
    • All but one of these computers can reach successfully from the Internet via the router.
    • A computer that can't browse the Internet is connected to the router via an Ethernet cable.
    • You disconnected the cable between the router and the desktop problem and connected it to a Windows 7 laptop and the laptop connected to the Internet via the router.
    • You haven't seen any error message (except, perhaps, a message on "Limited or no connectivity").
    • You have installed Windows XP Service Pack 3 (or at least Service Pack 2)

    Assuming that all the foregoing is an accurate summary of the situation, I suggest that you do the following:

    Open a command prompt window (start > run > cmd > OK)
    Type the following lines and press ENTER after each line

    Netsh reset winsock catalog
    netsh int ip reset c:\resetlog.txt

    Close the command prompt window and restart the computer.

  • Connection cricket MSGM8 phone USB on my laptop (running Windows XP Pro) run the Add New Hardware Wizard, but cannot find drivers

    Original title: badminton MSGM8 phone to the USB port on my laptop to pis draft.exe

    connecting a phone to cricket MSGM8 USB on my laptop (running Windows XP Pro) run the Add New Hardware Wizard, trying to locate the software for Qualcomm CDMA Technologies MSM, but can not find the drivers, any fix?

    Hi ChristopherStout,

    (1) what is the complete error message you receive?

    (2) is limited only to Cricket MSGM8 phone?

    Method 1: Run the fixit available in the article below and then check if it makes a difference

    A computer that is running Windows XP cannot detect a USB, an Apple iPod flash drive or an external hard disk drive
    http://support.Microsoft.com/kb/925196

    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base.
    How to back up and restore the registry in Windows

    Method 2: If you provided drivers\software disc from the manufacturer of the computer, go ahead and install it.  You can see the steps outlined in the article below

    How to troubleshoot unknown devices listed in Device Manager in Windows XP
    http://support.Microsoft.com/kb/314464

  • BEFSR41. Run the wizzard of configuration to connect to Inet

    I bought a Linksys BEFSR41a a few days basck, since my old D-Link became a little a little reliable.

    1. connect inside and follow the steps described in the living part, guide to start, but could not connect to the Internet.

    2. check the network card with ipconfig-all the and he had acquired an ip address and everything seemed normal.

    3. check the router configuration and status via the web interface. It seemed as well, at least as far as I could tell (compared with my old D-Link settings).

    4 power everything, including the modem, router, switch and PCs and restarted.

    5. I tried runing the wizzard of configuration included on the disc that came with the router instead of folowing guide quick start.

    6 here, now I could connect to the Internet... for a while

    The problem I have now is that whenever I have turn off the modem + router, as I do every night, I have to run the wizzard of configuration to make it work again the next day. And no, leaving on is not an option! It is a real pain in the * beep * and I'm close to throwing away the new router. What did the wizzard to works and why is he not saved in the configuration of the router?

    I have a cable connection and my PC is running Win XP.  I hope someone can help

    Hi TheMOOSE and welcome to the forums!

    Since you have a cable connection, it is advisable that when you turn on your device, do it in the right order. It still works for me. It should be the first modem, then the router and your computer.

    There is no need to run the wizard to set up everytime, because the router is already set.

Maybe you are looking for