http on real device connection works on wifi but for wap/tcp sometimes give 404 response

Hi, im a new developer of blackberry, I have no problem when you use the connection using wifi but when I turned off my wifi and try to connect using 3 g sometimes the data is sent, but sometimes it doesn't... what could possibly mistake in this case?

try {

String _postData =;
                OutputStream os;

                //the preferred network is already arranged here
                int[] preferredTransportTypes = {
                        TransportInfo.TRANSPORT_TCP_WIFI,
                        TransportInfo.TRANSPORT_WAP2,
                        TransportInfo.TRANSPORT_TCP_CELLULAR};
                ConnectionFactory factory = new ConnectionFactory();
                factory.setPreferredTransportTypes(preferredTransportTypes);
                factory.setAttemptsLimit(3);
                        factory.setConnectionTimeout(10000);
                        //factory.setTimeLimit(10000);
                //modify this
       final ConnectionDescriptor connDescriptor = factory.getConnection("http://url here");
                if(connDescriptor==null){
                    UiApplication.getUiApplication().invokeLater(new Runnable()
                    {
                        public void run()
                        {
                            Dialog.alert("Invalid Network. Please check your network set up.");
                        }
                    });
                }else{
                    HttpConnection http = (HttpConnection) connDescriptor.getConnection();
                    //https.setRequestMethod(HttpsConnection.POST);
                    //byte[] postDataBytes = _postData.getBytes();
                    http.setRequestMethod(HttpConnection.POST);
                    http.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.0");
                    http.setRequestProperty("Content-Language", "en-US");
                    http.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
                    //https.setRequestProperty("Content-length", Integer.toString(_postData.length()));
                    byte [] postDataBytes = _postData.getBytes("UTF-8");

                    os = http.openOutputStream();
                    os.write(postDataBytes);
                    os.flush();
                    os.close();
                    int state = http.getResponseCode();
                    final int state2 = state;
                    if(state==HttpConnection.HTTP_OK || state==HttpConnection.HTTP_BAD_GATEWAY){
                        UiApplication.getUiApplication().invokeLater(new Runnable()
                        {
                            public void run()
                            {   

                                //original
                                //Dialog.alert("SOS sent. Our customer care personnel will contact you shortly.");
                                Dialog.alert("SOS sent. This is the response code : " + state2);
                                //Dialog.inform("SOS sent. Our customer care personnel will contact you shortly.");
                            }
                        });
                    } else {
                        UiApplication.getUiApplication().invokeLater(new Runnable()
                        {
                            public void run()
                            {
                                //Dialog.alert("Failed to send SOS .");
                                Dialog.alert("Failed to send SOS. Please try again.This is the response code : " + state2);
                            }
                        });
                    }
                }
            } catch(IOException e) {Dialog.inform(e.getMessage());}

IM using blackberry 9700 with os 6

Solved due to problem of carrier to WAP2

so I put the TransportInfo.TRANSPORT_TCP_CELLULAR to be at the top of WAP and it solved my problem.

but I need to adjust my apn for the tcp connection

Tags: BlackBerry Developers

