GlobalEventListener: to distinguish between system module and gui entrypoint

Hey. I have an application with a system module that should always run and a gui with a EULA entry point. Once accepted the EULA, I want the gui to close application and the module of the system to begin running. (It works on battery pull, but the goal is to avoid asking the user to do).

eventOccurred in GlobalEventListener fires twice, I guess once for the module of the system and once for the GUI. Two apparently weird things happen. First of all, when I use a global boolean to make a distinction between the sysmod and GUI, GUI screen is stuck and the sysmod seems to be exited. (Or I tried passing the processid of the sysmod and just exit with a different id - the GUI.) Same effect).

Then when I remove the and check only for the guid of the global event, the eula, the sysmod screen farm stop logging but an icon of the application with the generic blue icon are still there in the app selector (hold the menu button).

All I want to do is start the system module and close the EULA gui, so that the user need not cold start. Thanks for your time... code below. J.

class MDB extends UiApplication implements GlobalEventListener 

  boolean thisIsSystemModule;

    // In main(  )

        if (arg0.equals("gui")) {

            globalMDB = new MDB();
            globalMDB.SetSystemModuleFlag(false);
            globalMDB.addThatGlobal();
    }
        else if (arg0.equals("activatesysmodandexitgui")) {

            MySystemListener msl = new MySystemListener();
            globalMDB = new MDB();
            globalMDB.SetSystemModuleFlag(true);
            globalMDB.addSystemListener(msl);

            globalMDB.ScheduleNextBackgroundChange();   

                String logMessage = "MDB has both setup and scheduled a bg change.";
                EventLogger.logEvent(0x4c9d3452d87922f8L, logMessage.getBytes(), EventLogger.ALWAYS_LOG);
                    System.out.println("\n\n>>" + logMessage);

            // post global event for eula to listen to and close
            globalMDB.addThatGlobal(); 

        //// Event ID comes from MDB.Start.System.Module.And.Close.EULA.GUI  0x5395aca2ff6df828L
            ApplicationDescriptor appDescriptor = ApplicationDescriptor.currentApplicationDescriptor();
            int smprocessid = ApplicationManager.getApplicationManager().getProcessId(appDescriptor);

         ApplicationManager.getApplicationManager().postGlobalEvent(0x5395aca2ff6df828L, smprocessid, 0);

            globalMDB.enterEventDispatcher();
    }
    else {
        // code for battery pull
    }

    private void SetSystemModuleFlag(boolean flag) {

        thisIsSystemModule = flag;

    }

    private void addThatGlobal() {

        addGlobalEventListener(this);   

    }

    ////  Called when user accepts the eula. EULA is gui entrypoint. I want the gui app to exit and leave just the system module

    private static void StartSystemModule() {

            int modHandle = CodeModuleManager.getModuleHandle("MDB");
            ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(modHandle);
            ApplicationDescriptor appDescriptor = new ApplicationDescriptor(apDes[1], new String[] {"activatesysmodandexitgui"});  // we want the system module

            try
            {
                ApplicationManager.getApplicationManager().runApplication(appDescriptor);
            }
            catch (Exception e)
            {
                    System.out.println("\n>> Problem starting system mmodule\n");
            }

    }

public void eventOccurred( long guid, int data0, int data1, Object object0, Object object1) {

        //Is this the GlobalEvent we are waiting for?
        //Long = com.samples.globalEventFiring.GlobalEventFiring
        ApplicationDescriptor appDescriptor = ApplicationDescriptor.currentApplicationDescriptor();
        int thisprocessid = ApplicationManager.getApplicationManager().getProcessId(appDescriptor);

        if (guid == 0x5395aca2ff6df828L)  //  !thisIsSystemModule &&         data0 != thisprocessid &&
        {
                System.out.println("\nEvent received, eula exiting now.");
                System.exit(1);
        }
}

Hello. The whole situation turns that arose because despite searching, I was not in the current Modules of the system to start when the application is installed (or opening). I knew only that they were running at startup, then in the absence of a way to start them from code, I asked users to cold start their phones!

