Event: MouseEvent on real device

Simple but important question:

does

event:MouseEvent

work on real devices? I know that it works on the Simulator, but since there are some differences in the Simulator vs the real device behavior, it could be good to know.

Hey,.

Yes MouseEvents are similar to the events of "a touchpoint." So they will work the same as a simple "touch". Also its been recommended if you use the key that one point, you should stick with mouseevents because they use fewer resources. Good luck!

Tags: BlackBerry Developers

Similar Questions

  • Look at a FPS in real time of the events of several IPS devices

    What is the best strategy for the display of the IPS in real-time of the events of several IPS devices now that VMS filed end of LIFE?

    There was a nice view unique of all IPS events from all IPS devices run in VMS and I was wondering where I can tell people to receive the same information on their networks. I do not see in CSM and I do not think that they will find in MARCH. Please notify and correct me if I'm wrong. Thank you!

    You can use VEI. It is an observer of events that has a dashboard in real time also. You can import several sensors inside and view the events in real time.

    Link to VEI to 5.x versions:

    http://www.Cisco.com/cgi-bin/tablebuild.pl/IPS-EV

    Link to VEI to versions 4.x:

    http://www.Cisco.com/cgi-bin/tablebuild.pl/IDs-EV

    Kind regards

    Maryse.

  • Custom BrowserField appears in the real device Simulator only

    Hey guys, I got some piece of code that I can use to display HTML data stored in a variable. It worked fine in the Simulator, but when I tried to view it on a real device (I use 8900), it shows nothing.

    Here is the code (HTMLField.java): (I use the code here: http://supportforums.blackberry.com/t5/Java-Development/Display-HTML-in-a-Screen-Field/td-p/335074/p...)

    package app;
    
    import java.io.IOException;
    
    import javax.microedition.io.HttpConnection;
    
    import net.rim.device.api.browser.field.BrowserContent;
    import net.rim.device.api.browser.field.Event;
    import net.rim.device.api.browser.field.RedirectEvent;
    import net.rim.device.api.browser.field.RenderingApplication;
    import net.rim.device.api.browser.field.RenderingException;
    import net.rim.device.api.browser.field.RenderingOptions;
    import net.rim.device.api.browser.field.RenderingSession;
    import net.rim.device.api.browser.field.RequestedResource;
    import net.rim.device.api.system.Application;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.Status;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.io.http.HttpHeaders;
    
    /**
     * A field which displays HTML content.
     * @author Febiyan Rachman
     */
    public class HTMLField extends VerticalFieldManager implements RenderingApplication
    {
        private String data;
        private static final String REFERER = "referer";
        private RenderingSession renderingSession;
        private HttpConnection currentConnection;
        private Field field;
    
        /**
         * Default constructor
         * @param data
         */
        public HTMLField(String data)
        {
            this.data = data;
            renderingSession = RenderingSession.getNewInstance();
            // Enable JavaScript
            renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_ENABLED, true);
        }
    
        /**
         * Start parsing thread
         */
        public void parseHTML()
        {
            if(!data.startsWith("";
            HTMLFieldConnection thread = new HTMLFieldConnection(data, null, this);
            thread.start();
        }
    
        /**
         * Parse HTML
         * @param data
         */
        public void parseHTML(String data)
        {
            this.data = data;
            if(!data.startsWith("";
            HTMLFieldConnection thread = new HTMLFieldConnection(data, null, this);
            thread.start();
        }
    
        /**
         *
         * @param connection
         * @param event
         */
        public void processConnection(HttpConnection connection, Event event)
        {
            // Cancel previous request
            if (currentConnection != null) {
                try
                {
                    currentConnection.close();
                }
                catch (IOException e1) {
                }
            }
    
            // Set the current connection to the created connection
            currentConnection = connection;
    
            BrowserContent browserContent = null;
    
            try
            {
                browserContent = renderingSession.getBrowserContent(connection, this, event);
    
                if (browserContent != null)
                {
                    // Create a field which displays the HTML content
                    Field newField = browserContent.getDisplayableContent();
                    // Add field to this manager
                    if (newField != null)
                    {
                        if(field != null)
                        {
                            synchronized (UiApplication.getEventLock())
                            {
                                replace(field, newField);
                                field = null;
                                field = newField;
                            }
    
                        }
                        else
                        {
                            synchronized (UiApplication.getEventLock())
                            {
                                add(newField);
                                field = newField;
                            }
    
                        }
                    }
    
                    // Finish!
                    browserContent.finishLoading();
                }
            }
            catch (RenderingException renderingException)
            {
                System.out.println("RenderingException : " + renderingException);
            }
            catch (Exception exception)
            {
                System.out.println("Exception : " + exception);
                exception.printStackTrace();
            }
        }
    
        /**
         * @see net.rim.device.api.browser.field.RenderingApplication#eventOccurred(net.rim.device.api.browser.field.Event)
         */
        public Object eventOccurred(Event event)
        {
            int eventId = event.getUID();
    
            switch (eventId)
            {
                case Event.EVENT_URL_REQUESTED:
                {
                    HTMLFieldConnection thread = new HTMLFieldConnection(data, null, this);
                    thread.start();
                    break;
                }
                case Event.EVENT_BROWSER_CONTENT_CHANGED:
                {
                    break;
                }
                case Event.EVENT_REDIRECT:
                {
    
                    RedirectEvent e = (RedirectEvent) event;
                    String referrer = e.getSourceURL();
    
                    switch (e.getType())
                    {
                        case RedirectEvent.TYPE_SINGLE_FRAME_REDIRECT:
                            // Show redirect message
                            Application.getApplication().invokeAndWait(new Runnable()
                            {
                                public void run()
                                {
                                    Status.show("You are being redirected to a different page...");
                                }
                            });
    
                            break;
    
                        case RedirectEvent.TYPE_JAVASCRIPT:
                            break;
                        case RedirectEvent.TYPE_META:
                            // MSIE and Mozilla don't send a Referrer for META Refresh.
                            referrer = null;
                            break;
                        case RedirectEvent.TYPE_300_REDIRECT:
                            // MSIE, Mozilla, and Opera all send the original
                            // request's Referrer as the Referrer for the new
                            // request.
                            Object eventSource = e.getSource();
                            if (eventSource instanceof HttpConnection)
                            {
                                referrer = ((HttpConnection) eventSource).getRequestProperty(REFERER);
                            }
                            break;
                    }
    
                    HttpHeaders requestHeaders = new HttpHeaders();
                    requestHeaders.setProperty(REFERER, referrer);
                    HTMLFieldConnection thread = new HTMLFieldConnection(this.data, event, this);
                    thread.start();
                    break;
    
                }
                case Event.EVENT_CLOSE:
                    break;
    
                case Event.EVENT_SET_HEADER:        // No cache support
                case Event.EVENT_SET_HTTP_COOKIE:   // No cookie support
                case Event.EVENT_HISTORY:           // No history support
                case Event.EVENT_EXECUTING_SCRIPT:  // No progress bar is supported
                case Event.EVENT_FULL_WINDOW:       // No full window support
                case Event.EVENT_STOP:              // No stop loading support
                default:
            }
    
            return null;
        }
    
        public int getAvailableHeight(BrowserContent browserContent)
        {
            return 0;
        }
    
        public int getAvailableWidth(BrowserContent browserContent)
        {
            return 0;
        }
    
        public String getHTTPCookie(String url)
        {
            return null;
        }
    
        public int getHistoryPosition(BrowserContent browserContent)
        {
            return 0;
        }
    
        public HttpConnection getResource(RequestedResource resource, BrowserContent referrer)
        {
            return null;
        }
    
        public void invokeRunnable(Runnable runnable)
        {
        }
    
    }
    

    BrowserApp.java

    package app;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.EditField;
    import net.rim.device.api.ui.container.MainScreen;
    
    /**
     * @author Febiyan Rachman
     */
    public class BrowserApp extends UiApplication implements FieldChangeListener
    {
        HTMLField htmlField;
        EditField textField;
    
        public static void main(String[] args)
        {
            // TODO Auto-generated method stub
            BrowserApp app = new BrowserApp();
            app.enterEventDispatcher();
        }
    
        /**
         * Default constructor
         */
        public BrowserApp()
        {
            MainScreen screen = new MainScreen();
            screen.setTitle("Browser Test");
            htmlField = new HTMLField("");
            //screen.add();
            textField = new EditField("Tes : ", "");
            ButtonField button = new ButtonField("click", ButtonField.CONSUME_CLICK);
            button.setChangeListener(this);
            screen.add(textField);
            screen.add(htmlField);
            screen.add(button);
            pushScreen(screen);
        }
    
        // parseHTML and display it
        public void fieldChanged(Field field, int context)
        {
            // TODO Auto-generated method stub
            htmlField.parseHTML(textField.getText());
        }
    
    }
    

    HTMLFieldConnection.java

    package app;
    
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.DataInputStream;
    import java.io.DataOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    
    import javax.microedition.io.HttpConnection;
    
    import net.rim.device.api.browser.field.Event;
    
    public class HTMLFieldConnection extends Thread implements HttpConnection
    {
        private long streamLength = 7000;
        private DataInputStream dataInput;
        private InputStream in;
        private String encoding = "text/html";
        private HTMLField htmlField;
        private Event event;
        private String data;
    
        /**
         * Default
         * @param data
         * @param event : event object for eventOccured() function
         * @param htmlField : HTML display field
         */
        public HTMLFieldConnection(String data, Event event, HTMLField htmlField)
        {
            this.data = data;
            this.htmlField = htmlField;
            this.event = event;
        }
    
        public String getURL()
        {
            return "";
        }
    
        public String getProtocol()
        {
            return "";
        }
    
        public String getHost()
        {
            return "";
        }
    
        public String getFile()
        {
            return "";
        }
    
        public String getRef()
        {
            return "";
        }
    
        public String getQuery()
        {
            return "";
        }
    
        public int getPort()
        {
            return 0;
        }
    
        public String getRequestMethod()
        {
            return "";
        }
    
        public void setRequestMethod(String s) throws IOException
        {
    
        }
    
        public String getRequestProperty(String s)
        {
            return "";
        }
    
        public void setRequestProperty(String s, String s1) throws IOException
        {
    
        }
    
        public int getResponseCode() throws IOException
        {
            return 200;
        }
    
        public String getResponseMessage() throws IOException
        {
            return "";
        }
    
        public long getExpiration() throws IOException
        {
            return 0;
        }
    
        public long getDate() throws IOException
        {
            return 0;
        }
    
        public long getLastModified() throws IOException
        {
            return 0;
        }
    
        public String getHeaderField(String s) throws IOException
        {
            return "";
        }
    
        public int getHeaderFieldInt(String s, int i) throws IOException
        {
            return 0;
        }
    
        public long getHeaderFieldDate(String s, long l) throws IOException
        {
            return 0;
        }
    
        public String getHeaderField(int i) throws IOException
        {
            return "";
        }
    
        public String getHeaderFieldKey(int i) throws IOException
        {
            return "";
        }
    
        public String getType()
        {
            return "text/html";
        }
    
        public String getEncoding()
        {
            return encoding;
        }
    
        public long getLength()
        {
            return streamLength;
        }
    
        public InputStream openInputStream() throws IOException
        {
            return in;
        }
    
        public DataInputStream openDataInputStream() throws IOException
        {
            return dataInput;
        }
    
        public void close() throws IOException
        {
    
        }
    
        public OutputStream openOutputStream() throws IOException
        {
            return new ByteArrayOutputStream();
        }
    
        public DataOutputStream openDataOutputStream() throws IOException
        {
            return new DataOutputStream(new ByteArrayOutputStream());
        }
    
        public void run()
        {
             try
             {
                 in = new ByteArrayInputStream(data.getBytes("UTF-8"));
                 dataInput = new DataInputStream(in);
             }
             catch (Exception e)
             {
                 System.out.println("HttpConnectionImpl : Exception : " + e);
             }
            this.htmlField.processConnection(this, this.event);
        }
    }
    

    Is there something wrong with it?

    Yes, as I finally tried again and again, it seems that the OS 5 does not support old stuff like that, it has its own browserfield2.

  • Place of current residence (Longitude/Latitude) GPS does not work on real device

    Hello

    I wrote a small test application for GPS/latidue longitude. It works fine on simulator (9630), but not on the real device (BlackBerry Tour). Am I missing something? I have to set anything on the device? I already have the data plan activated in the device. Should I have any extra service from the supplier in order to let this GPS thing work?

    Here's my test code:

    public class GPSDemoScreen extends MainScreen implements FieldChangeListener{
        private ButtonField btnGPSTest;
        private EditField edStatus;    
    
        private BBTest bbTest = null;
        private VerticalFieldManager vfManager = null;
    
          // Constants -----------------------------------------------------------------------------------------------------------------
        private static final int GRADE_INTERVAL=5;  // Seconds - represents the number of updates over which alt is calculated.
     //   private static final long ID = 0x5d459971bb15ae7aL; //com.rim.samples.device.gpsdemo.GPSDemo.ID
        private static final int CAPTURE_INTERVAL=5;    // We record a location every 5 seconds.
        private static final int SENDING_INTERVAL=30;   // The interval in seconds after which the information is sent to the server.
    
        // When running this application, select options from the menu and replace 
        // with the name of the computer which is running the GPSServer application found in
        // com.rim.samples.server, typically the local machine.  Alternatively, the _hostName variable
        // can be hard-coded below with no need to further modify the server name while running the application.
    
        private static int _interval = 1;   // Seconds - this is the period of position query.
        private static float[] _altitudes;
        private static float[] _horizontalDistances;
    
         private long _startTime;
        private float _wayHorizontalDistance;
        private float _horizontalDistance;
        private float _verticalDistance;
        private StringBuffer _messageString;
        private LocationProvider _locationProvider;
        //private ServerConnectThread _serverConnectThread;   
    
        /** Creates a new instance of GPSDemoScreen */
        public GPSDemoScreen(BBTest bbtest) {
            super(DEFAULT_MENU | DEFAULT_CLOSE);
            bbTest = bbtest;
    
            initComponent();
        }
    
        private void initComponent(){
            this.setTitle("GPS Demo");
         //   this.bbTest.setBGImage(vfManager, this);
            // Used by waypoints, represents the time since the last waypoint.
            _startTime = System.currentTimeMillis();
            _altitudes = new float[GRADE_INTERVAL];
            _horizontalDistances = new float[GRADE_INTERVAL];
            _messageString = new StringBuffer();
    
            btnGPSTest = new ButtonField("GPS Test", ButtonField.CONSUME_CLICK);
            btnGPSTest.setChangeListener(this);
            edStatus = new EditField( Field.NON_FOCUSABLE);
            edStatus.setText("retriving Longitude and Latitude.Please wait..");
            this.add(btnGPSTest);
            this.add(edStatus);
    
        }
    
         /**
         * Rounds off a given double to the provided number of decimal places.
         * @param d The double to round off.
         * @param decimal The number of decimal places to retain.
         * @return A double with the number of decimal places specified.
         */
        private static double round(double d, int decimal)
        {
            double powerOfTen = 1;
    
            while (decimal-- > 0)
            {
                powerOfTen *= 10.0;
            }
    
            double d1 = d * powerOfTen;
            int d1asint = (int)d1; // Clip the decimal portion away and cache the cast, this is a costly transformation.
            double d2 = d1 - d1asint; // Get the remainder of the double.
    
            // Is the remainder > 0.5? if so, round up, otherwise round down (lump in .5 with > case for simplicity).
            return ( d2 >= 0.5 ? (d1asint + 1)/powerOfTen : (d1asint)/powerOfTen);
        }
    
         /**
         * Invokes the Location API with the default criteria.
         *
         * @return True if the Location Provider was successfully started; false otherwise.
         */
        private boolean startLocationUpdate()
        {
            boolean retval = false;
    
            try
            {
                _locationProvider = LocationProvider.getInstance(null);
    
                if ( _locationProvider == null )
                {
                    // We would like to display a dialog box indicating that GPS isn't supported,
                    // but because the event-dispatcher thread hasn't been started yet, modal
                    // screens cannot be pushed onto the display stack.  So delay this operation
                    // until the event-dispatcher thread is running by asking it to invoke the
                    // following Runnable object as soon as it can.
                    Runnable showGpsUnsupportedDialog = new Runnable()
                    {
                        public void run() {
                            Dialog.alert("GPS is not supported on this platform, exiting...");
                            System.exit( 1 );
                        }
                    };
    
                    UiApplication.getApplication().invokeLater( showGpsUnsupportedDialog );  // Ask event-dispatcher thread to display dialog ASAP.
                }
                else
                {
                    // Only a single listener can be associated with a provider, and unsetting it
                    // involves the same call but with null, therefore, no need to cache the listener
                    // instance request an update every second.
                    _locationProvider.setLocationListener(new LocationListenerImpl(), _interval, 1, 1);
                    retval = true;
                }
            }
            catch (LocationException le)
            {
                System.err.println("Failed to instantiate the LocationProvider object, exiting...");
                System.err.println(le);
                System.exit(0);
            }
            return retval;
        }
          /**
         * Update the GUI with the data just received.
         */
        private void updateLocationScreen(final String msg)
        {
            UiApplication.getApplication().invokeLater(new Runnable()
            {
                public void run()
                {
                    System.out.println(msg.toString());
                    edStatus.setText(msg);
                    Dialog.alert(msg.toString());
                }
            });
        }
    
      public void fieldChanged(Field field, int context){
             if(field.equals(btnGPSTest)){
                startLocationUpdate();
             }
    
         }
        /** Standard Escape-key handler */
        public boolean keyChar(char key, int status, int time) {
            boolean retval = false;
            switch (key) {
                case Characters.ESCAPE:
                   // UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());
                    break;
                default:
                    retval = super.keyChar(key, status, time);
            }
            return retval;
        }
    
         /**
         * Implementation of the LocationListener interface.
         */
        private class LocationListenerImpl implements LocationListener
        {
            // Members ----------------------------------------------------------------------------------------------
            private int captureCount;
            private int sendCount;
    
            // Methods ----------------------------------------------------------------------------------------------
            /**
             * @see javax.microedition.location.LocationListener#locationUpdated(LocationProvider,Location)
             */
            public void locationUpdated(LocationProvider provider, Location location)
            {
                try{
                    if(location.isValid())
                    {
                        float heading = location.getCourse();
                        double longitude = location.getQualifiedCoordinates().getLongitude();
                        double latitude = location.getQualifiedCoordinates().getLatitude();
                        float altitude = location.getQualifiedCoordinates().getAltitude();
                        float speed = location.getSpeed();                
    
                        // Horizontal distance to send to server.
                        float horizontalDistance = speed * _interval;
                        _horizontalDistance += horizontalDistance;
    
                        // Horizontal distance for this waypoint.
                        _wayHorizontalDistance += horizontalDistance;
    
                        // Distance over the current interval.
                        float totalDist = 0; 
    
                        // Moving average grade.
                        for(int i = 0; i < GRADE_INTERVAL - 1; ++i)
                        {
                            _altitudes[i] = _altitudes[i+1];
                            _horizontalDistances[i] = _horizontalDistances[i+1];
                            totalDist = totalDist + _horizontalDistances[i];
                        }
    
                        _altitudes[GRADE_INTERVAL-1] = altitude;
                        _horizontalDistances[GRADE_INTERVAL-1] = speed*_interval;
                        totalDist= totalDist + _horizontalDistances[GRADE_INTERVAL-1];
                        float grade = (totalDist==0.0F)? Float.NaN : ( (_altitudes[4] - _altitudes[0]) * 100/totalDist);
    
                        // Running total of the vertical distance gain.
                        float altGain = _altitudes[GRADE_INTERVAL-1] - _altitudes[GRADE_INTERVAL-2];
    
                        if (altGain > 0)
                        {
                            _verticalDistance = _verticalDistance + altGain;
                        }
    
                        captureCount += _interval;
    
                        // If we're mod zero then it's time to record this data.
                        captureCount %= CAPTURE_INTERVAL;
    
                        // Information to be sent to the server.
                        if ( captureCount == 0 )
                        {
                            // Minimize garbage creation by appending only character primitives, no extra String objects created that way.
                            _messageString.append(round(longitude,4));
                            _messageString.append(';');
                            _messageString.append(round(latitude,4));
                            _messageString.append(';');
                            _messageString.append(round(altitude,2));
                            _messageString.append(';');
                            _messageString.append(_horizontalDistance);
                            _messageString.append(';');
                            _messageString.append(round(speed,2));
                            _messageString.append(';');
                            _messageString.append(System.currentTimeMillis());
                            _messageString.append(':');
                            sendCount += CAPTURE_INTERVAL;
                            _horizontalDistance = 0;
                        }
    
                        // If we're mod zero then it's time to send.
                        sendCount %= SENDING_INTERVAL;
    
                        synchronized(this)
                        {
                            if (sendCount == 0 && _messageString.length() != 0)
                            {
                            //  _serverConnectThread.sendUpdate(_messageString.toString());
                                _messageString.setLength(0);
                            }
                        }
    
                        // Information to be displayed on the device.
                        StringBuffer sb = new StringBuffer();
                        sb.append("Longitude: ");
                        sb.append(longitude);
                        sb.append("\n");
                        sb.append("Latitude: ");
                        sb.append(latitude);
                        sb.append("\n");
                        sb.append("Altitude: ");
                        sb.append(altitude);
                        sb.append(" m");
                        sb.append("\n");
                        sb.append("Heading relative to true north: ");
                        sb.append(heading);
                        sb.append("\n");
                        sb.append("Speed : ");
                        sb.append(speed);
                        sb.append(" m/s");
                        sb.append("\n");
                        sb.append("Grade : ");
                        if(Float.isNaN(grade))sb.append(" Not available");
                        else sb.append(grade+" %");
                        GPSDemoScreen.this.updateLocationScreen(sb.toString());
                    }
                }catch(Exception ex){
                    System.out.println(ex.toString());
                    ex.printStackTrace();
                }
            }
    
            public void providerStateChanged(LocationProvider provider, int newState)
            {
                // Not implemented.
            }
        }
    }
    

    It works fine now, when I tried door.

  • Application of background visible on a real device (all well in the Simulator)

    Hello

    I developed a small backgroundapplication, which shows a menu entry in the app phone "call via Asterisk. If I choose this option a defined number is called. Later, I want to add the number as dtmf tones.

    The application uses excactly as expected in the device Simulator 8310-JDE (included in the eclipse plugin) on JDE 4.5. with eclipse.

    But when I deploy the application (signed) to a real 8310 with firmeware v4.5.0.81, it appears an application icon on the desktop (homescreen) of blackberry and the menuentry in the phone app is missing. Why the application is not deployed as a background on the real dev app. ?

    The only difference between the Simulator and real device is the language chosen, but I don't think it's important.

    The application consists of files, as shown below.

    import net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository;import net.rim.device.api.system.Application;
    
    public class Asterisk extends Application {   public static void main(String[] args)    {            // Create a new instance of the application            // and start it's event thread.            new Asterisk().enterEventDispatcher();    }
    
        public Asterisk()    {        //create a new instance of the menuitem       AsteriskMenuItem asterisMenuItem = new AsteriskMenuItem(40);
    
          //get the instance of the standard-menu an ad the new menuitem        ApplicationMenuItemRepository     .getInstance().addMenuItem        (ApplicationMenuItemRepository.MENUITEM_PHONE,asterisMenuItem);
    
        }}
    
    package com.schiffl.mobile.asteris;
    
    import net.rim.blackberry.api.invoke.Invoke;import net.rim.blackberry.api.invoke.PhoneArguments;import net.rim.blackberry.api.mail.Message;import net.rim.blackberry.api.menuitem.ApplicationMenuItem;import net.rim.blackberry.api.phone.Phone;import net.rim.blackberry.api.phone.PhoneCall;import net.rim.blackberry.api.phone.PhoneListener;import net.rim.device.api.system.ControlledAccessException;import net.rim.device.api.ui.Field;import net.rim.device.api.ui.UiApplication;
    
    public class AsteriskMenuItem  extends ApplicationMenuItem{     //number to be dialed via Asterisk        String servicenumber  = "1234567";
    
          //using the default constructors here.        AsteriskMenuItem(int order)       {         super(order);     }
    
           //methods we must implement       //Run is called when the menuItem is invoked      public Object run(Object context)     {             /*             * Normally the dialed number could be found in the context object             * because of a bug in the api which is solved in v.4.7 the context            * object is always null for MENUITEM_PHONE so it is necessary to          * use a workaround, here the number is extracted from the field with focus,           * which contains the dialed number           */            Field myField = UiApplication.getUiApplication().getActiveScreen().getFieldWithFocus();           String phoneNumber = myField.toString();
    
              //TODO Convert phoneNumber to dtmf-tones
    
              try           {             PhoneArguments call = new PhoneArguments(PhoneArguments.ARG_CALL,servicenumber);              Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, call);
    
    //                PhoneCall myCall = Phone.getActiveCall();//               myCall.sendDTMFTones(phoneNumber);            }         /*             * The ControlledAccessException is thrown             * if the system administrator restricts access to the phone application           * using application control.          */           catch (ControlledAccessException e)           {             //TODO some exceptionhandling             }
    
             //normally you can do something with the given context inside of the run-method           //because of a bug in the API the context is always null so, we don't use it...           return context;       }
    
           //toString should return the string we want to        //use as the lable of the menuItem        public String toString(){         return "Call via Asterisk";       }
    
    }
    

    The entry for the RRT signature was missing in my .csl file. I change it manually, I added

    '52525400 = RIM API execution' requested signatures, deployed and it works...

  • Source:-elxcna (adapter Emulax CNA) event ID:-129 error:-\Device\RaidPort1, restore the device, has been published.

    Hi all

    Source:-elxcna (adapter Emulax CNA)
    Event ID:-129
    Error:-\Device\RaidPort1, restore the device, has been published.
    Server:-Server Rack, Windows 2008 R2
    Installed application:-installed Backup tool and IBM tape library connected by Cisco nexus switch

    Summary:-each time the backup tool initiating any SCSI command etc. for library of tapes, just after a few minutes in the event log, server shows "restore the device, \Device\RaidPort1, has been issued." and the tape library configured in backup tool disconnected from the physical tape library.

    Up to now steps below was taken but no luck:
    1. test Unit Ready has been disabled in the registry
    2 adapter ANC, fresh of zoning has been replaced.
    3 firmware and driver from the adapter of the ANC has been updated.
    4. timeout was defined according to the guidelines of this document:- http://blogs.msdn.com/b/ntdebugging/archive/2011/05/06/understanding-storage-timeouts-and-event-129-errors.aspx

    Comment:-26 fev 12:00 Am, I put to tape library firmware update and then we got
    This 129 February 26 event id error 03:00.

    Need help? :)

    Hi SabarnaDeb,

    Thanks for posting your query in the Microsoft Community Forums.

    As the question is limited to Rack in Windows 2008 server, it is better suited for the IT Pro TechNet public. Please ask your question in the Forum on TechNet Support.

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer

    I hope it helps. If you have any questions about Windows in the future, please let us know. We will be happy to help you.

  • Council of softkey is not coming by clicking textfield on Simulator, it will show on real device

    I wore an android application for bb 10 app, here I am facing problems.
    1 key board is not coming by clicking textfield on Simulator, it will show on real device

    2. I want to show 6 pictures long in size on a page to display scrolling but memory is out of range

    Hello

    No. 1: If you started the Q10 Simulator, it is expected for the real device has a physical keyboard. The Simulator startup, select the Z10 and test again to get the virtual keyboard.

    2: this question would better fit for a new topic. In any case, a strategy would be to cut the long cards for the smaller pieces and loading them dynamically, effectively keep in mind a few.

  • Google addresses on real device

    Hi guys,.

    I have an application that uses the API of Google Places which is https connection. It works fine on the emulator when I put specific ssl and https settings in the .rimpublic file:

    [HTTPS HANDLER]
    application.handler.https.allowUntrustedServer = true
    [TLS HANDLER]
    application.handler.tls.allowUntrustedServer = true
    application.handler.tls.logging = true
    

    BUT, when I run on the real device, https fails. What should I do to make it work on my phone? Where should I change these settings? It is up to the carriers and the RIM servers, or I can do in the application?

    Hello

    Here is an article that talks about the HTTPS on BlackBerry connection.  I hope this helps.

    http://supportforums.BlackBerry.com/T5/Java-development/BlackBerry-support-for-HTTPS-connection/Ta-p...

    Thank you

    Naveen M

  • Impossible to debug on real device

    Hello

    When I try to debug an application on a real device debugging I get an error that a debug file is missing.

    After the tutorial on http://supportforums.blackberry.com/rim/attachments/rim/java_dev@tkb/18/1/How_to_Debug_and_Optimize _... he said that I may receive this error if "the reason why this might happen is that the version of the software on your device does not correspond to the.
    the software version of your Simulator

    I use blackberry curve withDevice software versio 5.0.0.103

    The research unit of the Simulator for OS 5.0.0 it does'nt seem to be a simulator for this version of the software.

    What can I do?

    You must launch the application manually on the device. I don't know why the breakpoints are not recognized. Try to delete the app, reboot the device, the app package, sing, load (debug as)... you can tell that the debugger is attached with success by the lines displayed in the Console view.

  • HttpPushDemo throws the error of missing on real device resource

    I am trying to run the example of httppushdemo on a real device to test for problems with an application to push.  However, if I run the application in the device, I get the error "Missing resource com.rim.samples.device.resource.HTTPPushDemoRes.

    I looked everywhere to find out how to get the resource on the device and impossible to find a solution.  The documentation I found would lead me to believe that it should be compiled in the Cod.

    Why I'm so confused (and frustrated after a long day of our push to debug problems)

    Thank you

    -Bill

    In older levels (4.3 and earlier OS), RIM ran the code, so that the resources (labels field, the names of menu etc.) where in a separate package.  It's a good way to demonstrate how you could internationalize applications, but also everyone confused because putting the application on the device, you need to charge upward of the cod resources as well.

    At the latest OS (4.5 +), they do not do this.

    The demo of http push has not changed, so you can take the source of the 4.5 or later in a previous level JDE and compile it.  It will take so NOT all external files of cod.  That's what I recommend you do.

    However, for you to win download the JDE together for a single file, it is here:

    /**
     * HTTPPushDemo.java
     *
     * Copyright © 1998-2008 Research In Motion Ltd.
     *
     * Note: For the sake of simplicity, this sample application may not leverage
     * resource bundles and resource strings.  However, it is STRONGLY recommended
     * that application developers make use of the localization features available
     * within the BlackBerry development platform to ensure a seamless application
     * experience across a variety of languages and geographies.  For more information
     * on localizing your application, please refer to the BlackBerry Java Development
     * Environment Development Guide associated with this release.
     */
    
    package com.rim.samples.device.httppushdemo;
    
    import java.io.*;
    import javax.microedition.io.*;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.system.*;
    import net.rim.device.api.util.*;
    import net.rim.device.api.io.http.*;
    
    /**
     * The client side of a simple HTTP Push system.
     * This application will listen for image data on the specified port and
     * render the data when it arrives.
     */
    public class HTTPPushDemo extends UiApplication
    {
        // Constants ----------------------------------------------------------------
        private static final String URL = "http://:100"; // PORT 100.
        private static final int CHUNK_SIZE = 256;
    
        // Members ------------------------------------------------------------------
        private ListeningThread _listeningThread;
        private HTTPPushDemoScreen _mainScreen;
        private RichTextField _infoField;
        private RichTextField _imageField;
    
        public static void main(String[] args)
        {
            HTTPPushDemo theApp = new HTTPPushDemo();
            theApp.enterEventDispatcher();
        }
    
        // Constructor --------------------------------------------------------------
        public HTTPPushDemo()
        {
            _mainScreen = new HTTPPushDemoScreen();
            _mainScreen.setTitle(new LabelField("HTTP Push Demo" , LabelField.USE_ALL_WIDTH));
    
            _infoField = new RichTextField();
            _mainScreen.add(_infoField);
    
            _mainScreen.add(new SeparatorField());
    
            _imageField = new RichTextField();
            _mainScreen.add(_imageField);
    
            // Spin off the listening thread.
            _listeningThread = new ListeningThread();
            _listeningThread.start();
    
            _infoField.setText("HTTP Listen object started");
    
            pushScreen(_mainScreen);
        }
    
        // Inner Classes ------------------------------------------------------------
        private class ListeningThread extends Thread
        {
            private boolean _stop = false;
            private StreamConnectionNotifier _notify;
    
            public synchronized void stop()
            {
                _stop = true;
                try
                {
                    // Close the connection so the thread will return.
                    _notify.close();
                }
                catch (IOException e)
                {
                    System.err.println(e.toString());
                }
                catch (NullPointerException e)
                {
                    // The notify object likely failed to open, due to an IOException.
                }
            }
    
            public void run()
            {
    
                StreamConnection stream = null;
                InputStream input = null;
                MDSPushInputStream pushInputStream=null;
    
                while (!_stop)
                {
                try
                    {
    
                        // Synchronize here so that we don't end up creating a connection that is never closed.
                        synchronized(this)
                        {
                            // Open the connection once (or re-open after an IOException),  so we don't end up
                            // in a race condition, where a push is lost if it comes in before the connection
                            // is open again. We open the url with a parameter that indicates that we should
                            // always use MDS when attempting to connect.
                            _notify = (StreamConnectionNotifier)Connector.open(URL + ";deviceside=false");
                        }
    
                        while (!_stop)
                        {
    
                            // NOTE: the following will block until data is received.
                            stream = _notify.acceptAndOpen();
    
                            try
                            {
                                input = stream.openInputStream();
                                pushInputStream= new MDSPushInputStream((HttpServerConnection)stream, input);
    
                                // Extract the data from the input stream.
    
                                DataBuffer db = new DataBuffer();
                                byte[] data = new byte[CHUNK_SIZE];
                                int chunk = 0;
    
                                while ( -1 != (chunk = input.read(data)) )
                                {
                                    db.write(data, 0, chunk);
                                }
    
                                updateMessage(data);
    
                                // This method is called to accept the push.
                                pushInputStream.accept();
    
                                input.close();
                                stream.close();
    
                                data = db.getArray();
    
                            }
                            catch (IOException e1)
                            {
                                // A problem occurred with the input stream , however, the original
                                // StreamConnectionNotifier is still valid.
                                System.err.println(e1.toString());
    
                                if ( input != null )
                                {
                                    try
                                    {
                                        input.close();
                                    }
                                    catch (IOException e2)
                                    {
                                    }
                                }
    
                                if ( stream != null )
                                {
                                    try
                                    {
                                        stream.close();
                                    }
                                    catch (IOException e2)
                                    {
                                    }
                                }
                            }
                        }
    
                        _notify.close();
                        _notify = null;   
    
                    }
                    catch (IOException ioe)
                    {
                        // Likely the stream was closed. Catches the exception thrown by
                        // _notify.acceptAndOpen() when this program exits.
    
                        if ( _notify != null )
                        {
                            try
                            {
                                _notify.close();
                                _notify = null;
                            }
                            catch ( IOException e )
                            {
                            }
                        }
                    }
                }
            }
        }
    
        private void updateMessage(final byte[] data)
        {
            Application.getApplication().invokeLater(new Runnable()
            {
                public void run()
                {
                    // Query the user to load the received message.
                    String[] choices = {"Ok" , "Cancel" };
    
                    if ( 0 != Dialog.ask("New message received. Do you want to render it?" , choices, 0) )
                    {
                        return;
                    }
    
                    _infoField.setText("Text received - size:  " + data.length);
    
                    try
                    {
                       _imageField.setText(new String(data));
                    }
                    catch (Exception e)
                    {
                        Dialog.inform(e.toString());
                        System.err.println(e.toString());
                    }
                }
            });
        }
    
        protected void onExit()
        {
            // Kill the listening thread.
            _listeningThread.stop();
    
            try
            {
                _listeningThread.join();
            }
            catch (InterruptedException e)
            {
                System.err.println(e.toString());
            }
    
        }
    
        private class HTTPPushDemoScreen extends MainScreen
        {
    
            /**
             * @see net.rim.device.api.ui.Screen#close()
             */
            public void close()
            {
                onExit();
    
                super.close();
            }
        }
    }
    
  • How to debug on a real device?

    Hello everyone,

    I'm a new java developer using Eclipse plug-ins. every time when I had mistakes, only to debug codes on the Simulator, but I want the debugging on a real device. I already sign with BlackBerry $ 20. You guys can tell me how, please?

    Thank you

    Concerning

    In Eclipse:

    - Run > Debug Configurations...

    -Click Terminal BlackBerry on your left and then click the new (blank page with star.

    - Check the projects you want to deploy on your device.

    -Click the general tab and select debugging under "display in Favorites menu".

    -Make sure that your device is connected, and then press the debug button.

    -In the future, looking for a Bug icon in your toolbar, and then click the arrow next to it, then click on your project.

  • Problem test on a real device - app does not start

    I use

    Eclipse 3.5 Galileo

    BlackBerry JDE 5.0

    BlackBerry Desktop Software 6.0.0.43

    a real device Curve 8900 with the software updated to 5.0.0.681.

    I read that Simulators have problems with Blackberry Maps. So, I wanted to test my application on the actual device to see if I've run into the same errors. Packaging and code-signing everything has worked well. I then installed the software on the device through Blackberry Desktop software. I found the icon in the downloads folder of the device but you cannot start the application. When I click on it nothing happens. No no error message, nothing, simply no reaction. So I have no idea what went wrong. Does anyone have an idea or suggestion how know what's the problem?

    I can start and run the program on the Simulator.

    Hi navad.

    I had the same problem a few days ago.

    Only the developed app one shows no reaction. all other things are working well.

    to me, helped the following:

    When the Blackberry is running, remove the battery and wait 2 minutes.

    Replace the battery and the blackberry again.

    After that, you should be able to run your application.

    I hope this will help.

    CU

    Michael

  • Is it possible to intercept all start them console.log messages on real device using web Inspector?

    I'm trying to debug initiaization Stadium on a real device.  The problem is that I won't be able to establish a remote debugging session until the application is running.  And by then, I miss any message on the console that I have put in my initialization codes. Is there a technique to catch all console messages?

    In Web Inspector, you can also press CTRL + r to trigger a cooldown.

  • my app works in ripple, but not in real device :(

    I made a request of 'fitness' with webwork development,

    It works very well in ripple and build, with success.

    but BB app world answer me it shows a blank page so it rejected, & I shocked when seen on real device from my friend did not work and the really white page

    I do not know

    how it works well on the training and do not work on the real device!

    Good luck.  If you're stuck on how to do it, here is the complete documentation on how to perform debugging using Web Inspector:

    https://developer.BlackBerry.com/HTML5/documentation/web_inspector_overview_1553586_11.html

  • Unable to connect to my real device webservice (KSOAP)

    Hello friends of BB,

    I wrote an application for my black berry. My application to connect to a PHP Web service. I use the ksoap library to connect to my webservice. It works on my Simulator, but when I add my request on my real device does not connect to my webservice. I think I need to add something to my url. I call this URL:

    final String url = http://www.*****.de/webservice/dbservice.php
    
    final HttpTransport http = new HttpTransport(url);
    
    ...
    

    I hope someone can help me.

    greeting

    Dennis

    See the sticky thread here.

    http://supportforums.BlackBerry.com/T5/Java-development/connecting-your-BlackBerry-http-and-socket-c...

    As you can guess, this question has been answered repeatedly asked.

    In short, the Simulator emualtes a device connected to BES (if MDS - CS is running), it is not necessary for URL parameters in this environment.

    However, once you get on a real device that is not connected to BES, you will need to do a bit of work to determine what types of connectivity are available and develop your parameters of connection accordingly.

    A direct TCP connection (for example) will require "; deviceside = true' + settings specific to the network of the AFN.

    See this article:

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

Maybe you are looking for