BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-11-2008, 07:08 AM   #1
Tigmeister
Knows Where the Search Button Is
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: vodafone
Posts: 37
Default Auto set APN by networks/carriers

Please Login to Remove!

Hi,

I have come across an interesting problem, which I am sure other people have already considered, and hopefully you may answer some of my questions:

Overview
---------

I have an application which connects to a java server, to process login requests and other similar communication attempts. I have had to set up the APN on my device to ensure that I can use my connection correctly.

Now the problems arise when trying to deploy the application to the market. There are many different networks/carriers, with their own APN settings. These settings can be found easily enough, at present there is a mammoth task for the support desk to help each of the customers to set up their APN settings according to their network/carrier.

It would seem logical to automate this process. After spending all morning trawling through the forums, I have encountered only one suggested solution to this issue.

It has been suggested by richard.puckett that you can use the RadioInfo.getCurrentNetworkName() to get the network provider, and then create a simple config file to map the carrier's name/ID to the string to be appended to a URL.

Questions:
----------
1) I'm curious how to map the getCurrentNetworkName() with a list of network APN details? Does anyone know of a list of possible returned strings for the networks? How about a list of APN's which map to this list of network strings?

2) Looking at Google maps decompiled source, it appears evident that they determine the network value using the ServiceBook and ServiceRecord classes and use their BlackberryHttpConnectionFactory class to handle mapping the network to the required APN. Does this require that the application is a blackberry signed application?

Any help on these issue would be much appreciated, as I have a distinct lack of clarity on how to solve this issue exaclty.

Kind Regards,

Tig*

Last edited by Tigmeister; 02-11-2008 at 08:58 AM..
Offline  
Old 02-11-2008, 11:06 AM   #2
richard.puckett
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Join Date: Oct 2007
Location: Seattle, WA
Model: 9020
PIN: N/A
Carrier: T-Mobile
Posts: 212
Default

You decompiled Google Maps too, eh? I was interested to see exactly how they were doing the "My Location" bit but I'll check out the Service Book stuff now, as well.

The way I do the APN settings is with an XML file (I'm one of those people who actually likes XML). It's pretty simple; just something like

Code:
<networks>
   <network id="12345678" name="T-Mobile" country="US">
      <wap-settings>WapGatewayIP=216.155.165.5;WapGatewayAPN=wap.voicestream.com;WapGatewayPort=9201</wap-settings>
   </network>
</networks>
I'll first try to get the network ID and match against that. If the config file doesn't include the network ID that was found on the device then I'll try a fallback to the carrier name plus country code. The carrier name is determined empiracly, I run a test app on different carriers to create a list of carrier names, such as "T-Mobile" and "Cingular". Same with carrier ID.

And then obviously, I append the "wap-settings" value to the end of all my URLs (after adding a semi-colon). You can get those values from a number of sites out there.

I've always had the suspicion that this isn't entirely necessary; perhaps Goog's way is better.
Offline  
Old 02-11-2008, 12:49 PM   #3
Tigmeister
Knows Where the Search Button Is
 
Join Date: Oct 2007
Model: 8700
PIN: N/A
Carrier: vodafone
Posts: 37
Default Carrier Names and ID's

Thanks Richard,

Thats been really useful, and I think I have a clear understanding of how I'm going to implement this.

One last thing, I'm guessing as you live in the states, you've created a list of carrier ID's and Names for the US. I was wondering if its not too much to ask, would you mind sending them to me, as I've not currently got a way to test US networks as I am in the UK. (If you have a more comprehensive list than just the US, I would gratefully accept those too).

Kind Regards,

Tig*
Offline  
Old 04-29-2008, 11:25 PM   #4
whistlerxj
New Member
 
Join Date: Jun 2006
Model: 8310
Carrier: rogers & bell
Posts: 9
Default

Carrier internet Settings (Apn Gateway, etc) - Pinstack.com - where Blackberry Professionals Connect!
Offline  
Old 06-09-2008, 06:48 PM   #5
andrewarrow
New Member
 
Join Date: Jun 2008
Model: 8330
PIN: N/A
Carrier: Verizon
Posts: 3
Default open source

is there an open source version of this connection code maintained by the community? Seems silly for each of us to write this code ourselves over and over. I just want to worry about my app's logic and make an HTTP connection and not worry about the carrier or the WAP parameters.
Offline  
Old 06-11-2008, 08:49 AM   #6
roryf
New Member
 
Join Date: May 2008
Model: 8130
PIN: N/A
Carrier: T-Mobile
Posts: 9
Default

After some research into this I found ways of using the existing Service Book records, where available.

First search for an "IPPP" record (findRecordsByCid), check its valid, not disabled and the encryption type isn't equal to ServiceRecord.ENCRYPT_RIM (if it is then user has MDS and probably doesn't need APN settings), then append this to the URL:
;deviceside=false;ConnectionType=mds-public

Failing that, search for a "WPTCP" record with the string "WAP2" in its name (usually the full name is "WAP2 Transport"), then using ServiceRecord.getUid(), append this to the URL:
;deviceside=true;ConnectionUID=<UID>

Failing that as well you're left to appending APN settings. Of course the user may have Service Book entries but not the network/data plan to go with them, in which case I'm guessing the above will just fail.

One thing I'm confused about with appending gateway settings is when should we be appending APN settings as opposed to WAP settings? Theres an article in the KB that specifies these properties:
;apn=apn.tld;tunnelauthusername=user;tunnelauthpas s=pass
Offline  
Old 06-11-2008, 10:50 AM   #7
andrewarrow
New Member
 
Join Date: Jun 2008
Model: 8330
PIN: N/A
Carrier: Verizon
Posts: 3
Default wow

thanks rory, that's unbelievable we have to jump thru these hoops.

I've been using

DeviceAnywhere - The Source For User Experience Management For The Mobile Industry

to test various phones on various carriers. You never know for sure until you try it on a real phone. Makes having to sign the COD file and get 3 emails from RIM each time so much fun.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


ZURN WILKINS 1-720A  1

ZURN WILKINS 1-720A 1" SPRINKLER SYSTEM PRESSURE VACUUM BREAKER ASSEMBLY VALVE

$79.75



3 CFM 1/4HP Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit US picture

3 CFM 1/4HP Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit US

$37.99



FEBCO 3/4

FEBCO 3/4" 765-QT PVB WATTS Pressure Vacuum Breaker Backflow Preventer Valve

$89.99



4.5 CFM Single-Stage Rotary Vacuum Pump HVAC/Auto AC 4.5CFM 1/3HP 1/4

4.5 CFM Single-Stage Rotary Vacuum Pump HVAC/Auto AC 4.5CFM 1/3HP 1/4"ACME inlet

$29.33



Single-Stage Vacuum Pump Lithium Battery DC 2.5CFM Vacuum Pump Air Conditioner picture

Single-Stage Vacuum Pump Lithium Battery DC 2.5CFM Vacuum Pump Air Conditioner

$127.30



Oilless Diaphragm Vacuum Pump Industrial Oil Free Piston Vacuum Pump 550W picture

Oilless Diaphragm Vacuum Pump Industrial Oil Free Piston Vacuum Pump 550W

$106.40







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.