HTTP connection on BlackBerry 9000 Simulator problem

Hello

I'm launching of the HTTP demo on BlackBerry 9000 Simulator. Demo works well, but don't make any connection. He keeps trying, and after a while, I get the error message below

It shows "java.io.InterruptedException: Local connection has expired after ~ 120000' demo area of the screen."

I start the Simulator MDS_CS according to the documentation. My Simulator shows also "Zéro" signal strength that I try to change by "simulate-> network properties, but there is zero.

I am not able to access any URL through Simulator browsor as well. When I try to see the me following message

Please adivce.

On the Simulator, go click the 'Manage connections' and see if your radio is turned on.

Tags: BlackBerry Developers

Similar Questions

  • Custom image drop-down list appears not appropriate on Blackberry 9000 Simulator

    Hello

    I created the custom in my code drop-down list. my code works fine for other simulators.

    But when I tried to run on Blackberry 9000 Simulator from the drop-down list not shown correct image he cuts half the size of the image.

    I check my code, I did not manually height for the drop-down list.

    Please tell me why image appears not appropriate Simulator 9000.

    Welcome to the forums.

    I'm guessing that you don't know how to use the insert of Code button.  If you look at the top of the editing window, you will see a number of options for formatting such as police.  Look to the right and there are two buttons, one is used to insert the code.  Hover over the buttons and you will see a description.  Press the button insert the Code, add your code and you will see something like the following:

        public void drawListRow(ListField list, Graphics g, int index, int y, int w) {
            Bitmap bitmap = Bitmap.getBitmapResource(arrowBitmapName);
            int fontWidth = getFont().getAdvance(text);
            int width = Display.getWidth() ;
            int height = list.getRowHeight();
            g.setColor(Color.BLACK); g.setFont(fontPlain);
            g.drawBitmap(0,0, bitmap.getWidth(), bitmap.getHeight(), bitmap, 0, 0);
            g.drawText(text, 3, y-drptextHeight, 0, w);
        }
    

    I think it's the routine that you use to draw each line of your drop...

    I recommend that move you as much code as you can out of this method.  It's called very often.  Creating a Butmap here, which is an expensive operation, is not a good idea, especially when the Bitmap image in reality does not change.  So create once and use it in the drawListRow.

    Also use the parameters that are passed.  The width you have to paint is given in the parameter, and perhaps not the same as the actual display width.

    In any case, this code draws the Bitmap to (0, 0).  I susspect should be at (0, y).  This could explain why it is not drawn correctly.  You seem to have a similar problem with the text.

    The drawListRow is assigned a value of 'y' and should paint from y to y + listField.getRowHeight ().  But in fact drawListRow has access to the area of the entire painting, so can do too much else.  You must code your method correctly to get good results in your list.

    Hope this helps, if not, please post your code so we can actually read.  In fact, as I say to others, do not post your real code.  Create a simple example that we can run illustrating your problem.  Then everything can run your example and see the problem.  Never stick all your code.  People are put off by the number of lines of code.

  • tag mailto in 4.6.0 Simulator BlackBerry 9000 - specified protocol is not supported by your handheld. Please try another URL

    I have a web page with 2 links mailto. We have a line 'to' address and the subject and the other has an address ' ", emailbody and subject, in it.

    On all simulators - 4.5 to 6.0 t0, it works.  In 4.6.0 Blackberry 9000 Simulator, I can click on the link and open the email once application. But when I come back to the app (web page) and click again on the link or click on the second link - I get the specified protocol is not supported by your handheld. Please try a different URL. »

    is this a known problem in 4.6.0? Or is this a known issue on 4.6.0 Simulator? If it's not any suggestion on how to solve this problem?

    According to me, that it was a problem experienced in the 4.6.0 version.  You see problems with newer versions of the BlackBerry Device Software?  If so, can you post an example of code that triggers it?

  • Problem in the http connection. (simulators 5.0 os blackberry 9000 smartphone)

    Hello friends,

    I am doing my project in Eclipse Platform Version: 3.4.1 4.5 os and I'm using the 8300 Simulator. I use the http connection. When I debug my project, I work correctly. I'm download 8300 same Simulator to test the object. It worked correctly in Simulator 8300.

    but when I try 4.7 and 5.0 for Simulator that I download this Simulator my project does not work correctly the problem of http connection. Someone tell where I'm wrong?

    Thank you

    Ajay.

    also to install BlackBerry JDE 5.0.

  • SE connect Blackberry 10 Simulator and BBM works does not in the Simulator

    Hi all

    I use QNX momentics IDE for development and blackberry 10 Simulator.

    I use the simulator using VMWare workstation. A problem that occurs is that my Simulator is impossible to connect to BBM. Although the Internet is there on Simulator (checked with the browser on Simulator). As far as newspapers are concerned in the case of the blackberry simulators 9900 and 9930 counted out newspapers and event logs.

    But in this Blackberry 10 Simulator, I could not find newspapers where they are generated.

    Please tell me the location where in 10 blackberry Simulator logs are generated.

    Thank you best regards &,.

    Tushar

    for newspapers, check out this link

    http://supportforums.BlackBerry.com/T5/native-development-knowledge/debug-on-the-device-with-console...

    Please mark as solution if it helps

  • How to write a program that allows an HTTPs connection to the APACHE TOMCAT server in blackberry JDE

    Hello.. I am very new to the blackberry JDE environment. But then, I have a project in which I should write a program that will make an HTTPs connection to the apache tomcat server using blackberry JDE. The simulator which I use is 8330-JDE.

    Here is my code...

    import java.io.IOException;

    Import java.io.InputStream;

    Import javax.microedition.io.Connector;

    Import javax.microedition.io.HttpsConnection;

    Import net.rim.device.api.ui.UiApplication;

    Import net.rim.device.api.ui.container.MainScreen;

    public class Httproto extends UiApplication

    {

    public public static void main (String [] args)

    {

    Httproto instance = new Httproto();

    instance.enterEventDispatcher ();

    }

    public Httproto()

    {

    pushScreen (new HttpsConnectionScreen());

    }

    }

    final class HttpsConnectionScreen extends screen

    {

    public HttpsConnectionScreen()

    {

    HttpsConnection c = null;

    InputStream is = null;

    int rc;

    try {String url =

    "https://192.168.2.3: 8443/cit/j_acegi_security_check? j_username = sanogo & j_password = redhat;

    c = (HttpsConnection) Connector.open (url);

    c.setRequestMethod (HttpsConnection.POST);

    System.out.println ("connection is open with the server");

    Get the response code is open the connection,

    Send the request and read HTTP response headers.

    The headers are stored until asked.

    RC = c.getResponseCode ();

    System.out.println ("response from the server" + rc);

    if (rc! = HttpsConnection.HTTP_OK) {

    throw new IOException ("HTTP response code:" + rc);

    }

    is = c.openInputStream ();

    Get the ContentType

    The string of type = c.getType ();

    The length and process data

    int len = (int) c.getLength ();

    if (len > 0) {

    int actual = 0;

    int BytesRead = 0;

    byte data = new byte[len]; while ((bytesread! = len) & (real! = - 1)) {

    real = is.read (data, bytesread, len - bytesread);

    bytesRead += real;

    }

    } else {}

    int ch;

    while ((ch = is.read (())! = - 1). {

    }

    }

    } catch (ClassCastException e) { throw new IllegalArgumentException ("not a HTTP URL");}

    }

    catch (IOException ioe) {}

    finally {

    Try

    {

    if (is! = null)

    is. Close();

    if (c! = null)

    c.Close ();

    }

    catch (IOException ioe) {}

    }

    }

    }

    When I run this program in the Simulator, I can do nothing. Please correct me if I'm wrong in coding.

    As I am new to this blackberry JDE environment, ideas and suggestions on how to write and run the sample applications in the blackberry are more welcomed.

    Concerning

    Hinduja

    Make sure that your MDS starts when the Simulator starts.  In the JDE will in Edition > Preferences > Simulator > General and click the checkbox "launch Mobile Data System connection with Simulator Service.

  • In Blackberry 6.0 HTTP connection

    Hello friends,

    I'm in a stupid problem. I have to create a post http connection, for this I write simple code and its working fine on 4.5 to 5.0 but same code does not work on 6.0 and later.

    To find the solution, I created a lot of samples, but no luck.

    My code example is as follows.

     con = (HttpConnection) Connector.open(url);
                       con.setRequestMethod("POST");
                      con.setRequestProperty("Content-Type",
                                     "application/x-www-form-urlencoded");
                      con.setRequestProperty("User-Agent", "Blackberry");
         try {
                      p_doStrm = con.openDataOutputStream();
                       p_doStrm.writeByte(_header);
                       p_doStrm.writeByte(_device);
                       p_doStrm.writeUTF(_clientId);
                      p_doStrm.writeLong(_sessionId);
                    } catch (IOException ex) {
                         System.out.println("Exception :" + ex.getMessage());
               }
    
      int resCode = con.getResponseCode();// no responce and stream closed exception caught. if i remove this code
     p_iStrm = con.openDataInputStream(); // then same exception caught here
    

    I don't get any solution. Please suggest me, where I'm wrong.

    Thanks in advance.

    Thanks guys,.

    In fact, server expects some headers more than me and I missed them, my problem is now solved.

    Thank you all

  • Question of synchronization to blackBerry Smartphones: there is a problem connecting to BlackBerry App World. Please try again.

    First of all, I have never had this problem before when you try to install the apps from the app world.

    I am trying to download WhatsApp Messenger through App World by clicking Download, and then by clicking on the button 'Sync '. I'm then prompted with the error "synchronization problem: there is a problem connecting to BlackBerry App World." Please try again. ».

    Screenshot: http://goo.gl/RSx8v

    App world tells me on the right side of the page that my machine is connected (which is) via the USB port. I tried the phone turned off, taking the battery for more than a minute to be sure, restart the phone, restart the computer and try again with no luck.

    I also tried several browsers, Chrome and Firefox.

    I found this page which tells me it could be a firewall issue, http://btsc.webapps.blackberry.com/btsc/viewdocument.do?externalId=KB27184&sliceId=1&cmd=displayKC&d...

    I therefore disabled my firewall and still had no success. This gets really annoying, and my blackberry seems to have stupid questions like this forever.

    Anyone got any ideas on a solution possible?

    Thank you.

    I tried in IE and it works. Went back to Firefox and Chrome, and it does not work. But the interesting thing is a friend tried his blackberry on my computer and it works fine in Firefox.

    EDIT: I found the problem, I deleted the App World Plugin from my computer and reinstalled Firefox and it works. Why it does not detect that I use a plugin obsolete?

    Anyway, problem solved.

  • HTTP connectivity from a device problem

    Hello

    I'm working on an application that works with our web server via HTTP and HTTPS.

    As it is a consumer application, we want to operate without MDS, out-of-the-box when a smartphone is purchased at retail with a web access data plan.

    I assumed that this means using direct TCP when a Wi - Fi connection is not available.

    The following code snippet prepares the URL according to the configuration, and opens the connection:

    String fullUrl = (isSecure? ("https://": "http://") + appConfig.getServerHost () + "/" + url + (bbAppState.isWiFiOnly ()? « ; (interface = wifi': "") + (bbAppState.isDeviceSide ()? « ; (deviceside = true': ' ");

    c = (HttpConnection) Connector.open (fullUrl, Connector.READ_WRITE, true);

    Details of equipment and network:

    Feature: 8320
    OS 4.5.0.81
    T-Mobile US network
    Have a data plan (unlimited web and 400 messages)
    Connection preference: Wi - Fi preferred
    No apn is not specified
    Browser and third-party applications downloaded from the App World can access internet via Wi - Fi and EDGE/GPRS with the above parameters

    Tried:

    1. Free Wi - Fi and EDGE: deviceside = true - get "Tunnel failed '.
    2. Free Wi - Fi and EDGE: no deviceside, only the url - get "Tunnel failed '.
    3. No deviceside, only = wifi interface - works with a Wi-Fi connection, reports "The Tunnel failed" when out of range of a Wi - Fi connection.
    4. I tried parameter APN to internet2.voicestream.com just to test - got the same error 'Tunnel failed '.  I would not use it as the browser and other applications need and work when the APN is empty.

    My question is if I'm something wrong or missing something.  My hypothesis is that third-party apps and BlackBerry Internet Service browser.  Is there a way to know?  Is there a way to disable it (for example to make sure that the browser and other applications use it)? Our company has recently become a partner of Alliance of BlackBerry, so we can apply to BlackBerry Internet Service, but I do not understand if this is necessary for consumer applications, or if the consumer applications should rely on direct TCP.

    Any help will be greatly appreciated.

    Thank you

    Sergey

    Use '; deviceside = true ', you must also specify the details of the AFN, the options of the device or in the string you provide with "; deviceside = true '.  If you do not, you will get "Tunnel failed '.

    I would like to confirm the settings for T-Mobile APN - the value that you used does not match what I found in a google search.

    Browser and other applications will use WAP 2.0 or BIS - B, requiring no configuration.  You can use WAP 2.0 - standard article for more details:

    What - in different ways to establish an HTTP connection or socket
    DB-00396
    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

    Recommendation - use BIS-B (service Alliance Partner) If you can, work in cases more than anything else.

  • Problems with HTTP connections in 7.0

    Hi all

    HTTP connections in my work of fine application with 5.0 and 6.0, but they do not work with 7.0.  Enough actually, they work with 7.0 when the device is connected with WiFi, but not with 3G (Sprint) mobile network.  Connections are also running smoothly on the Simulator.  When the application tries to perform an HTTP request, it seems to open the connection, but the connection hangs just until it expires in a minute later.

    I'm unable to debug applications with the SDK 6.0 and 7.0 in Eclipse.  The debug mode is always suspended my environment.

    Can someone speculate as to why this might be the case?  For added convenience, my code is below:

    public class HttpRequest extends Thread {
        private String method; // GET or POST
        private RequestResults screen;
        private String url;
        private Loader loader;
    
        public HttpRequest(String url, String method, RequestResults screen) {
            this.url = url;
            this.method = method;
            this.screen = screen;
        }
    
        private void connection() {
            // The following code will only build under JDE 4.5 and later
            ByteArrayOutputStream out = null;
            HttpConnection conn = null;
            InputStream in = null;
    
            try {
    
                conn = (HttpConnection) Connector.open(url
                        + ConnectionParams.getConnection());
                conn.setRequestMethod(method);
    
                int responseCode = conn.getResponseCode();
    
                // Check for both 200 AND 201
                if (responseCode != 200 && responseCode != 201) {
    
                    loader.stop();
    
                    Notify.inform(Constants.CONNECTION_LOST);
    
                    conn.close();
                    return;
                }
    
                out = new ByteArrayOutputStream();
    
                in = conn.openInputStream();
                byte[] buffer = new byte[20000];
                int bytesRead = 0;
                while ((bytesRead = in.read(buffer)) > 0) {
                    out.write(buffer, 0, bytesRead);
                }
    
                screen.requestSucceeded(new String(out.toByteArray()));
                loader.stop();
    
            } catch (IOException ex) {
                Notify.inform(Constants.CONNECTION_LOST);
                loader.stop();
            } finally {
                if (in != null) {
                    try {
                        in.close();
                    } catch (IOException e) {
                    }
                }
                if (out != null) {
                    try {
                        out.close();
                    } catch (IOException e) {
                    }
                }
                if (conn != null) {
                    try {
                        conn.close();
                    } catch (IOException e) {
                    }
                }
            }
    
        }
    
        public void run() {
    
            if (NetworkCheck.radioCheck() || NetworkCheck.wifiCheck()) {
    
                loader = LoaderStore.orderLoader();
                loader.start();
                connection();
    
            } else {
                Notify.inform(Constants.NETWORK_ERROR);
            }
    
        }
    
    public class ConnectionParams {
    
        /**
         * The getConnection() method will retrieve the available connection, and is
         * prioritized fastest to slowest connections.
         *
         * @return The connection parameters string to be appended to the HTTP
         *         connection
         */
        public static String getConnection() {
            String connectionParameters = "";
    
            if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
                // Connected to a WiFi access point
                connectionParameters = ";ConnectionTimeout=10000;interface=wifi";
            } else {
                int coverageStatus = CoverageInfo.getCoverageStatus();
                ServiceRecord record = getWAP2ServiceRecord();
                if (record != null
                        && (coverageStatus & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT) {
                    // Have network coverage and a WAP 2.0 service book record
                    connectionParameters = ";ConnectionTimeout=10000;deviceside=true;ConnectionUID="
                            + record.getUid();
                } else if ((coverageStatus & CoverageInfo.COVERAGE_MDS) == CoverageInfo.COVERAGE_MDS) {
                    // Have an MDS service book and network coverage
                    connectionParameters = ";ConnectionTimeout=10000;deviceside=false";
                } else if ((coverageStatus & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT) {
                    // Have network coverage but no WAP 2.0 service book record
                    connectionParameters = ";ConnectionTimeout=10000;deviceside=true";
                }
            }
            return connectionParameters;
    
        }
    
        private static ServiceRecord getWAP2ServiceRecord() {
            ServiceBook sb = ServiceBook.getSB();
            ServiceRecord[] records = sb.getRecords();
    
            for (int i = 0; i < records.length; i++) {
                String cid = records[i].getCid().toLowerCase();
                String uid = records[i].getUid().toLowerCase();
                if (cid.indexOf("wptcp") != -1 && uid.indexOf("wifi") == -1
                        && uid.indexOf("mms") == -1) {
                    return records[i];
                }
            }
    
            return null;
        }
    }
    

    The culprit seems to be adding the line

    ConnectionUID = record.getUid ();

    for my URL when you set the connection settings:

    if (record != null && (coverageStatus & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT) {
    // Have network coverage and a WAP 2.0 service book record
        connectionParameters = ";ConnectionTimeout=10000;deviceside=true;ConnectionUID="
        + record.getUid();
    }
    

    Once I have remove this, it works fine...

  • HTTP connection problem. What is going on?

    I am trying to write a simple program to test the validity of the URL via a http connection.

    For the good URL, the program works very well.

    Bad URL however found two ways:

    1: no answer at all (program runs as if nothing happened, waiting for user input.) The text in the EditField is the same incorrect url intentionally being tested)

    2: IllegalArgumentException in RIMConnector.open (int, int, String, boolean, FirewallContext) line: 76.

    What is going on?

    Here is the code:

    import java.io.IOException;
    import javax.microedition.io.Connector;
    import javax.microedition.io.HttpConnection;
    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.ui.UiApplication;
    
    final class UrlCheck extends UiApplication {
        private EditField urlField;
        public static void main(String[] args) {
            UrlCheck theApp = new UrlCheck();
            theApp.enterEventDispatcher();
        }
    
        public UrlCheck() {
            MainScreen theScreen = new MainScreen();
            LabelField title = new LabelField("URL Check");
            theScreen.setTitle(title);
    
            urlField = new EditField("URL: ", "", Integer.MAX_VALUE, BasicEditField.FILTER_DEFAULT);
            theScreen.add(urlField);
    
            FieldChangeListener listenerCancel = new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
                    String URL = urlField.getText();
                    HttpConnection conn = null;
                    int response = 0;
                    try {
                        conn = (HttpConnection)Connector.open(URL);
                        conn.setRequestMethod(HttpConnection.GET);
                        response = conn.getResponseCode();
                        if (response == 200){
                            Dialog.inform("URL OK");
                            return;
                        }
                        if(response == 401){
                            Dialog.inform("URL Requires Authorization");
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                        Dialog.inform("Bad URL");
                    }
                }
            };
            ButtonField checkUrl = new ButtonField("Check");
            checkUrl.setChangeListener(listenerCancel);
            theScreen.add(checkUrl);
            pushScreen(theScreen);
        }
    }
    

    Okay, that was stupid.

    I caught the IllegalArgumentException as well and it fixed the problem.

  • BlackBerry Smartphones Blackberry 9000 "BOLD" PDF setting look at a problem

    I just got a Blackberry 9000 "BOLD" of brand new out of the box of the AT & T store today. When I try to open a PDF from an email on the phone, he said. "This type of attachment cannot be seen on the device.

    I don't need or want a 3rd party program PDF, just basic viewing of PDF...

    What is a cure for this? Surely, the phone doesn't work right.

    Thank you

    Here's my own weird solution that has work for me if someone else has this problem.

    Power off, power.

    I've renamed the PDF file that I have emalied me to something simple like test.pdf > as fine opend.

    Then re-sent me a longer name PDF it was initially & then which seemed to open ok.

    Now I really like my "BOLD" even better.

  • What is the best way to make http connection for my application can access internet on blackberry

    Hi I have crazy small application and create the regular http connection in my code.

    I m able to use internet in defining the apn but internet will not work in my application when I m using other equipment that required donot APN setting and work mobile without parameter APN there internet conection please let me know what setting that i could spend while creating the http connection so that my application work on all devices.

    Kind regards

    Navneet Gupta

    This can help you.

  • Phones smart blackBerry torch 9800 - problem with the Wi - Fi connection

    When I want to connect WIFI - there is no problem.

    but when I turn off the data on a mobile connection - I can not connect via wifi.

    and the question is:

    I still have turn on mobile data, almost when I want to connect via wifi?

    How can I check that I am connected to wifi or 3G?

    where can I find data messure?

    thanx

    Read through this link. It gives tons of information and if all goes well, it will give an answer you're looking for.

  • Problem with JavaBean open HTTP connection failed

    Hi all

    With the help of forms 10g (10.1.2.0.2) I followed the tutorial on Francois Degrelle blog 'a java popup of entry dialog box enter a value' (http://fdegrelle.over-blog.com/ext/http: / / sheikyerbouti.developpez.com/index_en/) on the use of a JavaBean in the forms. When I run the form locally on Windows (XP sp2), it is not working. I get the following stacktrace on the Java console.


    java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.

    at sun.applet.AppletClassLoader.getBytes (unknown Source)

    in sun.applet.AppletClassLoader.access$ 100 (unknown Source)

    to sun.applet.AppletClassLoader$ 1.run (unknown Source)

    at java.security.AccessController.doPrivileged (Native Method)

    at sun.applet.AppletClassLoader.findClass (unknown Source)

    at sun.plugin.security.PluginClassLoader.findClass (unknown Source)

    at java.lang.ClassLoader.loadClass (unknown Source)

    at sun.applet.AppletClassLoader.loadClass (unknown Source)

    at java.lang.ClassLoader.loadClass (unknown Source)

    at java.lang.ClassLoader.loadClassInternal (unknown Source)

    at java.lang.Class.forName0 (Native Method)

    at java.lang.Class.forName (unknown Source)

    at oracle.forms.handler.UICommon.instantiate (unknown Source)

    at oracle.forms.handler.UICommon.onCreate (unknown Source)

    at oracle.forms.handler.JavaContainer.onCreate (unknown Source)

    at oracle.forms.engine.Runform.onCreateHandler (unknown Source)

    at oracle.forms.engine.Runform.processMessage (unknown Source)

    at oracle.forms.engine.Runform.processSet (unknown Source)

    at oracle.forms.engine.Runform.onMessageReal (unknown Source)

    at oracle.forms.engine.Runform.onMessage (unknown Source)

    at oracle.forms.engine.Runform.sendInitialMessage (unknown Source)

    at oracle.forms.engine.Runform.startRunform (unknown Source)

    at oracle.forms.engine.Main.createRunform (unknown Source)

    at oracle.forms.engine.Main.start (unknown Source)

    at sun.applet.AppletPanel.run (unknown Source)

    at java.lang.Thread.run (unknown Source)

    When I compile and run the form on our test on Unix server, it works fine. I tried to disable the Windows Firewall, but I get the same error.

    Any idea?

    Published by: genyv80 on August 5, 2010 15:57

    As I said, if you use the Sun plug-in, you MUST add the name of the jar file to the tag archive .

    François

Maybe you are looking for