BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 04-21-2009, 10:23 PM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Model: 9000
PIN: N/A
Carrier: T-mobile
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Network selection programetically

Please Login to Remove!

Hi all,
I am also trying to get the APN info through my application code.
I want to get the list of APN's present in the device and their corresponding username and password.
Hardcoding the APN info while making http connection is not a good idea as the carrier may change the

information at some point of time.
Please suggest me regarding this:
I have followed two ways but this does not seem to be good

1.
String url = connectionStr;
String network = RadioInfo.getCurrentNetworkName();

if(network != null){
network = network.toLowerCase();
if(network.startsWith("airtel")){
url = url + ";deviceside=true;apn=airtelgprs.com;";
return url;
}else {
return url ;
}

-----------------------------
2.
ServiceBook sb = ServiceBook.getSB();
ServiceRecord[] records = sb.findRecordsByCid("WPTCP");
String uid = null;

for(int i=0; i < records.length; i++)
{
//Search through all service records to find the
//valid non-Wi-Fi and non-MMS
//WAP 2.0 Gateway Service Record.
if(records[i].isValid() && !records[i].isDisabled())
{
if(records[i].getUid() != null && records[i].getUid().length() != 0)
{
if((records[i].getUid.toLowerCase().indexOf("wptcp") != -1) &&
(records[i].getUid().toLowerCase().indexOf("wifi") == -1) &&
(records[i].getUid().toLowerCase().indexOf("mms") == -1))
{
uid = records[i].getUid();
return;
}
}
}
}

if (uid != null)
{
//Using WAP2
//";ConnectionUID=" + uid;
return;
} else {
//Using APN (Direct TCP)
//";deviceside=true";
return;
}.

I dont really know whether we can get the APN username and password using the second code snipet.

Please suggest me regarding this.
thanks
Offline  
Old 04-22-2009, 06:21 AM   #2 (permalink)
Spam Reporter
 
dc/dc's Avatar
 
Join Date: Oct 2005
Location: IAD
Model: 6230
Carrier: Voicestream
Posts: 14,524
Post Thanks: 214
Thanked 341 Times in 307 Posts
Default

You need to check the Developers' section.

Thanks.
__________________
I h8 txtspk.
Offline  
Closed Thread


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Polycom SoundPoint IP550 and IP335 VoIP phones no adapters
$40.0
Polycom SoundPoint IP550  and IP335 VoIP phones no adapters  pictureCisco Polycom 7936 VoIP Conference IP Phone System with power and 1 Mic
$28.99
Cisco Polycom 7936 VoIP Conference IP Phone System with power and 1 Mic pictureL0T OF 3 Cisco 9971 CP-9971-C-K9 Color Video VOIP Phone W/ EXP MODULE CP-CKEM-C
$199.99
L0T OF 3 Cisco 9971 CP-9971-C-K9  Color Video VOIP Phone W/ EXP MODULE CP-CKEM-C pictureShoretel IP 210 SEV VOIP Phone IP210 Shorephone Black NEW
$45.0
Shoretel IP 210 SEV VOIP Phone IP210 Shorephone Black NEW picturePolycom SoundPoint IP 550 SIP VoIP 4-line Digital Phone Ip550
$14.99
Polycom SoundPoint IP 550 SIP VoIP 4-line Digital Phone Ip550 picture






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