How to manage the events of bps in Application

the example shows only the event handling in C, such as dialog box.

I want to run these events bps in my mainApp.

I find all bps events are managed by BpsEventDispatcher:rocessBpsEvents().

These events willnot goto request, someone help?

int cascades_user_main (int argc, char * argv)
{
This is where the server is started.
App app (argc, argv);

MainApp App;
QObject::connect (& app, SIGNAL (aboutToQuit ()), & mainApp, SLOT (onUpdate (()));

Return Application::exec(); Complete us the transaction started in the constructor of the app and begin the loop of customer events here
When the loop that you exit the Application deletes the stage that removes all his children (by the rules of qt for children)
not as nice of course
}

Here's a code for me to get GPS-events. Should hopefully be the same for other events.

https://bdsc.webapps.BlackBerry.com/native/reference/com.QNX.doc.screen.lib_ref/topic/rscreen_get_ev...

    LOG_INFO << "use playbook GPS";
    this->screenOrientation = 0;
    bps_initialize();
    LOG_DEBUG << "initialized";
    if ( geolocation_request_events( 0 ) != BPS_SUCCESS )
    {
        LOG_WARNING << "could not request position: " << strerror( errno );
    }
    else
    {
        LOG_DEBUG << "request geolocation events";
        geolocation_set_period( 1 );
        LOG_INFO << "period 1 sec";

        LOG_DEBUG << "request orientation events";
        if ( orientation_request_events( 0 ) != BPS_SUCCESS )
        {
            LOG_WARNING << "could not request orientation: " << strerror( errno );
        }
        /*
           sensor_set_rate( SENSOR_TYPE_MAGNETOMETER, 1*1000*1000 );
           sensor_set_skip_duplicates( SENSOR_TYPE_MAGNETOMETER, true );
           sensor_request_events( SENSOR_TYPE_MAGNETOMETER );
         */

        if ( sensor_is_supported( SENSOR_TYPE_AZIMUTH_PITCH_ROLL ) == true )
        {
            // every 500 msec should be enough
            sensor_set_rate( SENSOR_TYPE_AZIMUTH_PITCH_ROLL, 500 * 1000 );
            sensor_set_skip_duplicates( SENSOR_TYPE_AZIMUTH_PITCH_ROLL, true );
            sensor_request_events( SENSOR_TYPE_AZIMUTH_PITCH_ROLL );
        }
        else
        {
            LOG_INFO << "SENSOR_TYPE_AZIMUTH_PITCH_ROLL not supported";
        }

        QTimer *playbookTimer = new QTimer();
        connect( playbookTimer, SIGNAL( timeout()), this, SLOT( pollPlaybookLocation()));
        playbookTimer->start( 100 );
        LOG_DEBUG << "playbook timer started";
    }
void GPS::pollPlaybookLocation()
{
    LOG_DEBUG;
    bps_event_t *event     = NULL;
    int         eventCount = 0;
    bps_get_event( &event, 0 );
    if ( event != NULL )
    {
        while ( event != NULL )
        {
            LOG_DEBUG << "event: " << QString::number( eventCount );
            eventCount++;
            if ( bps_event_get_domain( event ) == geolocation_get_domain())
            {

Tags: BlackBerry Developers

Similar Questions

  • How to manage the events connected call?

    Hello

    I want to capture the call connected event and then vibrate the phone to warn the user that the call is connected now. I wrote a new class that implements the PhoneListenner interface in the code below:

    public class PhoneConnectedListenerApp extends Application implements PhoneListener {
    
        public static void main(String args[]) {        //register the notification        PhoneConnectedNotification mn = new PhoneConnectedNotification();        mn.registerNotificationObjects();        //register the folder listener        PhoneConnectedListenerApp theApp = new PhoneConnectedListenerApp();        theApp.enterEventDispatcher();    }
    
        public PhoneConnectedListenerApp() {        try {            Phone.addPhoneListener(this);        } catch (Exception e) {            System.out.println(e.toString());        }    }
    
        public void callConnected(int pCallId) {        NotificationsManager.triggerImmediateEvent(PhoneConnectedNotification.NOTIFICATION_ID, 0, this, null);    }
    
        public void callAdded(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callAnswered(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callConferenceCallEstablished(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callDirectConnectConnected(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callDirectConnectDisconnected(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callDisconnected(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callEndedByUser(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callFailed(int pCallId, int pReason) {        // TODO Auto-generated method stub
    
        }
    
        public void callHeld(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callIncoming(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callInitiated(int pCallid) {        // TODO Auto-generated method stub
    
        }
    
        public void callRemoved(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callResumed(int pCallId) {        // TODO Auto-generated method stub
    
        }
    
        public void callWaiting(int pCallid) {        // TODO Auto-generated method stub
    
        }
    
        public void conferenceCallDisconnected(int pCallId) {        // TODO Auto-generated method stub
    
        }}
    

    And there is an another PhoneConnectedNotification that customize the notofication (vibrate once in this case).

    Then I deployed to the Simulator, but there does not work. I tried with an outbound/inbound call, then the connected status change, but the phone does not vibrate.

    Where is my mistake? Can you help me find? Thank you.

    Lam.

    P/S: I used Eclipse with the JDE plugin to develop applications of BB and tested on my 8320.

    You can, and I would recommend that you test it on the Simulator.  If you do this, you don't need to sign your application and you will find your testing/fixing much easier.  Use the "Simulation" menu button to simulate an incoming call - you can run an outgoing call, as you would on a device.

  • How to manage the event of "alt + trackpaddown" button event method char

    Hello

    I want to do a few ob task by clicking on 'alt + down trackpad'.is it possible?

    If yes how can I handle this task. ?

    Thank you

    Naveen

    "" Hello Sir thanks to enable playback... in fact, I have two listfield in my screen .i want to alternate between two listfield using "alt + trackup and trackdown. My it does not work... I am using this code...

    package com.black.applicationloader;
    
    import java.util.Vector;
    
    import net.rim.device.api.system.Display;
    import net.rim.device.api.system.KeypadListener;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Keypad;
    import net.rim.device.api.ui.Manager;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYRect;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.ListField;
    import net.rim.device.api.ui.component.ListFieldCallback;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    import com.black.blackinterface.BlackInterface;
    import com.black.common.BaseScreen;
    import com.black.components.CustomEditField;
    import com.black.utility.Utilities;
    
    public class BlackSecondScreen extends BaseScreen implements BlackInterface,ListFieldCallback {
         private VerticalFieldManager listFieldManager;
         private VerticalFieldManager listFieldManager_2;
         private static final String[] _elements = {"First element", "Second element", "Third element", "Fourth element", "Fifth element"};
         private Vector _listElements = new Vector(_elements.length, 1);
         int columnWidth  = Display.getWidth()/4;
         private boolean hasFocus; // =false
        private CustomEditField userEditField;
        ListField colourList_1;
        ListField colourList_2;
    
        BlackSecondScreen(){
    
            colourList_1 = new ListField(){
    
                protected boolean keyChar(char key, int status, int time) {
                    if(colourList_1 == getLeafFieldWithFocus()){
                    if(key=='t'||key=='T'){
    
                        colourList_2.setFocus();
    
                    }
                    return true;
                    }
                    else{
                        return super.keyChar(key,status,time);
    
                    }
                };
    
                protected void drawFocus(Graphics graphics, boolean on) {
    
                    hasFocus = on;
                    super.drawFocus(graphics, on);
                    hasFocus = false;
    //              XYRect rect = new XYRect();
    //               graphics.setGlobalAlpha(200);
    //              getFocusRect(rect);
    //              drawHighlightRegion(graphics,HIGHLIGHT_FOCUS,true,rect.x,rect.y,rect.width,rect.height);
                }
    
                protected boolean navigationMovement(int dx, int dy, int status, int time) {
    
                    if(dy > 0 && (status & KeypadListener.STATUS_FOUR_WAY) == KeypadListener.STATUS_FOUR_WAY && (status & KeypadListener.STATUS_ALT) == KeypadListener.STATUS_ALT)
                    {
                        // do stuff
                        colourList_2.setFocus();
                        return true; // if you want the field to consume this event
                    }
                    return super.navigationMovement(dx, dy, status, time);
    
                };
    
            };
    
            colourList_1.setCallback(this);
              int elementLength = _elements.length;
             for(int count = 0; count < elementLength; ++count)
                {
                 colourList_1.insert(count);
                    this.insert(_elements[count], count);
                }
    
             colourList_2 = new ListField(){
    
                    protected void drawFocus(Graphics graphics, boolean on) {
                        hasFocus = on;
                        super.drawFocus(graphics, on);
                        hasFocus = false;
    
                    }
    
                    protected boolean keyChar(char key, int status, int time) {
                        if(colourList_2 == getLeafFieldWithFocus()){
                        //if(key=='t'||key=='T'){
                            if(key=='t'){
                            colourList_1.setFocus();
                            colourList_1.setSelectedIndex(0);
    
                        }
                        return true;
                        }
                        else{
                            return super.keyChar(key,status,time);
    
                        }
                    }
    
                };
    
                colourList_2.setCallback(this);
    
                 for(int count = 0; count < elementLength; ++count)
                    {
                     colourList_2.insert(count);
                        this.insert(_elements[count], count);
                    }
    
             //add(colourList);
             createComponents();
             layoutComponents();
    
        }
    
        public void createComponents() {
    
            listFieldManager= new VerticalFieldManager(Manager.VERTICAL_SCROLL|Manager.HORIZONTAL_SCROLL){
                protected void sublayout(int maxWidth, int maxHeight) {
                     super.sublayout( maxWidth, 2*colourList_1.getRowHeight());
                        setExtent(maxWidth,2*colourList_1.getRowHeight()); 
    
                };
    
            };
    
            listFieldManager_2= new VerticalFieldManager(Manager.VERTICAL_SCROLL|Manager.HORIZONTAL_SCROLL){
                protected void sublayout(int maxWidth, int maxHeight) {
                     super.sublayout( maxWidth, 2*colourList_2.getRowHeight());
                        setExtent(maxWidth,2*colourList_2.getRowHeight()); 
    
                };
    
            };
    
    //      userEditField=new CustomEditField(Utilities.getAdjustedWidth(150),
    //              Utilities.getAdjustWidth(2), Manager.NO_HORIZONTAL_SCROLL
    //              | Manager.VERTICAL_SCROLL, true);
    
        }
    
        public void layoutComponents() {
            // TODO Auto-generated method stub
            listFieldManager.add(colourList_1);
    
            listFieldManager_2.add(colourList_2);
    
            listFieldManager.setMargin(0,0,40,0);
            add(listFieldManager);
            add(listFieldManager_2);
    
        }
    
        public void initializeListeners() {
            // TODO Auto-generated method stub
    
        }
    
        public void setComponentsXYMargins() {
            // TODO Auto-generated method stub
    
        }
    
        public void drawListRow(ListField listField, Graphics graphics, int index,
                int y, int width) {
            int curSelected;
                if(!hasFocus){
                if(index%2  == 0){
    
                graphics.setColor(Color.RED);
                graphics.fillRect(0, y, width, listField.getRowHeight());
                graphics.setColor(Color.WHITE); 
    
                }else{
                graphics.setColor(Color.BLACK);
                graphics.fillRect(0, y, width, listField.getRowHeight());
                }
                }
                //graphics.fillRect(0,0,width,y);
    
                int xpos = 0;int ypos = 0;
                graphics.setFont(Font.getDefault());// please set a font value
                // this is first column text
                graphics.setColor(Color.PINK);
                graphics.drawText("column1"+index,xpos,y);
                xpos +=  columnWidth;
    
                //graphics.setColor(Color.RED);
                graphics.drawText("column2",xpos,y);
    
                xpos +=  columnWidth;
                graphics.drawText("column3",xpos,y);
    
                xpos +=  columnWidth;
    
                graphics.drawText("column4",xpos,y);
    
        }
    
        public Object get(ListField listField, int index) {
            // TODO Auto-generated method stub
             return _listElements.elementAt(index);
        }
    
        public int getPreferredWidth(ListField listField) {
            // TODO Auto-generated method stub
            return Graphics.getScreenWidth();
        }
    
        public int indexOfList(ListField listField, String prefix, int start) {
            // TODO Auto-generated method stub
            return _listElements.indexOf(prefix, start);
        }
    
        public void insert(String toInsert, int index)
        {
            _listElements.insertElementAt(toInsert, index);
        }
    
         public void erase()
            {
                _listElements.removeAllElements();
            }
    
    }
    
  • How to manage the events of mouse in Flash? What exactly "this" qualifies?

    Hi, I have problems with mouse (working in HTML5 Canvas) events I hope someone here can explain a few things.

    First of all, can someone explain what exactly "this" means? What I've read, it seems that 'this' refers to the current timeline that you are in, when you type the code?

    -------

    in any case, my problem, is that I have some nested clips I want to control (start, stop) with mouse Rollover events and using the code below, the parent layer seems to work, but I can't find a way to get a 'child' movieClip to use this code (and works). There are no tutorials on what I can find on this subject, so any help would be very appreciated.



    This.Stop ();

    frequency of var = 3;

    stage.enableMouseOver (frequency);

    This.on ("rollover", fl_MouseOverHandler_32);

    function fl_MouseOverHandler_32()

    {

    This.Play ();

    stage.enableMouseOver (0);

    }

    use:

    var tl = this;

    TL. Stop();

    frequency of var = 3;

    stage.enableMouseOver (frequency);

    TL.on ("rollover", fl_MouseOverHandler_32, NULL, true);

    function fl_MouseOverHandler_32()

    {

    TL. Play();

    stage.enableMouseOver (0);

    }

    child mc

    var rl = this;

    RL. Stop();

    frequency of var = 3;

    stage.enableMouseOver (frequency);

    rl.clickCatcher.on ("rollover", fl_MouseOverHandler_16, null, true);

    function fl_MouseOverHandler_16()

    {

    rl.gotoAndPlay (328);

    stage.enableMouseOver (0);

    }

  • I would like to know how to manage the ASN.1 encoding/decoding in LabView?

    I would like to know how to manage the ASN.1 encoding/decoding in LabView?

    Hello J,

    in the example given here , it looks like a format simple bytestream...

    You must read the byte stream, get the first and the second byte to decode the data type and length and then read & catalogued according to number of bytes. And then read 2 bytes and so on...

    Encoding will work the same but in reverse

  • Unexpected behavior with several structures of events manages the event itself.

    Hi, does anyone have an explanation of the following behavior?

    After 'Boolean 2' is enabled and then disabled the program "freezes". You can always pause the program but nothing does.
    For example, by pressing one of the file, Edit, View, project, Operate, tools, Windows, help or any other object inside the VI.

    This happens if I have two event structures who want to handle the same event, even if the flat sequence should be allowed only one run.

    This isn't a bug.

    Structures of the event should be used to handle different events. Given that you have entered your Boolean event in the two structures of the event, the event gets queued both when it occurs. This means one or the other be expected to manage the event and will, by default, lock the application. In the scale-measure of LabVIEW architectures, usually there is a structure of single event that handles all the events and then sends messages to the coast to the rest of the application to manage these events.

    There is a "Table locking" checkbox in the event dialog box which is by default enabled, but you should leave it on because it leads to bad practices otherwise.

  • How to manage the tv after hdmi to hdmi connection

    I want to connect to my computer windows 7 with tv on my Vizio tv hd tuner. I intend to use the hdmi to hdmi connections. After that I made the connection how to manage the tv without going back to the computer. My TV is in another adjacent room to my computer, sbout 20 ft away. Can I use a wireless mouse to manage the tv? The monitor and tv both appear at the same time? What are other options? Thank you for taking my question and to meet others, I put in the forum. Donnie

    I guess that the xbox 360 is a must for my setup. Thanks for your reply, Donnie

  • How to get the event when we change our simcard in BB device

    Hi all

    Please, someone tell how to get the event or any listener method that can automatically called when we change our SIM card device.

    Thanks in advance,

    TEJ

    Hi Tej,

    I came across some post, which may be useful for you

    http://supportforums.BlackBerry.com/T5/Java-development/is-there-a-way-to-get-the-mobile-or-phone-nu...

    http://supportforums.BlackBerry.com/T5/Java-development/is-SIM-ID-really-exist/m-p/54407#M5954

  • I don't see the event live from the URL indicated. How to join the event online please?

    I don't see the event live from the URL indicated. How to join the event online please?

    At the time you posted this question, the STM sessions had not started yet. The event started at 9:00 PT.  Please let me know if you are still experiencing difficulties to connect.

    Note: all sessions will be available for consultation on request after the event is finished at 1:00 pm PT.

    See you soon,.

    LKR

  • How to manage the SOAP response

    Hello (beginner vCO),

    I use the SOAP Plugin and trying to figure out how to manage the here, a host of SOAP response is the log I get the SOAP response

    [12:53:43.124 2014-05-09] [I] the settings...

    [12:53:43.135 2014-05-09] [I] the available settings:

    [12:53:43.136 2014-05-09] [I] + parameter name: "GetRequestStatusResult", value: "< response >

    < item >

    < ServiceRequestID > SR138917 < / ServiceRequestID >

    OS DEPLOYMENT < ServiceRequestStatus > < / ServiceRequestStatus >

    < ServiceRequestCreated > 09/05/2014-15:20:25 < / ServiceRequestCreated >

    < ServiceRequestCompleted > < / ServiceRequestCompleted >

    MA138921 < CurrentActivity > < / CurrentActivity >

    OS DEPLOYMENT < CurrentActivityTitle > < / CurrentActivityTitle >

    < ActivityStartUTC > 09/05/2014-15:32 < / ActivityStartUTC >

    < ActivityEndUTC > < / ActivityEndUTC >

    < DurationTotalSeconds > < / DurationTotalSeconds >

    < AverageDurationSeconds > < / AverageDurationSeconds >

    < SecondsOffAverage > < / SecondsOffAverage >

    < EstimatedCompletionUTC > < / EstimatedCompletionUTC >

    < / OutputParameters >

    < warning > < / warnings >

    < exceptions > < / Exceptions >

    < / response > '

    It will be better to try and parse text or try and use another method with vCO

    If you haven't done so already, take a look at the action of com.vmware.libarary.soap.processOutParameters.  It is the action that generated the log you have placed in us.  It generates an object Properties (key, value pairs) with the value for each setting that results.

    In your case, assuming that 'outProps' is the result of the above, you can use:

    var getRequestStatusResult = outProps.get ("GetRequestStatusResult");

    And to analyze the code XML with E4X as Ilian said.

  • How to manage the photos Lightroom when using 2 computers, keeping any changes made on one or the other?

    Based on http://forums.Adobe.com/thread/1308132?TSTART=0 I decided to add each question separately:

    Hello, I am very interested in buying Lightroom 5.2. I tried the RC that was missing today. Yet, I have several questions that I can't find really good conclusive answers, I'd like to get an answer before buying LR. Please do not write maybe like this or that (assumptions), because I don't want to start my entire workflow and then realize that I have to change all around, please reply, if you know for sure that something works and you are, preferably, using this method too.

    Is the big question, where I want to especially a conclusive answer:  How to manage the photos Lightroom when using 2 computers, keeping all the changes made on one of them, using the same photos for editing. I'm not going to use DNG. Details: I mainly use my old MacBook Pro, but I wish I could use my PC as it is much better (card: i5 2500K, 16 GB of RAM, SSD, USB3, nVidia GTX 560 TI etc.). I have 2 external HD that I could use, one for backup and one for the actual Photos/changes. I you will probably need to use as my internal HDs are fairly complete and I cannot be the kind of things simply delete or move to one (developer, without loss of music, programs etc.).

    On this basis, how do I save all such Photos folder (pictures and retouching and preferably presets too)?

    According to me, that it should be possible to work cross-platform without having to create a link to the files each time, or without having to keep export/import of the catalog, keeping the single catalog and the picture library on an external drive that is then switched between systems as needed.

    Obvious first requirement is an external drive that is formatted in a way (for example, FAT32) that it can be used on both platforms in read/write mode. Given that, if the catalogue AND folder parent si le catalogue ET le dossier parent images are both set to the same level in a global parent folder, then it should be possible to take advatage of ability of Lightroom to use relative paths instead of absolute paths to detect the images, no matter if the player is named (Mac) or lettering (PC). This is how "export as catalog of ' works, that is, it creates a 'package', alias a parent folder, containing the catalog and a replica of the folder hierarchy to exported along with the catalog images. Take this 'package' to another system (same OS or not) and "it works" even if the drive letter is different or the operating system is different... because the relative path of the image catalogue is always the same.

    I have not tested this cross-platform (if I have between various PC systems with letters of different readers) so for me it's still just a theory, but there may be others who have done this successfully.

  • How to check the event.target type in the "if" statement

    Hi, I have "roll-over" event listener and I wish that only works with music videos (without textfields etc.). I would write something like this:

    if(Event.Target == MovieClip) {do something}

    else {do something}

    This does not work properly.

    How to check the event.target type in the "if"?

    Thanks for any help.

    :

    If (getQualifiedClassName (Event.Target) == 'flash. display::MovieClip') {do something}

    else {do something}

    .

  • How to get the event when you click Add another button in a table.

    Hello
    How to recognize the event in processFormRequest click on the button Add another line of the footer of a table?

    Suppose if the ID is anotherRow (I mean ID of the button to add another line of the footer)

    If I give if (pageContext.getParameter ("anotherRow")! = null)... its not recognizing the event that is returning null only...

    I want to perform certain actions when the user clicks Add another line of footer. Please let me know the details of how identify when add another line is clicked...

    Thank you
    Srikanth

    Hello

    If you have only one table with add_row_button, and then copy the following code works perfectly

    If (tableBean.getName () .equals (pageContext.getParameter (SOURCE_PARAM)))
    (& ADD_ROWS_EVENT.equals (pageContext.getParameter (EVENT_PARAM)))
    {
    ...
    }

    tableBean is the Handle for your advanced table, hope, it will help you.

    Kind regards
    Out Sharma

  • How to view the download progress of an application on the Mac App Store

    When I download an app on the Mac App Store, A cannot see the status of the download. How to display the download progress of an application on the Mac App Store?

    Of application are what type you referring? If the app is in the launch area, then you will see the progress bar just below the icon on your dock launch pad. If you want to see the progress of an application that is not in the launch pad, then if you look at the Mac App Store update page, it shows the progress just below bar app that it is updating.

    Sorry - that was updated.

    See you soon,.

    GB

  • How to show the multiple declaration for an application

    How to show the multiple declaration for an application

    Thanks for your suggestions...

    Looking at the javadocs you can only save an indicator by application. You will need to do three separate applications and package them as an If you want three different indicators to be visible at a time. Or change the flag that (or which group) of the indicators you want to display.

Maybe you are looking for