BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-11-2011, 05:17 PM   #1
rakeshpagilla
New Member
 
Join Date: Feb 2011
Model: 9000
PIN: N/A
Carrier: att
Posts: 3
Default Urgent Urgent _ Help Needed

Please Login to Remove!

Our black berry app works with the att 3g network in USA. Client in Europe, Japan and china, are trying to test the app using their 3G network. They are able to run the app using wifi. But not with 3G.



Now the case here is , in USA, we have load the BB app on BB-storm as well as BB-9000. and it works fine.

Clients in other countries are testing on BB-9700.I am not able to see any data coming into our servers when they use 3G network.



So can any one please lead us in the right direction? Why app doesn’t work with carriers in japan or china but works in USA?





Thanks in advance.
Offline  
Old 02-11-2011, 06:47 PM   #2
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default Re: Urgent Urgent _ Help Needed

Do your clients have Blackberry data plans? If not, do they have the APN values set correctly for their location?
__________________
My other Blackberry is a PlayBook.
Offline  
Old 02-11-2011, 07:13 PM   #3
rakeshpagilla
New Member
 
Join Date: Feb 2011
Model: 9000
PIN: N/A
Carrier: att
Posts: 3
Default Re: Urgent Urgent _ Help Needed

Sir,

Our clients do have the data plans of DOCMO(JAPAN) UNICOM(CHINA). They have their 3G n/w

here is the code i have written

private HttpResponse sendXmlOverHttp(String url, String xmlRequest, boolean loginRequest)
throws Exception {
HttpConnection httpConnection = null;
OutputStream os = null;
InputStream is = null;
System.out.println("REQ: " + xmlRequest);
try {
url = url + getConnectionString();
httpConnection = (HttpConnection) Connector.open(url);

if(loginRequest) {
cookie = null;
} else {
httpConnection.setRequestProperty(COOKIE, cookie);
}
httpConnection.setRequestMethod(HttpConnection.POS T);
os = httpConnection.openOutputStream();
os.write(xmlRequest.getBytes());
os.flush();

int responseCode = httpConnection.getResponseCode();

is = httpConnection.openInputStream();

// Get the length and process the data
int len = (int) httpConnection.getLength();
System.out.println("Length of response: " + len);
String xmlResult = null;
if (len > 0) {
int actual = 0;
int bytesread = 0;
byte[] data = new byte[len];
while ((bytesread != len) && (actual != -1)) {
actual = is.read(data, bytesread, len - bytesread);
bytesread += actual;
}
xmlResult = new String(data);
}
HttpResponse httpResponse = new HttpResponse(responseCode,
xmlResult);
System.out.println("RES: " + httpResponse.getResponse());
if(loginRequest) {
cookie = httpConnection.getHeaderField(SET_COOKIE);
System.out.println(SET_COOKIE + cookie);
}
return httpResponse;
} catch (ClassCastException e) {
throw new IllegalArgumentException("Not an HTTP URL");
} catch (IOException e) {
throw new RuntimeException("Exception while reading/writing data");
} finally {
if (is != null)
is.close();
if (os != null)
os.close();
if (httpConnection != null)
httpConnection.close();
}
}

/**
* Determines what connection type to use and returns the necessary string to use it.
* @return A string with the connection info
*/
private static String getConnectionString()
{



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

connectionString = ";deviceside=true";

}

// Wifi is the preferred transmission method
else if(WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED)
{
System.out.println("Device is connected via Wifi.");
connectionString = ";interface=wifi";;
}

// Is the carrier network the only way to connect?
else if((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT)
{
System.out.println("Carrier coverage.");

String carrierUid = getCarrierBIBSUid();
if(carrierUid == null)
{
// Has carrier coverage, but not BIBS. So use the carrier's TCP network
System.out.println("No Uid");
connectionString = ";deviceside=true";
}
else
{
// otherwise, use the Uid to construct a valid carrier BIBS request
System.out.println("uid is: " + carrierUid);
connectionString = ";deviceside=false;connectionUID="+carrierUid + ";ConnectionType=mds-public";

}
}

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

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

// In theory, all bases are covered so this shouldn't be reachable.
else
{
System.out.println("no other options found, assuming device.");
connectionString = ";deviceside=true";
}

return connectionString;
}

/**
* 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;
}
Offline  
Old 02-11-2011, 08:16 PM   #4
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default Re: Urgent Urgent _ Help Needed

I see that you are appending "deviceside=true" without the carrier-specific APN values. This won't work on most networks.

I don't know that this is what is tripping you up, but it looks suspect to me.
Offline  
Old 02-12-2011, 08:43 AM   #5
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default Re: Urgent Urgent _ Help Needed

Well, kudos to Dougsg38p for trying, and he may be right. It looks to me like you are throwing every possable connection method specification at the problem, but it is difficult to follow the logic of such a large chunk of code that is not formatted. Perhaps you could read this sticky post and try again.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 02-14-2011, 01:56 PM   #6
rakeshpagilla
New Member
 
Join Date: Feb 2011
Model: 9000
PIN: N/A
Carrier: att
Posts: 3
Default Re: Urgent Urgent _ Help Needed

xxx91;codexxx93
private HttpResponse sendXmlOverHttp(String url, String xmlRequest, boolean loginRequest)
throws Exception {
HttpConnection httpConnection = null;
OutputStream os = null;
InputStream is = null;
System.out.println("REQ: " + xmlRequest);
try {
url = url + getConnectionString();
httpConnection = (HttpConnection) Connector.open(url);

if(loginRequest) {
cookie = null;
} else {
httpConnection.setRequestProperty(COOKIE, cookie);
}
httpConnection.setRequestMethod(HttpConnection.POS T);
os = httpConnection.openOutputStream();
os.write(xmlRequest.getBytes());
os.flush();

int responseCode = httpConnection.getResponseCode();

is = httpConnection.openInputStream();

// Get the length and process the data
int len = (int) httpConnection.getLength();
System.out.println("Length of response: " + len);
String xmlResult = null;
if (len > 0) {
int actual = 0;
int bytesread = 0;
byte[] data = new byte[len];
while ((bytesread != len) && (actual != -1)) {
actual = is.read(data, bytesread, len - bytesread);
bytesread += actual;
}
xmlResult = new String(data);
}
HttpResponse httpResponse = new HttpResponse(responseCode,
xmlResult);
System.out.println("RES: " + httpResponse.getResponse());
if(loginRequest) {
cookie = httpConnection.getHeaderField(SET_COOKIE);
System.out.println(SET_COOKIE + cookie);
}
return httpResponse;
} catch (ClassCastException e) {
throw new IllegalArgumentException("Not an HTTP URL");
} catch (IOException e) {
throw new RuntimeException("Exception while reading/writing data");
} finally {
if (is != null)
is.close();
if (os != null)
os.close();
if (httpConnection != null)
httpConnection.close();
}
}

/**
* Determines what connection type to use and returns the necessary string to use it.
* @return A string with the connection info
*/
private static String getConnectionString()
{



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

connectionString = ";deviceside=true";

}

// Wifi is the preferred transmission method
else if(WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED)
{
System.out.println("Device is connected via Wifi.");
connectionString = ";interface=wifi";;
}

// Is the carrier network the only way to connect?
else if((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT)
{
System.out.println("Carrier coverage.");

String carrierUid = getCarrierBIBSUid();
if(carrierUid == null)
{
// Has carrier coverage, but not BIBS. So use the carrier's TCP network
System.out.println("No Uid");
connectionString = ";deviceside=true";
}
else
{
// otherwise, use the Uid to construct a valid carrier BIBS request
System.out.println("uid is: " + carrierUid);
connectionString = ";deviceside=false;connectionUID="+carrierUid + ";ConnectionType=mds-public";

}
}

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

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

// In theory, all bases are covered so this shouldn't be reachable.
else
{
System.out.println("no other options found, assuming device.");
connectionString = ";deviceside=true";
}

return connectionString;
}

/**
* 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;
}
xxx91;/codexxx93;

Last edited by rakeshpagilla; 02-14-2011 at 01:59 PM..
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

Similar Threads for: Urgent Urgent _ Help Needed
Thread Thread Starter Forum Replies Last Post
urgent help that makes me crazy losthtaz BlackBerry Help 7 01-27-2011 04:20 PM
Help needed on downloading a .cod EmmanuelH BlackBerry Network 0 01-25-2011 05:37 AM
Help needed PLEASE!(Q's about apps, how to download apps and the pearl flip phone) Luna_tic BlackBerry Help 1 01-15-2011 01:27 PM
Data plan. Help needed hanspee BlackBerry Help 3 01-11-2011 09:55 PM
Need Urgent Help on Bleck berry Curve 8520 Binoop General 8500 Series Discussion - Gemini 2 01-02-2011 03:06 AM


OEM iPhone 11 PRO X/XR XS MAX 8/7 PLUS Fast Charging USB Cable 10 Feet & 6 Feet  picture

OEM iPhone 11 PRO X/XR XS MAX 8/7 PLUS Fast Charging USB Cable 10 Feet & 6 Feet

$2.99



3M/10 feet Long Apple iPhone 13 12 11 Pro XS MAX XR X 8 Fast Charging Data Cable picture

3M/10 feet Long Apple iPhone 13 12 11 Pro XS MAX XR X 8 Fast Charging Data Cable

$3.50



New Apple White Charger Cradle Docking Station Base Stand A1381 OEM picture

New Apple White Charger Cradle Docking Station Base Stand A1381 OEM

$8.50



10 Foot/3M iPhone 12/11 PRO MAX X/10 XR XS 8/7 FAST Charging USB LONG Cable cord picture

10 Foot/3M iPhone 12/11 PRO MAX X/10 XR XS 8/7 FAST Charging USB LONG Cable cord

$4.98



Lot of OEM APPLE iPAD LCD And White Front Glass Replacement 6091l-1402C picture

Lot of OEM APPLE iPAD LCD And White Front Glass Replacement 6091l-1402C

$17.99



Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013 picture

Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013

$40.90







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