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...

Tags: BlackBerry Developers

Similar Questions

  • problem with Internet connection sharing, error: connection ad - hoc has "no internet access" on the cell phone of the customer

    Original title: problem with Internet connection sharing

    my laptop running on Windows Vista Home Premium SP2 (this one has access to the internet by using the dial-up modem and will to act as a sharer of internet connection or as a host) and the client computer runs on Windows 7 Starter

    in a first step, I try internet connection sharing, I've set up an ad hoc network and I just changed my setting modem dial-up on the sharing tab, of course what I change, it of 'Allow an other network users to connect through this computer internet connection' and choose the on Home Networking connection wireless network connection , then my mobile client to connect to a special that I created and portable client connected to the internet via ICS
    then the problem came when I restart my laptop. When I tried to use ICS once again, my customer laptop really takes a long time to connect, he continues saying 'identification' side host and client. and after that "identify" is complete, it says ad - hoc connection, I create has "no network".
    so, I'm a person answer in this forum
    ' Obtain an IP address automatically is the wrong setting on the Ethernet connection. "  To return to the sharing tab and unshare the wireless connection.  Close all windows network, and then open them and re - share the wireless connection.  Who must configure IPv4 for the Ethernet connection properties for:

    IP address: 192.168.0.1
    Subnet mask: 255.255.255.0
    Default gateway: no
    "DNS server: none.

    I put this on my laptop of the host, and and I put the IP address on my laptop customer in 192.168.0.2 with the same default gateway as my portable computer host IP
    and made some progress in this case, when I try to connect host and the client is no longer to 'identify' phase, immediately connected laptop both but my mobile client can not connect to the internet and displays "No Internet access" on the ad hoc network, I have create

    I tried a lot of things but always completed my mobile client can not connect to the internet and displays the message "no Internet access.

    What makes me confuse is first, I try to share the internet connection everything works like a charm, I set up an ad hoc network, and then change the setting on my modem dial-up so he can share the internet connection, and voila, computer laptop client connected to the internet. I change even not all IP settings
    But why after I restart my PC, this problem comes...
    someone knows how to help me with this problem?

    Hey, Mimbs,

    You can try the similar thread to the next with a possible solution:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-networking/no-Internet-access-in-the-client-machine-when/77312e09-4385-41FA-A420-0c42be58e4e3

    Also for reference:

    http://Windows.Microsoft.com/en-us/Windows7/networking-home-computers-running-different-versions-of-Windows

  • Sierra Siri, «I have some problems with the connection...» »

    Guys,

    I just installed Sierra on my MacBook Pro (retina, 13 inches, early 2015) version 10.12. I can't get Siri at work, the app tracks, he hears what I'm saying, but after awhile, he returns with two messages, both on the screen and verbally "I have some problems with the internet connection. Please try again in a moment. "&"Sorry, I'm having problems with the connection. Please try again in a moment. »

    Any ideas?

    Thank you

    N

    It's a network problem.

    Check the proxy settings that blocks maybe, or a firewall.

    System Preferences > network > Advanced (for your current connection) > Proxies

    Something there?

  • Siri does not (problems with the connection)

    Hello

    I installed macOS Sierra yesterday. Everything seems to work fine, except Siri. With Siri I always get an error message "I am having some problems with the connection. Please try again in a moment. ». But this seems to appear every time. The network connection works fine, I can't access the Internet without problem.

    No idea how solve the problem?

    I use an iMac (27 inch, mid-2011). Internal microphone is connected, I also see the 'waves' change while I am speaking.

    Concerning

    Thomas

    Hey, thochstrasser. Thank you for using communities of Apple Support.

    It seems that Siri is reluctant to make his debut on your iMac after upgrade to Mac OS Sierra. I want to make sure that you get the benefit of this new feature on a Mac.

    1 try safe mode if your Mac does not start -even if your iMac to market, safe mode makes sure it starts successfully.

    2. How to test a question in an another user account on your Mac - since this is most likely a software problem, test to another user will indicate if it is right to your user account or throughout your system.

    3. use Time Machine to back up or restore your Mac - if it seems to be systemic, the next step should not cause problems. But it is always better "to have" a backup to the "need".

    4. on OS X Recovery - the issue as part of the operating system, reinstall should do.

    Have a great weekend!

  • Siri having problems with the connection.

    Hello

    I have an iPhone 6 Plus, 64 GB with IOS version 9.3.3 (G 13, 34) and the carrier is Vodafone.

    I have problems with Siri, feel when I asked her a task (research or appeal), after a few seconds of waiting, the answer is always "sorry, I have a problem with the connection. Please try again in a moment. »

    I have the right connection with Internet with WIFI and 4G data stream.

    I did reset network settinjg, but I don't see any improvement.

    Please indicate what I can do and if it's a common problem with the iphone 6.

    Thank you!

    CC

    After the reset of the iPhone ("home" button and close button for 10 seconds, with the iPhone connected to the computer), Siri works!

    I am concern I have to do this reset every 2-3 weeks if I need services of Siri...

    Good luck to all of you who have the same problems with their iPhone of hares!

    CC

  • problem with WiFi connectivity with new Ipad Pro.  Unable to connect to the wifi at home.  My other devices (mini mac, iphone, iPad 2) all work fine on my wifi at home.  I am able to connect Ipad Pro wifi work.

    Problem with WiFi connectivity with new Ipad Pro.  Unable to connect to the wifi at home.  My other devices (mini mac, iphone, iPad 2) all work fine on my wifi at home.  I am able to connect Ipad Pro wifi work.

    On the Pro iPad, tap settings > general > reset > reset network settings

    You will need to re enter your Wi - Fi password.

    Then try to connect to your Wi - Fi network.

    If this does not help, more available in this support article suggestions > If your iPhone, iPad or iPod touch connects to a Wi-Fi network

  • Is a message "cannot find server" a problem with Internet connectivity or something else?

    Original title: Net question?

    When I get a message "cannot find server", is this a problem with internet connectivity or something else?  MSN and explore will be not open.  Thank you.

    Hi Aziz,.

    The Cable Guy came and installed a new modem and the new thicker cable.  So far so good.  Thanks for your reply.

  • Satellite C600/C660D - problems with WLAN connectivity

    Hi guys

    I recently bought a Toshiba Satellite C660/C660D laptop to replace my old. I set up a wireless connection at home too. According to my laptop and wireless connection that I am connected but when I go to use internet and try to search for something it won't let me. I ran the troubleshooting and Diagnostics over and over again and the message I get is "your computer seems to be correctly configured but the device or resource is unresponsive."

    It is not a problem with the internet connection that I tried to plug in on my old Toshiba laptop and it works perfectly well and my sister tried it also on his Sony laptop and no connection problems.

    Is there a setting that needs to be adjusted?
    I would be very grateful for any assistance with this and as I don't know what else to do. its starting to get a bit frustrating now

    Thank you

    It's very strange.
    Have you noticed the same thing using different browsers?
    You can use any other application like Skype or MSN?

    What you can try is to update WLAN driver.

    Please visit Toshiba s WLAN portal and install the latest driver for your WLAN card - http://aps2.toshiba-tro.de/wlan/

  • Problem with wireless connection with Satellite U500

    Hello
    Three months ago, I bought a Toshiba laptop Satellite U-500 (Windows Vista). I have a problem with the wireless connection - sometimes, it does not work and I have to restart pressing F8 and repair, then the connection is re-established; If I put into hibernation the connection is intact, but after a stop the problem maybe redo surface after the 2nd or 3rd session.

    I tried to format it, but it worked only for a while. The 2nd item in network adapters in the device (Realtek RTL8192E Wireless LAN 802.11n PCI-E NIC) Manager shows a yellow exclamation point. The message is this:
    "This device does not work properly because Windows cannot load the drivers required for this device. (Code 31)
    Click on 'Search for solutions' to send data about this device to Microsoft and to see if there is a solution available. »

    Could you please help. I have sky broadband and am currently connected via the ethernet cable.

    Thank you
    Fauzan

    For 32-bit Vista go here [http://uk.computers.toshiba-europe.com/innovation/vista_drivers.jsp?macId=&LNG=1&mode=allMachines&us erOS = & action = search & SelCategorie = 2 & selFamily = 2 & salts Eries = 198 & selProduct = 855 & selShortMod = 1 & selOS = 26 & selType = all & country = 8 & language = 13 & searc h =] and download and then run the wireless LAN driver. That should clear the «!» If it isn't you can also find the vista driver at [http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=9&PFid=9&Level=6& Conn = 5 & DownTypeID = 3 & GetDown = false & downloads = true #R TL8192E]

  • I have a problem with the connection to the Internet after the installation of an antiviirus.

    Original title: need help. ?  Have roadrunner and I can't open any browsers or Google continues to try to connect with Steve

    I downloaded Total Defense Security Suite, and then my google wouldn't work? Cannot open any browser

    Hello

    You are facing problems with browsers to open after the download Total Defense Security Suite.

    -What exactly happens when you try to open?

    -You receive an error message?

    -What operating system is installed on your computer?

    -Have you tried to disable the Defense Security Suite Total and verified?

    If not, I suggest to turn off the Antivirus and check if ithelps.

    Disable the anti-virus software
    http://Windows.Microsoft.com/en-us/Windows7/disable-antivirus-software
    Note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    Hope this information helps.

  • problems with wireless connection.i have hp Pavilion dv6700

    I have a hp pavillion laptop with windows vista home premium dv6707. the wireless program is antheros. my router is netgear wnr1000. I don't have internet connection when the ethernet cable is PLUGGED. When I try to connect without cable. I turn on the wireless button. This one is blue (on) and orange (off). nothings so bad at this. made wireless signal discover my internet at home and connect to the router, but here's the problem, IT WONT CONNECT FROM THE ROUTER to the INTERNET. the network and sharing card see the computer that connects with a green line to the network not identified. BUT THEN A RED (X) IN THE NETWORK IN THE WORLD OF THE INTERNET. I click on the (x) to solve the problem, but it is not always correct it. tried to reset the router, address. even tried to disconnect the computer power and the router for 30 minutes. SO WHAT'S THE PROBLEM IN MY COMPUTER? all my drivers/programs/and windows are updated...

    I KNOW THAT THE WIRELESS WORKS WELL BECAUSE WE HAVE AN ANOTHER HP LAPTOP THAT HAS NO PROBLEM CONNECTING TO THE SAME ROUTER.

    Hello:

    I recommend that you check your version of the driver for your Atheros wireless network adapter.

    This is the latest version of HP: 9.20 (March 4, 2011)

    http://h20000.www2.HP.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=12454&prodSeriesId=472276&swItem=ob-91782-1&mode=4&IDX=1

    If all goes well, that will solve connection problems, that you face.

    Paul

  • Problem with internet connection Wi - Fi Windows XP - very 'slow' packages

    Hi people, this problem has been driving me crazy for weeks, so I wonder if someone can provide a solution! Sorry for the long post, but I tried to put in as much information as possible.

    In short, I decided to rebuild an old laptop in Windows XP (2006) I (latest updates installed). I'm without audio (cannot find drivers), but this isn't so much a problem. The problem needs to connect to the WiFi.

    The internal WiFi card is an Intel (r) PRO/Wireless 2200BG (or, at least, it's the driver).

    WiFi is displayed as 'Connected' and ' Signal strength: Excellent "(as my laptop is sitting right next to the hub). Ethernet (wired) connection to the hub works perfectly. I have WiFi BT working connects perfectly with my Mac and my iPod, I know that there is absolutely no problem with the router.

    However, my laptop does not seem to want to connect WiFi, despite 'positive' messages above. All browsers (IE, Chrome, Firefox) display a message stating that they cannot connect to the internet. Nothing in browsers suggest that all DNS settings have been changed.

    I * think * the problem might be because the packets sent/received are still very low - if either enter three digits, I have a lot of luck. For now, they are stuck on envoys = 14, received = 3.

    So, what I have checked/tried is the following (all based on Google search) - none have worked:

    (1) I can confirm that the automatic Wireless Configuration is enabled, started and set to automatic, and that Windows is used to set up my network.
    (2) my wireless network appears in my favorite networks and is automatically connected to (or should be :-)) - I have added/removed the connection several times, check the wireless key, every time, without success.)
    (3) the TCP/IP menu is configured to obtain an IP address and a DNS service automatically.
    (4) type ipconfig/all at the command prompt seems to show that everything works OK:

    • The physical address is: 00-16-xx-xx-xx-xx (I removed the last few digits as it is an open forum, but is probably not a security issue)
    • DHCP is enabled.
    • Automatic configuration is enabled.
    • The IP address is 192.xxx.x.xx (as above)
    • Subnet mask is 255.255.255.0
    • Default gateway, DHCP and DNS server are all the 192.xxx.x.xxx (as above)

    However, IP routing is NOT enabled or is Proxy WINS. Node type appears as unknown.

    I tried the DNS, IP address in the command line (don't remember the command), hot flashes reset everything I can think of or have found via an internet search.

    I also tried the two separate Wireless USB key (only install the drivers - now deleted), which is not working.

    I am so right in thinking that everything seems OK, except the transfer of packages very low? Anyone who has any other control I can try - or better yet, a potential solution?

    Thank you!

    Hello c0ley,

    Have you tried to change the wireless channel that your router is running at? There may be interference that could prevent the internet connection:
    Take a look at step 6 in this article that give more details about it:
    If you need assistance to change the settings of the specific router, you will need to contact your router manufacturer or your internet service provider.
  • Problem with Internet connection - connect only after you turn off allowing then again.

    It is a recent problem that unfortunately I have very little information on. In other words, after months be happy and connection to the internet when you start the computer has decided he won't d more, instead he wants to deactivate and then activate the connection to the local network before it will connect.

    There is no error message and the convenience store could not find that something wrong then directed me here! I tried to diagnose too but didn't know what was wrong either. There are two computers connected through a router and the other is fine, ISP technical support assures me it's nothing to do with them either.

    It left me speechless. I tried the system restore, I crossed the two diagnoses available in internet options and I called ISP support. Although this isn't a direct threatening problem, it's one of those little niggles you want just leave.

    If anyone has any ideas on how to fix things, I'd be grateful.

    * Acer Revo running Win 7.

    Hi tmaxwell83,

    1. did you of recent changes on the computer?

    2. do you have security software installed on the computer?

    3. What is the type of internet connection you use?

    This would happen if the NIC driver is corrupt or needs to be updated.

    I suggest that you install the updated drivers for the network adapter on the computer by visiting the network card or the computer manufacturer Web site, the check if it works fine.

    Updated a hardware driver that is not working properly

    http://Windows.Microsoft.com/en-us/Windows-Vista/update-a-driver-for-hardware-that-isn ' t-work correctly

    Network adapter problems

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-network-adapter-problems

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • EM326g problem with USB connection


    I can't comment on the other cables out there - pinout may be different or the quality of the pins and connection might be questionable...

    several customers have reported problems with generic cables; so I recommend the Motorola Data cable part number is SKN6371C.  It's available under the Accessories heading Motorola.com, I have attached the link below...

    http://www.Motorola.com/consumers/us-en/consumer-product-and-services/mobile+phone+accessories/data-...

  • I keep having problems with my server DNS does not. Computer Blu - Ray player and wireless both have problems with the connection.

    I have problems with the server DNS does not.  I have been using my wireless on my computer and watching netflix on my Blu - ray player at the same time.  The Blu - Ray player froze and wouldn't connect.  At first, I thought that the network has not been configured correctly, but it worked not five minutes before.  I tried many things and I realized it was that my DNS server does not.  Does anyone have any suggestions?

    original title: DNS server does not

    Hi Dwright,

    1. have you made changes on the computer recently?
    2. not the problem only occurs when you watch netflix on Blu - Ray player?

    Method 1
    I suggest you try the steps from the following link to fix the server DNS does not problem.
    a. click on start and then Control Panel.
    b. go to the networking and sharing Center and then click on change adapter settings.
    c. right-click on connection to the Local network and select Properties.
    d. Select Internet Protocol Version 6, and then click Properties.
    e. Select obtain DNS server automatically an address and press Ok.
    f. Select obtain IP address automatically.
    g. Repeat steps for Internet Protocol version 4 as well.

    Method 2
    Try resetting Winsock2 from the following link:

    How to determine and to recover from Winsock2 corruption in Windows Server 2003, Windows XP and Windows Vista (applies to Windows 7)
    http://support.Microsoft.com/kb/811259

    Method 3
    Reset TCP\IP.
    How to reset the Internet Protocol (TCP/IP) (applies to Windows 7)
    http://support.Microsoft.com/kb/299357

    Additional information:
    Windows wireless and wired network connection problems
    http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-Windows

Maybe you are looking for

  • Album

    I had downloaded an album a few months ago. I knew this album was not in my music more then when I tired to redownload it says iTunes: it was purchased, but it will not be displayed in my purchased music, and he won't let me not re-download the album

  • "show my location" in Google Maps does not not, Firefox 27

    the location of the access to the Info Page is always 'ask '.

  • Error during deploy Homeless using veristand 2010 API

    Hello I developed a few screws to connect and download "in4" and it worked fine with VS 2009. Now I am migrating to VS 2010 and I got error-307658 when I try to connect for the second time. If I cancel the deployment by using the Project Explorer, I

  • 802. 1 x wireless - apply user AND computer authentication

    I use ACS v5.6 and I would like to confirm that it is not possible to apply the two authentication user and machine against AD prior access Wireless Windows 7 clients, using the PEAP/MSCHAPv2 Protocol and the built-in supplicant 802. 1 x. The only so

  • Made blackBerry Smartphones that look authentic?

    Hello world I bought a new Blackberry Bold 9780 andis, works very well. But I noticed the label of information I have on this device is totally different from the one I have on BlackBerry Bold 9700. The 9700 looks more authentic with small fonts and