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.

Tags: BlackBerry Developers

Similar Questions

  • Toshiba 40XV733 - external connection from DVD player problem

    Hello

    I can't watch DVDs on my REGZA 40XV733 when connected via HDMI to S0ny VX450 of RDR.

    I guess it has something to do with HDCP and HDMI version.
    I heard that in some cases, only 1.4 cable will work.
    Or buy the 2.0?

    Thanks in advance.

    What happens when you connect the player to the TV? No picture at all? Have you checked with another cable first? Both devices must support playback of DVD via HDMI. Therefore, please provide more information on the problem.

  • Need Clarification - Http connection/GPRS

    Hi all

    working on 4.7 for the storm. I've been singled out / feeling of pity / tired of me.  because I get is not the way how to establish an http connection to a device.

    I crossed the stone sticky wire, gone through the posts in this forum about this http connection. With a wi - fi connection it works fine. coming to GPRS, it does not work.

    I know that this is not the right place to post this, but I want to learn things of expereince of my counterpart.

    This is my story...

    (1) I have a storm with vodafone carrier. (India)

    (2) I have activated the GPRS connection for this SIM card, I received the appropriate Vodafone data plan and I am able to open browse the google, gmail, yahoo and all the other stuff except my app.

    (3) I added '; deviceside = true' to my URL.

    (4) I called my customer service to get the APN settings, apn = blackberry.net, username = <> , password = <> are. and I put those in the unit.

    (4) the strange thing, I learned to know, when I called to vodafone customer care for blackberry services, they said, plan vodadfone of data is not used for third-party applications. and we need get the BIS data for this plan.

    is this true?

    all the help/advice/suggestions are welcome.

    Thanks for your interest!

    He works with another carrier... I changed with another carrier to airtel and works very well.

    I called cust care voda and they said, voda does not support their GPRS services for blackberry, and it is essential to get the plan of BIS.

  • iTunes could not connect to the iPhone "iPhone", because an invalid response was received from the device.

    So I am a new iphone 7. I had a 6 before that. Everything was fine until the day where I got the 7, I decided to try a manual on itunes for my 6 backup so that I could put this on the new phone. I use now icloud backup but before that he always did on my computer. Its itunes version 12.2.2.25 as it is the most recent, that I can run with 10.7.5 which is the newest my mac pro can work without hacking it. Again, never had a problem before it save and use it to transfer music. Anyway, I received the message "iTunes could not connect to the iPhone"iPhone"because an invalid response was received from the device." I tried 3 different usb cords. I tried both ports to the front of the computer and all 3 in the back. Abandoned and did a backup icloud. Installed on the new phone. Everything transferred except my music library which is real download of my CD via itunes. If something was wrong on the iphone 6, surely the new phone that starts with a clean slate will be very well... wrong.  Same message. Leaves through ports, cables, etc. Is it just a simple matter of ios 10 now works with my version of itunes?

    A new phone will be iOS10.  iOS10 requires iTunes 12.5.1 find which demands in turn 10.9.5 OSX or newer.  Software update checks only the updates to the current version of the system that you are running but that itself can be updated.  It may or may not be possible to upgrade your computer to the system requirements. Find your computer on the web site of http://www.everymac.com model and near the bottom of the specification of the system section, he will tell what versions of the operating system, it is able to run. If you can not run a newer system, you will not be able to sync this phone to your current computer. OSX 10.9 and 10.10 are no longer available. You can try to install the free El Capitan OSX 10.11.  El Capitan can run slower on older machines and require the additional purchase of RAM (4 GB is a minimum realistic and many recommend 8 GB).  Making a big jump in versions of system is also more likely to affect the old software.

    At el capitan Snow Leopard, it will make my macbook is slow?  - https://discussions.apple.com/thread/7412959

    Course OSX Upgrade General information, including configuration required - http://www.apple.com/osx/how-to-upgrade/

  • iTunes could not connect to the iPhone, because an invalid response was received from the device.

    Just bought an iPhone 7 today and received the error message "iTunes could not connect to the iPhone because an invalid response was received from the device." Don't know what that means, and I have never had this problem with one of my previous iPhones. Thank you.

    You run iTunes 7.5.1? iOS10 requires iTunes 12.5.1 find which demands in turn 10.9.5 OSX or newer.  Software update checks only the updates to the current version of the system that you are running but that itself can be updated.  It may or may not be possible to upgrade your computer to the system requirements. Find your computer on the web site of http://www.everymac.com model and near the bottom of the specification of the system section, he will tell what versions of the operating system, it is able to run. If you can not run a newer system, you will not be able to sync this phone to your current computer. You can try to install the free El Capitan OSX 10.11.  El Capitan can run slower on older machines and require the additional purchase of RAM (4 GB is a minimum realistic and many recommend 8 GB).  Making a big jump in versions of system is also more likely to affect the old software.

    At el capitan Snow Leopard, it will make my macbook is slow?  - https://discussions.apple.com/thread/7412959

    Course OSX Upgrade General information, including configuration required - http://www.apple.com/osx/how-to-upgrade/

    If you have any generation of PPC software which works under OSX 10.6 it is not supported in later versions of the system.

  • How can I get internet connection from my laptop through my mobile device (it's just a rhetorical question)

    Hi,)

    "This is only to have knowledge of some aspects on the internet).

    I have samsung mini S4 mobile with internet connection.

    Suppose I'm somewhere whitout your support and I want to internt with my laptop through my mobile.

    What steps I have to do so that the internet connection via my cell phone.

    Thank you

    Johan

    Hello Johan,.

    Thanks for posting your question on the forum of the Microsoft community.

    I would like to know some information about the problem so that we can help you better.

    What is the brand and model of your laptop?

    I suggest you try the following steps and check if it helps.

    a. connect your mobile device to the computer. If you use a USB (Universal Serial Bus) modem, simply plug it into a USB port on the computer. If you connect a mobile phone, connect the USB cable to your computer at one end and on the cell phone on the other.

    b. software start Internet sharing. If you use a cell phone, search for Internet sharing application from the 'Start' or 'Applications folder' menu on your phone. If you connect a USB modem, run the software supplied with the modem to start the connection.

    c. start the connection sharing. On the mobile phone, make sure that the Internet sharing application is set to share the mobile connection via USB. Once set, press the soft key 'Connect' on your cell phone or smart phone to share the connection with a computer. If you use a USB modem, click the 'Connect' button in the software of connection on your computer Desktop Manager of.

    d. check that the connection is active. After the Internet software to share bed 'Connected', open the network and sharing in Control Panel"and check that the connection is as a wired Internet connection. The control panel is located on the "Start" menu on your computer.

    e. connect to Internet. Launch a web browser or e-mail on your computer and check that the connection is active. Download and send to your connection speed will vary depending on force carrier and cell phone signal.

    f. put an end to the Internet via mobile by pressing the function key "Disconnect" on your mobile phone, or if you use a USB modem, click on the button "Logout" in the connection management software installed on the computer.

    Please also see this link:
    http://www.Samsung.com/us/support/SupportOwnersFAQPopup.do?faq_id=FAQ00024090&fm_seq=24258

    I hope this information helps.

    Please let us know if you need more help.

    Thank you

  • IPhone will not connect to iTunes - "invalid response received from the device."

    After years of work very well, I went to put some new music on my phone and all of a sudden got this message "iTunes could not connect to the iPhone 'IPhone of David Platts' because an invalid response was received from the device."?

    I've tried different USB ports, different cables (some Apple official, some after market) and several reboots, but nothing works.

    I'm 10.7.5 OSX and IOS 10 phone you.

    Thanks for the help.

    You have a problem.

    It is good that you have told us you're OS x 10.7.5 (current is MacOS 10.12), because it is your problem.

    iOS 10 requires iTunes 12.5.1 or later to communicate.  iTunes 12.5.1 requres OS X 10.9.5 or later version.

    It's (time to upgrade the operating system of your Mac spent).

    macOS - official Apple Support

  • Cannot connect iPhone 7 more to iTunes because an invalid response from the device

    I tried to sync my phone to iTunes and I get an error message stating "invalid response from the device. I tried to remove the password, and it still doesn't work. I also tried using a new USB cord. I'm doing something wrong? I can't sync my music or ringtones. Will there be an update to iOS 10 soon to solve this problem? I am extremely disappointed that I can not connect my new phone!

    You use iTunes version 12.5?

    Get the latest version of iTunes - Apple Support

  • -What it means and how to fix it? iTunes could not connect to the iPhone from the iPhone Simon Young, because an invalid response was received from the device.

    iTunes could not connect to the iPhone "IPhone by Simon Young", because an invalid response was received from the device.

    You have upgraded to iTunes 12.5.1? iOS10 requires iTunes 12.5.1 find which demands in turn 10.9.5 OSX or newer.  Software update checks only the updates to the current version of the system that you are running but that itself can be updated.  It may or may not be possible to upgrade your computer to the system requirements. Find your computer on the web site of http://www.everymac.com model and near the bottom of the specification of the system section, he will tell what versions of the operating system, it is able to run. You can try to install the free El Capitan OSX 10.11.  El Capitan can run slower on older machines and require the additional purchase of RAM (4 GB is a minimum realistic and many recommend 8 GB).  Making a big jump in versions of system is also more likely to affect the old software.

    At el capitan Snow Leopard, it will make my macbook is slow?  - https://discussions.apple.com/thread/7412959

    Course OSX Upgrade General information, including configuration required - http://www.apple.com/osx/how-to-upgrade/

    If you have any generation of PPC software which works under OSX 10.6 it is not supported in later versions of the system.

  • transfer file zune to another computer and not all my will to change of songs they deleted from my device when I connect it?

    I had installed Zune on my laptop and need to install it on my PC. I did it but the Zune displays now 1300 songs in my collection, but I have 2500 on my Zune 80 g. If I connect my camera to the PC it will remove songs from my device or we'll add them to my collection?

    I suggest that repost you this on Zune forums:

    http://answers.Microsoft.com/en-us/Zune

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

  • is itunes error message cannot connect to my iphone because of an invalid response was received from the device

    get error message that IOS 10 unable to connect to my iphone iTunes 6 because of an invalid response was received from the device

    Make sure you are using iTunes 12.5.1 or later, as it is required to communicate to iOS 10.

    If iTunes does not recognize your iPhone, iPad or iPod - Apple Support

  • I pressed "do not open pictures for this device" for when my iPhone connected. Now, I can't seem to find a way to import photos from that device because my phone is not displayed. Can anyone help?

    I pressed "do not open pictures for this device" for when my iPhone connected. Now, I can't seem to find a way to import photos from that device because my phone is not displayed. I now want to import photos from my iPhone, but nothing works. Can someone, please?

    MacBook Air, OS X El Capitan (10.11.1)

    Honestly, this entire thread is a repost of this , I pressed "do not open pictures for this device" for when my iPhone connected. Now, I can't seem to find a way to import photos from that device because my phone is not displayed. Can anyone help?

    Still no answer...

    Have you tried the following:

    • Launch Photos manually once you connect your iPhone to the Mac.
    • Enter the ⌥⌘S tomato (command-option-S) key combination the sidebar visible.
    • Click on the camera in the sidebar when it appears.

    Your iPhone shows in iTunes or in the Image Capture?

    If iPhone doesn't appear at all, make sure it is properly loaded and unlocked, disconnecting, take a new photo, then reconnect it.

    • Start iTunes and confirm that you agree with the mac, the prompt on the iPhone.
    • Try a different USB port.
    • Try to force reboot the iPhone.
  • 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.

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

Maybe you are looking for