Although I do not understand what caused this error, it might have something to do with the planning of a timer job or adding a listener to an instance of the application system, and then exit the application before the timer is due to run it. Could someone with more understanding fill in us, on what it would do, but unless there is another way, I wouldn't do it.

The solution was to do nothing. Delete all of the code to start the module of the system. And the other thing of smaller was to detect whether the instance is the module of the system or the gui entry point, Yes, you can use a global var but not a static. In acceptsForeground, you just check this global var defined in the hand and to be sysmod, false return.

Will seek some of the discovered books recently, in order to aim to post 2 days a week only I think that in the future.

TKS

J

Tags: BlackBerry Developers

Similar Questions

  • Diff between: system.trigger_record and: system.cursor_record

    Hi, forms 6i,

    y at - it a Diff between: system.trigger_record and: system.cursor_record?

    Unlike the SYSTEM. CURSOR_ITEM and SYSTEM. TRIGGER_ITEM, who do not always have the same value

    (Form help: "within a given trigger, the value of the SYSTEM.) CURSOR_ITEM changes when the navigation takes place. This differs from the SYSTEM. TRIGGER_ITEM, which remains the same from beginning to end of the trigger. »),

    seems to this SYSTEM. TRIGGER_RECORD and SYSTEM. CURSOR_RECORD always have the same value.

    Look at this example:

    -for example ONCE - NEW - ITEM - INSTANCE

    MESSAGE (: SYSTEM.) CURSOR_ITEM); TAKE A BREAK; -shows for example ITEM2

    MESSAGE (: SYSTEM.) TRIGGER_ITEM); TAKE A BREAK; -shows for example ITEM2

    MESSAGE (: SYSTEM.) TRIGGER_RECORD); TAKE A BREAK; -indicates for example 1

    MESSAGE (: SYSTEM.) CURSOR_RECORD); TAKE A BREAK; -indicates for example 1

    NEXT_RECORD;

    MESSAGE (: SYSTEM.) CURSOR_ITEM); TAKE A BREAK; -Watch ITEM1

    MESSAGE (: SYSTEM.) TRIGGER_ITEM); TAKE A BREAK; -Watch ITEM2

    MESSAGE (: SYSTEM.) TRIGGER_RECORD); TAKE A BREAK; -Watch 2

    MESSAGE (: SYSTEM.) CURSOR_RECORD); TAKE A BREAK; -Watch 2

    Kind regards

    Zlatko

  • distinguish between the indicator and controls using property nodes

    How can I distinguish between controls and indicators property nodes?

    I find that the controls and lights on the Panel before all come from the same class... a digital control and a digital indicator share the same properties... I am trying to find a way to distinguish between the two.  I would like to be able to analyse a reference VI pull only the references to the "controls" or "indicators" on the front panel... but when I try this, I shoot all...

    Although I found this case a knot of property ' control value: get all ' referral of VI, I can choose between only indicator or only the values of the controls... it's close to what I want, but instead, I like to shoot only the references to the Group of the "indicators" or only the references to the groups 'controls '.

    does anyone know if there is a simple way to do this?

    Thank you very much!

    Suprisigly to search for flags search controls

  • The system modules and threads?

    (1) are grouped within the cod even modules of the system?

    (2) will run the modules of the system since a separate queue UI event thread? Basically, do I need another thread to do the work of the fork?

    (3) I noticed that the phone application is divided into 2 modules: api (1) (2) app.

    Is this a good practice? API modules for interfaces maybe. How do we export Service for consumption by another application?

    Thank you

    G

    In most cases, an operation that takes more than a few milliseconds to complete should be done in a separate thread, especially in a user interface application. Of course, this is not mandatory. The objective is to ensure that the user appreciates their overall experience with their device - not just with your application.

    Edit: Oh, and I almost forgot to answer your original question. To my knowledge, System applications share the CPU as an app we write are supposed to. In this sense, our applications are on the same level as the rims. Of course, I'm sure rim are multithreaded to some extent, but they are not running in a separate environment from our.

  • CSD - distinguish between Iphone OS and Mac OS

    Hey everybody,

    Using Cisco Secure Desktop (CSD) would it be possible to distinguish whether a user using Anyconnect connects from Iphone (Iphone OS), or a MacBook (Mac OS)?

    I have not found the answer until now. CSD doesn't seem to distinguish.

    This is the operating system that checks the CSD:

    • Win 2 K/XP/Vista
    • Win 9 x
    • Mac
    • Linux
    • Failure

    I use the 3.6.6234 - k9 version of the CSD.

    Thank you!

    Hi François,

    You could do the assessment endpoint for iOS so CSD hostscan function integrated with Dynamic Access Policy (DAP) function.

    http://www.Cisco.com/en/us/products/ps6120/products_white_paper09186a00809fcf38.shtml#T2

    Currently, there is no option available for the verification of the iOS using the policy feature to before opening of session of CSD.

    Please browse this document that talks about the assessment of Posture of Mobile:

    http://www.Cisco.com/en/us/docs/security/vpn_client/AnyConnect/anyconnect25/Administration/Guide/ac09_admin_mobile.html#wp1016752

    Hope the information is informative.

    Kind regards

    Nick

    P.S. Please mark this message as 'Response' if the above information was helpful.

  • Difference between system WHO and hourly System Agent is 117 mins and ha

    Hi guys,.

    In one of my Office Server, I changed the time system. After changing the time I had this under alert.
    Could you please help me...

    Please, provide additional details:

    1 is the agent and the WHO on the same machine?
    2. If it is different, is the time of the system on two identical machines?
    3. What is the operating system for the WHO and the agent?

    -Sergiusz

  • How to distinguish between normal PDF and PDF with a form

    I recently created a pdf form to fill out for others. They will answer me by e-mail, attached with the form pdf and pdf normal another.

    Is it possible to quickly identify what is the pdf form, which is a normal pdf file?

    No, it sounds like a call to the plugin.

    Watch samples of VB - there should be one that deals with forms and shows how to navigate through the fields.

  • No way to distinguish between failure and normal when to get the document of the UCM?

    Hello

    I use the service GET_FILE below to get the document from the Complutense University of MADRID

    request.putLocal (IdcService.NAME, IdcService.GET_FILE);
    request.putLocal (IdcDocumentAttribute.DOCUMENT_ID, dID);
    request.putLocal (IdcDocumentAttribute.NAME, dDocName);

    and then the output stream:
    ServiceResponse response = client.sendRequest (context, dataBinder);
    InputStream inputStream = response.getResponseStream ();

    they work most of the time very well.
    However, in this case, exception that I can't file, rather than receive exception, I always get a steady stream until I got out of the stream as a string, I realized that this is a format string HDA indicating failure.

    I wonder if there is no way to distinguish between failure and normal exit without open the output string stream?
    Thank you.

    We expect that the user can download the document so successfully in the form of output stream.

    It's probably a bad support, as you have already seen ;-)

    Is the output as string-HDA when the expected of the UCM rather than throwing exception failure?

    It should be pretty easy parse the real answer to retrieve the status code the system riser. You should not need to open the file to find the error.

    Something like

    response.getLocal("StatusCode")
    

    should tell you if the file has been found. A-16 status code means that the file could not be found. In the case of a successful GET_FILE, it does appear that a status code is still present, so test just for the mere presence of a status code should be sufficient.

  • difference between the real time module and module fpga

    Hi experts,

    I was wondering if someone could tell me the difference between the FPGA and the module in real time (in short).

    My understanding is that the FPGA module facilitates code LV that can then be designed for the specific advice of RIO, I have used this a bit in the past.

    The real time module, I'm a little more unsure about, all I know is that it allows the creation of a 'real time' i.e. deterministic environment.

    My request is this: I wish I had several control loops running on two tables of RIO, with the host PC mainly used for recording data and user interface. I see that I have no need of RT on the host (Win XP should be good).

    Do I need the RT module?

    You are right.  In the scenario you describe, you won't need to LabVIEW RT. LabVIEW RT is used to create a deterministic execution on specific targets for intel such as the PXI-8106 and PXI-8108.  You can still use strings and floating point on RT.

  • base system device and a HP ev2210 1xEV-DO Broadband Wireless Module as well. Missing driver

    Your search: I have a laptop Pavilion dv2500tw CTO. I have upgraded from Vista to Windows 7 Home premium. Now it shows 2 missing base system devices and a HP ev2210 1xEV-DO Broadband Wireless Module as well. Help

    Note: Mistakly I delete the partition system (Win Vista) when I clean install win 7 32-bit home pre.

    Hello:

    You need this driver for the base system device.

    http://h10025.www1.HP.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-54958-1&cc=us&DLC=en&LC=en&OS=2093&product=3632220&sw_lang=

    You can try the Vista driver for the card broad band.  There are no Windows 7 drivers for it.

    http://h10025.www1.HP.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-65526-1&cc=us&DLC=en&LC=en&OS=2093&product=3632220&sw_lang=

    If the Vista driver does not work, you can see if this driver windows 7 works. I don't know whether the pilot includes your model too or if it's just for the 2400.  This driver appears on the history tab of revision for the HP ev2210.

    http://h20566.www2.hp.com/portal/site/hpsc/template.PAGE/public/psi/swdDetails/?spf_p.tpst=swdMain&spf_p.prp_swdMain=wsrp-navigationalState%3Didx%253D%257CswItem%253Dob_83605_1%257CswEnvOID%253D%257CitemLocale%253D%257CswLang%253D%257Cmode%253D%257Caction%253DdriverDocument&javax.portlet.begCacheTok=com.vignette.cachetoken&javax.portlet.endCacheTok=com.vignette.cachetoken

  • I have a 6930p elitebook lack of base system driver and module broadband un2400 mobile

    Hi I recently bought an elitebook 6930p with windows xp installed on it.  After clean installation windows 8, I discovered that my base system driver and hp un2400 mobile broadband module is missing, any ideas? I know that there are several discussions resolved about windows 7 but nothing about windows 8, thanks

    Hello:

    You need this driver for the 0004.

    http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=321957&prodSeriesId=3688868&prodNameId=3688870&swEnvOID=4059&swLang=13&taskId=135&swItem=ob-109933-1&mode=3

    The adapter to wide band may not be supported for W8.

    If the driver is not installed automatically, my only recommendation would be to try to install manually by using the following method.

    http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=321957&prodSeriesId=3688868&swItem=ob-83605-1&prodNameId=3688870&swEnvOID=4059&swLang=13&taskId=135&mode=5

    Download and run the W7 driver.

    http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=321957&prodSeriesId=3688868&swItem=ob-83605-1&prodNameId=3688870&swEnvOID=4059&swLang=13&taskId=135&mode=5

    Conclusion of any windows error you get.

    Go to Device Manager and click the map broadband which need pilots. Click on the driver tab, click on set to update driver.

    Select travel it my computer for the software method and locate the installation folder that was created when you ran the file.

    Who will be in C:\SWSetup\sp48568.

    Make sure that the include subfolders is selected, and I hope that the driver will be installed.

    If this isn't the case, then it probably won't all what you can do to get the card to operate in W8.

  • Drop-down list: distinguish between programming and modification of the user

    I have a drop-down list with a few options, the selected displays current status.

    The State can change programmatically I have to update the drop-down list.

    I want to distinguish between this change programme and focused on the user.

    No idea how I could do this?

    The classic solution to this problem is to add a flag (Boolean property) that you control, and which inhibits the onThingChanged response when set. You set this just before you perform a change of programming and clear right after. When the change is made by the user, the flag will be clear and the onThingChanged would do its thing.

    There may be other ways to do this in specific cases, but this approach has worked in all situations in which I have tried so far.

  • Noise reduction and sharpening in lightroom 5.2 problem develop between the two and library module.

    Hi, I have a photo I asked a lot of noise and sharpening to, when I swich develop between module and library, the noise does not disappear? I also tried to export the image without the chance to get rid of the noise.

    Edit

    I tried to update the metadata & preview DNG. No luck...

    I have tried to change the settings of the catalog / handling / Standard size preview of the file. No luck... But the peak seems to make a littlebit better.

    Anyone?

    D800 Nikon,

    Import to DNG,

    2.8 ISO 6400

    Win 8 64-bit

    16 GB OF RAM

    Processor 2.4 Ghz

    Concerning

    Kent

    This is due to the high ISO 6400, long exposure and large amount of sharpening, as I have indicated on the site of Photoshop Lightroom bug reports.

    To prove if this is really the cause see the image in two modules at the sight of 1:1. They now look the same? If so, you have your answer!

    (1) try to lower the detail 25 sharpening slider and the color detail slider to 50.

    (2) look at the image in 1:1 two modules to recreate the cache to develop and the library preview images. In each module wait LR to apply the new settings to the image.

    (3) now, look at the image to display 'Fit' in the two modules.

    (4) it is sometimes necessary to step #2 above twice (i.e. twice) to ensure that the point of view 'Fit' has new LR settings applied.

    How to develop and the library view ' worthy' compare now?

  • Differences between Hyperion System 9 and 7.1.2

    Hi all

    (1) can we give everything some differences between Hyperion System 9 and 7.1.2?

    (2) what are the additional features involved in Smart view for office System 9 compared to Excel add - in?

    (3) what's new in the Web compared to Hyperion Analyzer Analyzer?

    (4) other newly added feautures and positives with Systen 9?

    Any help or suggestion is greatly appreciated.

    Thanks for the help in advance.

    Rombaux V

    Hello Srinivasa Rao,

    Click on the link to the documentation and see new things, all this would be the difference between the old version to the latest

    http://download.Oracle.com/docs/CD/E12032_01/welcome.html

    Hope this info helps.

    Sandeep Reddy, Enti
    HCC
    http://analytiks.blogspot.com

  • Cannot share my printer between a XPsystem and a Windows 7 system.

    SHARE A PRINER BETWEEN XP AND 7 QUESTIONS

    I could not share the printer (BROTHER MFC-3240C) BETWEEN WINDOWS XP AND WINDOWS 7.  (THE PRINTER IS CONNECTED LOCALLY IN WINDOWS 7).  I INSTALLED THE DRIVERS APPROPRIATE IN BOTH COMPUTERS.

    Hello

    What security software is installed on your computer?

    I would suggest trying the following methods and check if it helps.

    Method 1:

    Try the steps in the following Microsoft article and check if it helps.

    Sharing files and printers with different versions of Windows:

    http://Windows.Microsoft.com/en-us/Windows7/help/sharing-files-and-printers-with-different-versions-of-Windows

    Method 2:

    Disable the security software and check if it helps.

    Disable security software: http://windows.microsoft.com/en-US/windows7/Disable-antivirus-software

    Warning: If you need to temporarily disable the security software, you should reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    For more information, see the following Microsoft article.

    http://Windows.Microsoft.com/en-us/Windows7/file-and-printer-sharing-frequently-asked-questions

    Hope the information is useful.

