Getting an active connection on a Blackberry -



Getting an active connection on a Blackberry -

i connection parameters http phone call using code follows below.

it works on test phones , emulators. people (possibly 9700 users, can't guarantee it) causes "failed transmit" errors when have otherwise working 3g/wifi connection.

what doing wrong?

private string getconnectionparameters() { string strcp = null; int coveragestatus = coverageinfo.getcoveragestatus(); if((coveragestatus & coverageinfo.coverage_direct) == coverageinfo.coverage_direct) { // carrier coverage string carrieruid = getcarrierbibsuid(); if(carrieruid == null) { string wap2 = getwap2servicerecord(); if (wap2 != null) { // seek using wap2 strcp = ";deviceside=false;connectionuid="+wap2; } else { // has carrier coverage, not bibs or wap2. utilize carrier's tcp network strcp = ";deviceside=true"; } } else { // otherwise, utilize uid build valid carrier bibs request strcp = ";deviceside=false;connectionuid="+carrieruid + ";connectiontype=mds-public"; } } else if((coveragestatus & coverageinfo.coverage_mds) == coverageinfo.coverage_mds) { // mds coverage found strcp = ";deviceside=false"; } else if((wlaninfo.getwlanstate() == wlaninfo.wlan_state_connected) && radioinfo.arewafssupported(radioinfo.waf_wlan)) { // device connected via wifi strcp = ";interface=wifi"; } else if(coveragestatus == coverageinfo.coverage_none) { // there no available connection strcp = ""; } else { // no other options found, assuming device strcp = ";deviceside=true"; } homecoming strcp; } private string getcarrierbibsuid() { servicerecord[] records = servicebook.getsb().getrecords(); for(int = 0; < records.length; i++) { if(records[i].getcid().tolowercase().equals("ippp")) { if(records[i].getname().tolowercase().indexof("bibs") >= 0) { homecoming records[i].getuid(); } } } homecoming null; } private string getwap2servicerecord() { servicebook sb = servicebook.getsb(); servicerecord[] records = sb.getrecords(); (int = 0; < 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)) { homecoming records[i].getuid(); } } homecoming null; }

i had same issue connection class before found versatile monkey connection code

my problem bis connections, need loop , seek each connection. not sure if it's carrier thing, or cdma vs gsm thing.

blackberry

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -