Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
suresh_chakree
Posts: 20
Registered: ‎08-19-2008
My Device: Not Specified

HTTP Connection without APN

Hi,

 

I have developed a Blackberry Client Application (which should be independent of BES and BIS), which connects to various web sites and displays/renders the data from that site on the BrowserField.

 

This works fine with Simulator. But, with physical device I faced "Java.io.IOException:could not open tunnel - failed".

After goping through various threads on this topic in this form, I had given the TLS and APN details on the physical device and it starts working.

 

So from what I see from above, for a client application to access internet through HTTP, you need to provide APN settings of the Internet gateway provided by the service provider.

This mean the Blackberry device has to be GPRS enabled, which would cost the device user for using my application.

 

My question is:

Applications like GoogleMaps and Facebook on Blackberry use internet but,

- They don't require any APN settings

- They don't require Blackberry to be GPRS enabled

 

Is there a way I can get my application use internet using HTTP and without using APN settings and GPRS enabling. Please note that this should work both on BES and BIS.

 

I understand that GoogleMaps and Facebook are by RIM and so might have access to internal api's.

Can I get access to these internal RIM api's?

If this requires commercial agreement with RIM, please suggest a path to get in touch with RIM for this requirement.

 

Any help would be highly appreciated.

 

Thanks in Advance,

Suresh.
Please use plain text.
New Developer
srem
Posts: 7
Registered: ‎10-02-2008
My Device: Not Specified

Re: HTTP Connection without APN

Suresh,

 

How are you connecting to these websites?

 

 

Please use plain text.
Developer
nmaddix
Posts: 111
Registered: ‎12-16-2008
My Device: Not Specified

Re: HTTP Connection without APN

I believe the other option for this is to use WAP. I had the same problem recently and came accross this thread:

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=8743

Please use plain text.
Developer
Developer
bo
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified

Re: HTTP Connection without APN

nmaddix, thanks for the link, very helpful.

 

So do you think if the user hasn't specified the APN the Facebook app looks at the service book to see what it needs to append to the URL to make WAP2 work?

 

 

Please use plain text.
Developer
nmaddix
Posts: 111
Registered: ‎12-16-2008
My Device: Not Specified

Re: HTTP Connection without APN

That's my guess based on all the threads I've read about this. I've looked everywhere for solutions and this seems to be the way to do it. The code in that posting worked well for me also, so I think it's a safe bet.

 

Would be nice to hear an expert give their $0.02 on the matter..........

 

Please use plain text.
Developer
babygodzilla
Posts: 275
Registered: ‎03-10-2009
My Device: Not Specified

Re: HTTP Connection without APN

hi all,

 

sorry to dig up an old thread. i am having this issue as well. i tried the code in that other thread this one

but i dont think it works. if i take out my APN settings then my app cannot connect. I am using a simple 

Connect.open() implementation to open an SSL connection. the URL i am trying to open is then

 

ssl://myserver:smileytongue:ort;ConnectorUID= ... (value from the function below)

 

 

    private static String getWap2TransportUid()
    {
        // Get the service book records for WAP2 transport.
        ServiceRecord[] records = ServiceBook.getSB().findRecordsByCid("WPTCP");
        for (int i = 0; i < records.length; i++)
        {
            // Determine if the current one is suitable.
            ServiceRecord record = records[i];
            if (record.isValid() && !record.isDisabled())
            {
                String recordName = record.getName().toUpperCase();
                if (recordName.indexOf("WIFI") < 0 && recordName.indexOf("WI-FI") < 0)
                { 
                    // Looks good so fire it back. 
                    return record.getUid();
                }
            }
        }
        
        // No WAP2 transport found.
        return null;
    }

 

any ideaS?

 

Please use plain text.
Developer
Ted_Hopp
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: HTTP Connection without APN

There are six ways for a device to open an HTTP or socket connection to the web:

  1. TCP Wi-Fi
  2. WAP 2.0
  3. BIS (only available to Alliance members)
  4. MDS
  5. direct TCP (aka TCP cellular)
  6. WAP 1.0/1.1

If you specify no connection parameters on the url, then if the device is on a GPRS/CDMA network, you are requesting a corporate MDS connection if available, or a direct TCP connection if not; on an iDEN network, you are requesting a direct TCP connection. A direct TCP connection requires that the network's APN settings be set correctly on the device or appended as connection parameters to the url.

 

RIM recommends that connections be made in the above priority order for consumer (non-corporate) apps. (For corporate apps, the recommended priority is: MDS; Wi-Fi; WAP 2.0; BIS; direct TCP; WAP 1.0/1.1.)

 

See the video Networking Transports II for lots of good information about all this, including how to set up connection parameters for all methods.




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Please use plain text.
Developer
babygodzilla
Posts: 275
Registered: ‎03-10-2009
My Device: Not Specified

Re: HTTP Connection without APN

Absolutely priceless material!!! Thank you very much!!

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: HTTP Connection without APN

You will find that  the networking videos, along with some other extremely useful RIM supplied materials, are referenced in the Required Reading section of this Thread.

 

http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-c...

Please use plain text.