Similar Questions

  • My pro iPad connects to the WIFI, but loses connectivity to drops in use.  My other IOS devices (iPhone, macbook, etc.) do not have this problem.  Ideas to solve?

    My pro iPad connects to the WIFI, but loses connectivity to drops in use.  My other IOS devices (iPhone, macbook, etc.) do not have this problem.  Ideas to solve?

    Hello BrooklynWM!

    I definitely want my iPad to stay connected to the Wi - Fi connection while I use it.  Thanks for posting that other iOS and OS X devices have no problem with the connectivity dropping.  We can try a few things.

    Would first go through the steps listed in this article: If your iPhone, iPad or iPod touch connects to a Wi-Fi - Apple Support Network

    Then if it does not help, you can check network settings with this: recommended for the WiFi routers and access - points Apple supported

    After trying those, if you still see the drop connectivity, make sure the iPad Pro is updated with iOS 9.3.2 and check to see if the connection when you are in a certain place, time, or one event happening elsewhere in the House.

    Best regards.

  • Get the IP addresses of the devices connected to the WiFi network

    Hello guys,.

    I've been looking around and trying to understand this point, but I don't have a solution. The problem is to get the local IP addresses of all devices connected to the WiFi point of access/router connected to my BlackBerry. Similar to the way in J2SE nature you can get the IP using InetAddress.getLocalAddress () and then browse ip addresses and call InetAddress.getByAddress (ip) to check whether the device is accessible. Possible is something similar in BlackBerry or not?

    No, the fault was entirely mine, I misread your message.
    no idea how to do that, there is no access from low level of the network interface and the API is really limited.

  • HP 15-r005si Notebook PC: unable to connect with my wifi but watch my neighbors wi - fi

    Nice day! I recently bought my HP and it came with 8-1 win, after installation win 10 I can't connect with my wifi but watch my neighbors wi - fi settings! I have re-installed windows 10 several times but no luck! I uninstalled the network adapters and re - install the driver and also restart several times without success. Help, please!

    @ToinetteR

    Hey there! Thanks for the reply.

    It's good to know the update driver wireless solved the problem.

    If you have problems in the future, you can get back to us.

    Have a great day!

  • iPhone connects to the wifi but does not connect to internet

    I have an iPhone running iOS 9.3.2 6s (last updated).

    The phone connects to the wifi network, but even if it's to show the signal strength is good, the phone does not charge any internet content (weather, FaceBook, email, etc.).  If I disconnect WiFi and use the data, it works very well.  We have no problem connecting to the computer or a smart TV network wifi and internet connection.

    This also happens with my daughter 5s iPhone and iPad for my son.

    Sometimes it will work fine on wifi, then a little while later I can't get anything to load. And it can be like right now when I'm at home alone is not as if there's a big load on our wifi.

    We have high-speed internet by cable (25 MB/s download speed) and a router Lynksys EA3500.  Encryption is set to WPA (not WEP).

    I tried to go into my phone settings and reset the network.  Always problems.

    It's really frustrating because you eventually switch to our mobile data and use it instead of our data ' wifi '.  And then to go on our data on our phone plan

    Here's a tip for the user on the problems of Wi - Fi. Suggest from the top and bottom. Maybe one of them will help you.

    (1) perform a forced reboot: hold the Home and Sleep/Wake buttons simultaneously for about 15-20 seconds, until the Apple logo appears. Leave the device to reboot.

    (2) resetting the network settings: settings > general > reset > reset network settings. Join the network again.

    (3) reboot router/Modem: unplug power for 2 minutes and reconnect. Update the Firmware on the router (support Web site of the manufacturer for a new FW check). Also try different bands (2.4 GHz and 5 GHz) and different bandwidths (recommended for 2.4 to 20 MHz bandwidth).

    (4) change of Google DNS: settings > Wi - Fi > click the network, delete all the numbers under DNS and enter 8.8.8.8 or otherwise 8.8.4.4

    (5) disable the prioritization of device on the router if this feature is available. Also turn off all apps to VPN and retest the Wi - Fi.

    (6) determine if other wireless network devices work well (other iOS devices, Mac, PC).

    (7) try the device on another network, i.e., neighbors, the public coffee house, etc.

    (8) backup and restore the device using iTunes (ask for more details if you wish).

    https://support.Apple.com/en-us/HT201252

    (9) go to the Apple Store for the evaluation of the material.

    Council: https://discussions.apple.com/docs/DOC-9892

  • Satellite A60 - connected to the WIFI but can't get on the WEB

    Hello

    I have a really strange problem with my Satellite A60. I have a US robotics wireless router. I can connect with my laptop, in the sense where it says that it acquires an IP address and then he said: it is connected, but then it is not possible to browse the web or access to the router. Let me also point out that:

    -The internet connection works fine if I connect the laptop to the router via a cable (for example, I can access the router)
    -J' have a second computer that is connected via WIFI to router and it sees no problem (it goes up an adapter for US Robotics)
    -WEP encryption is active, but I'm sure that the key is correct. I also try to disable but did not help
    -MAC address filtering is enabled, but the laptop WIFI card is in the list. I also tried to disable content filtering, but it did not help
    -J' also tried to remove the encryption and MAC address filtering, but it did not help
    -In past I could connect to other networks WLAN with my laptop

    I hope that I have provided sufficient detail so that someone can try to help me.
    Thank you in advance!

    Hello!

    I think that the integrated firewall router and dhcp server integrated are the first things to check. May be there are separate configuration for Ethernet and WIFI connections options. Check if your wireless connection is "default gateway" address when the computer shows that it is connected to WIFI. If no default gateway address is then most likely it's dhcp or confiuration problem your router firewall.

  • Connected to home WiFi but not Wireless LAN home page

    This morning, everything was fine but something happened with the printer and now my laptop is all out of whack. I used to be connected to my home network where I could access all computers on the network and my hard drive Western Digital World Book Edition II. I don't know how, but now I'm out of the network. I'm always connected to the WiFi which is available in the House but I can ' t do anything else. I can't watch other computers, print or watch the WD hard drive. I tried everything to get me back on the network, but not luck.

    I am using the following:
    -IBM ThinkPad X 41 Tablet running Windows XP
    -Linksys Wireless-N Broadband Router (model number - WRT300N v1.1)
    -Canon PIXMA MX870
    -Western Digital myBook World Edition II (2 TB)

    I did steps 1 to 6, but he says still unknown

    Sorry if I wasn't clear.

    1-6 steps enable NetBIOS over TCP/IP, which is a good thing to do.  These measures do not affect the type of node.  As explained in the link nitecruzr, there is a good reason to make this explicit parameter instead of the default Windows.

    Reset the 'unknown' to 'Broadcast' node type can be performed by following the steps in KB903267 - but it is I think remember that sometimes the steps described in this article do not work and the type of node is still 'unknown '.  What I meant is that it is OK for the type of node be 'unknown '.

  • Made on emulator ripple 9860 and real device 9860 user interface is different for blackberry OS 7.0

    Hi all

    I have developed a hybrid application that works fine on Android for almost all the resolutioh which I have supported.

    For blackberry, I am building and pacakging an application using the ant tool. During the installation of file .cod devive 9860 having OS 7.0, landing page UI get distorted. Running on the ripple 9860 device, UI reneders correctly.

    Please clarify that ripple is to check the user interface on differnet devive resolution or just for the pacaging and building application.

    Thanks in advance

    Usually the user interface between ripple and a device will be, although there may be small differences. Remember that the unit is running the BlackBerry WebKit application on an ARM architecture, while the ripple uses the implementation of WebKit in Chrome on an architexture that corresponds to your operating system. While the bot Webkit implementations, there may be differences in the way they make; all the more up-to-date the implementation on OS 7.0, your implementation of desktop browser is likely.

    That being said, there is not usually very big differences; specifically, you mentioned the word distorted. Could you provide a comparison of the screenshot of what you're talking about?

    In most cases, ripple should provide solid representation, but is always recommended to test on a simulator/device.

  • Vista connects to my router, but for local access only.

    I am running windows home edition vista 32 bit on my laptop and until today I had no problems with my internet connection.  I've updated my norton 360 today and had no problems until I rebooted a few hours later.  I can connect to my router but it gives me local access only.  My Linux Ubuntu 10.4 and Mac OS X system is running to the same router with no problems.

    What can I do to connect my Vista laptop to internet?

    So I got on my windows to try what you say and guess what. -_ - (indifferent face) my vista decided to take my wireless and give me access to the internet after most of the month.  I don't know what happened.  I didn't have anything new in the last three days... It's fixed now, but I still don't know what it does break.  Any ideas as what caused it?

  • Windows Mobile Device Center works very well, but then all of a sudden will not get connected mobile, it remains disconnected even if the PC sounds when the phone is attached to the USB.

    Windows Mobile Device Center installed. If I reboot computer everything works fine and he

    might work for 1 hour or 1 day, I can connect and disconnect the phone and it appears every time,.

    but then sudeenly it stops working.

    When I attach the USB of the computer phone rings (because it connects), but then nothing happens

    in Windows Mobile Device Center, the phone remains disconnected in Windows Mobile Device

    Center. It's really enoying!

    Any suggestions on how to debug/fix?

    Work around: someone knows how to restart the Windows Mobile Device Center without rebooting

    computer?

    I already tried to reinstall Windows Mobile Device Center, did not help. Both CD

    comes with the phone and software downloaded from Microsoft.

    I'm really stuck!

    Help, please!

    / Marcus

    It's a Samsung Omnia II GT-I8000

  • HttpConnection works on WiFi but not 3G

    Hello

    I have strange question. I have an application that connects to a remote server. Here's the use case:

    Case user #1:

    1. Install the app
    2. Make sure the WiFi is enabled
    3. Start the application
    4. Press on submit-online works!

    Case user #2:

    1. Install the app
    2. Make sure the 3G connection is activated
    3. Start the application
    4. Press on submit-online works!

    Case user #3:

    1. Install the app
    2. Make sure the WiFi is enabled
    3. Start the application
    4. Submit-online works!
    5. Close the application
    6. Turn off the 3 G WiFi connection and Insure is WE
    7. Start the application => fails!

    The application hangs on the Red statement below and then get a time-out error.

    ...

    ConnectionFactory connFactory = new ConnectionFactory();

    Conn = connFactory.getConnection (serverURL);

    ...

    Does anyone have any idea why this might happen? I have found no reasonable explanation for it except to be a bug.

    Finally, after long hours of debugging and testing. I discovered that the issue is network related and have nothing to do with the device. I ended up using the following connection string. I hope this helps anyone facing a similar issue and record long hours of debugging.

    /**
    * Gets the connection string needed for HTTP connections.
    * @return the connection string.
    */
    public static String getConnectionString() {}
        
    read the type of coverage
    Boolean isSimulator = DeviceInfo.isSimulator ();
    Boolean isWifi = WLANInfo.getWLANState () is WLANInfo.WLAN_STATE_CONNECTED;
    Boolean isMDS = CoverageInfo.isCoverageSufficient (CoverageInfo.COVERAGE_MDS);
    Also Boolean = CoverageInfo.isCoverageSufficient (CoverageInfo.COVERAGE_BIS_B);
    Boolean isDirect = CoverageInfo.isCoverageSufficient (CoverageInfo.COVERAGE_DIRECT);
    Boolean noCoverage = CoverageInfo.getCoverageStatus () is CoverageInfo.COVERAGE_NONE;
        
    get the connection string
    Dim connectionString As String ="";
    If {(isSimulator)
    connectionString = '; deviceside = false;
    } Else if (isWifi) {}
    connectionString ="; interface = wifi. "
    } ElseIf (also) {}
    connectionString = '; deviceside = false; "REMOVED # #";
    } Else if (isMDS) {}
    connectionString = '; deviceside = false;
    } ElseIf (isDirect) {}
    String carrierUid = getCarrierBIBSUid ();
    if(carrierUid == null) {}
    connectionString = '; deviceside = true;
    } else {}
    connectionString = '; deviceside = false; ConnectionUID = "+ carrierUid +"; ConnectionType = mds_public; replace the underscore with -
    }
    } Else if (noCoverage) {}
    connectionString = "";
    } else {}
    connectionString = '; deviceside = true;
    }
        
    Returns the connection string
    return connectionString;
    }

    Thank you for your stone for assistance. You have given some useful tips.

  • IPad connects to the wifi but not internet

    I have a new iPad. It connects without problems to my wifi network at home, but when I try to connect to a network in a coffee shop, it shows that it is connected ok, gets an address IP etc, but when I try to use Safari I get a message that it is not connected to the Internet. This has happened in two branches of McDonald's when I tried to use their network. Once a portal connection captive flashed for a moment, but disappeared before I could connect.

    I tried to forget the network and reconnect, a restart of two buttons, reset the network settings, tried to use Google DNS, but none of them have worked for me. My iPhone works without problem on the same network

    Any suggestions on what I can try?

    Vinnie

    Try using another browser. In my experience, sometimes Safari have problems viewing a page ' agree to our conditions "on the hot spots. I have Atomic but there are others out there. Once you connect, Safari will not let you access the conditions page, use the other browser, which should, so you can use whatever one you want to continue browsing.

  • MSN premium does not, but internet works. MSN gives me a can not connect to internet message, but for example work

    It was working fine, then stopped after connection. Downloaded with a fix auto's Mr. fixit, not worked, ran virus found nothing controls.

    Support MSN:
    http://support.Microsoft.com/kb/940784

  • HP 20 Pavilion all-in-one: 4500 DESIRE CONNECTS to THE WIFI, BUT will not be PRINTED

    Hello

    I have problems printing from my PC.

    I'm connected wireless and the PC can see the printer and recognizes that it is ready.

    I'll then to print the document, including the States of PC is printing and printed, but nothing happens, no document is printed.

    I have two portable mac I can print from without any problem at all, but not my HP PC family.

    Help, please

    Thank you

    Running the diagnostics to http://www.hp.com/go/tools can help solve the problem.

  • ENVY 4500 connects to the wifi, but the PC can't detect the printer.

    Hey guys,.

    So I have a problem. I just bought the 4500 envy at my local Walmart yesterday, 11 October 2014. It prints the test as well as printing of our mobile pages and tables. Whenever I try to install it on my PC, I get up to the screen "searching for printer" and it does not detect the printer. He says always "cannot find the printer." Is the reason because printing is in the features and I'm on the first floor? My House is literally right on top of it. I've already printed on the "Network Configuration" Page so I know that I have the IP address and the 'network name (SSID)' correct.

    Hi Average_Asian, thanks for getting back to me!

    I suggest to uninstall the printer software if there is any software installed.

    After uninstalling, I recommend you select Wireless on the front panel of the printer.  In the wireless menu, select restore default settings from the network.  Once the default values are restored, turn off the computer and the printer.  Once they are turned off, unplug the power to the router wireless for 60 seconds and plug it back.  Once the wireless radio, turn on the printer and run the wizard to Setup wireless on the front panel.

    Once the printer is reconnected, I suggest you put your system in clean boot mode in the configuration of Microsoft.  You can do this by following this document: How to perform a clean boot in Windows.

    Once the computer is in clean boot mode, I would suggest to reinstall the HP printer install wizard for Windows.

    Please let me know how it goes!

Maybe you are looking for