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
Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Browser going to a blank page

I am developing an App where one can search for apps and download other apps.I pass the download url which i get from server to the browser to download.My client is a saudi client.With indian sim and wifi,the downloading is happing fine,but with saudi sim the first time i pass the download link to the browser,it goes to a blank page,than if i press escape key and hit the download link again,its downloading fine.Can anyone guide me.

Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Browser going to a blank page

Did you update the APN settings when you changed the SIM?

 

E.

Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: Browser going to a blank page

yes i updated the apn settings too

Trusted Contributor
Posts: 141
Registered: ‎02-15-2012
My Device: 9800
My Carrier: Airtel

Re: Browser going to a blank page

For this, I think you are using some connection string like ";deviceside=false" or anything else. You have to change these connection strings according to available connections.

 

Do one thing, use the following method to get the connection string according to available connection.

 

Call this method as simply:

 

String URL = <your URL> + getConnectionString();

 

 


Method: 


/**
* Determines what connection type to use and returns the necessary string
* to use it.
*
* @return A string with the connection info
*/
public static String getConnectionString() {
/**
* This method returns connection string depends on available Internet
* connection(Wi-Fi, MDS etc.)
*/
String connectionString = null;

// Simulator behavior is controlled by the USE_MDS_IN_SIMULATOR
// variable.
if (DeviceInfo.isSimulator()) {

connectionString = ";deviceside=false";
}

// Wi-fi is the preferred transmission method
else if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED) {
connectionString = ";interface=wifi";
}

// Checking whether the carrier network is the only way to connect
else if ((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT) {

String carrierUid = getCarrierBIBSUid();
if (carrierUid == null) {
// Has carrier coverage, but not BIBS. So use the carrier's TCP
// network
connectionString = ";deviceside=true";
}
}

// Check for an MDS connection instead (BlackBerry Enterprise Server)
else if ((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_MDS) == CoverageInfo.COVERAGE_MDS) {
connectionString = ";deviceside=false";
}

// If there is no connection available abort to avoid bugging the user
// Unnecessarily.
else if (CoverageInfo.getCoverageStatus() == CoverageInfo.COVERAGE_NONE) {
System.out.println("There is no available connection.");
}

// According to theory, all connection types are covered so this
// shouldn't be reachable.
else {
connectionString = ";deviceside=true";
}

return connectionString;
}

 

 

 

Another method which is using in above method:

 

/**
* Looks through the phone's service book for a carrier provided BIBS
* network
*
* @return The uid used to connect to that network.
*/
private static String getCarrierBIBSUid() {
ServiceRecord[] records = ServiceBook.getSB().getRecords();
int currentRecord;

for (currentRecord = 0; currentRecord < records.length; currentRecord++) {
if (records[currentRecord].getCid().toLowerCase().equals("ippp")) {
if (records[currentRecord].getName().toLowerCase()
.indexOf("bibs") >= 0) {
return records[currentRecord].getUid();
}
}
}
return null;
}


 

 

Highlighted
Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: Browser going to a blank page

I am doing all the above mentioned ways you stated.I am now able to figure it out,if i go to browser options,than change the Default Encoding Text to "ISO8859_3" it solves my problem.But when i dont want to do it manually.Is there any way to set the browser encoding programatically