Maybe you are looking for

  • Thing to deal with when migrating site of linux to windows server?

    I need to migrate my customer site because they asked me to host windows Server. But I am new to windows server platform. I'm only familiar with linux server. If you make a mistake then client will sue me. Customer site is careerarm , because I copie

  • Monthly backup of servers? Need help with a solution.

    Hello.  I'm trying to find a solution that will help me in the image of all of my servers on a monthly basis.  Some are virtual windows, some are and some are not ms servers.  There is a new solution for this?  Ghost is an option?

  • BlackBerry 10 how to change the default keyboard prediction?

    Is replaced by jo as default and it's really annoying. How can I fix?

  • Are OBIA with OBIEE 12 c now?

    Hi guys,.I wanted to know if anyone has tried to use the applications of 11g available in version OBIA with OBIEE 12 c.pusOracle has already released OBIA 12 c?I checked out the site of oracle, but failed to find anything.Really appreciate if anyone

  • Best practices... How many cards?

    Hey guys,.We are currently adding 2 new hosts (HP BL460c G8) to our cluster 4 hosts (HP BL460c G7).  Guests have the following configurations:-12 cores (2 x Intel Xeon 6 cores)-192 GB memory (G8 have 256 GB)-NIC 6 (2 + 4 with mezzanine)-2 x 146 GB mi