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
Contributor
ArulRaja
Posts: 18
Registered: ‎04-10-2013
My Device: 9900
My Carrier: xxxx
Accepted Solution

BIS Not Working

I am developing a blackberry app . While connecting WIFI the app work fine. when I activate BIS plan in my mobile at that time while calling webservice from my application it gets charged from my main balance.

 

Here is the code which we are using .....

 

String response;
private ConnectionFactory _factory;
_factory = new ConnectionFactory();
_factory.setAttemptsLimit(2);
_factory.setPreferredTransportTypes(new int[] { TransportInfo.TRANSPORT_BIS_B,
TransportInfo.TRANSPORT_TCP_WIFI, TransportInfo.TRANSPORT_WAP,
TransportInfo.TRANSPORT_WAP2, TransportInfo.TRANSPORT_MDS,
TransportInfo.TRANSPORT_TCP_CELLULAR });
try {
HttpConnection conn = (HttpConnection) _factory.getConnection(url).getConnection();
if (conn != null && conn.getResponseMessage().equals("OK")) {
response = new String(IOUtilities.streamToBytes(conn.openInputStream()));
} else if (conn != null) {
response = new String(IOUtilities.streamToBytes(conn.openInputStream()));
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
}

Please use plain text.
Developer
simon_hain
Posts: 15,845
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: BIS Not Working

welcome to the support forums.

you have to set the connection string for BIS on the factory.
you can get those as an alliance partner or by registering for bis push.

it is also better to check the response code instead of the response message, as the latter is not specified.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Contributor
ArulRaja
Posts: 18
Registered: ‎04-10-2013
My Device: 9900
My Carrier: xxxx

Re: BIS Not Working

Thanks for the replay

 

How could I register the bis push.could anyone help me to find link of it?

Is that bis push service is free ?

Please use plain text.
Developer
simon_hain
Posts: 15,845
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: BIS Not Working

yes, it's free
see
https://developer.blackberry.com/develop/platform_services/push_overview.html
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Contributor
ArulRaja
Posts: 18
Registered: ‎04-10-2013
My Device: 9900
My Carrier: xxxx

Re: BIS Not Working

Thanks for your response


I have some doubt on filling the BlackBerry Push Service Evaluation Form


My requirement is to provide all internet services like( bis,wi-fi,etc)
So which option may I select for  * Transport for Pushes :?


* Total Number of Subscribers that will Register to the BlackBerry Push API
* Pushes per Day, per Subscriber
* Average KB of Pushed Payload
* Push Service Type

 

Please use plain text.
Contributor
ArulRaja
Posts: 18
Registered: ‎04-10-2013
My Device: 9900
My Carrier: xxxx

Re: BIS Not Working

what is alliance partner ?. Is it free ?

what should i do for that ?

Please use plain text.
Developer
peter_strange
Posts: 19,598
Registered: ‎07-14-2008
My Device: Not Specified

Re: BIS Not Working

Alliance partner is not free, and more over, the program is no longer current.  To get access to BIS, you should register for PUSH as SImon suggested.  For confirmation that this is the correct approach, see this page:

http://developer.blackberry.com/java/documentation/intro_networking_1984362_11.html

Please use plain text.
Contributor
ArulRaja
Posts: 18
Registered: ‎04-10-2013
My Device: 9900
My Carrier: xxxx

Re: BIS Not Working

 

I have enabled the push service in my app but still BIS is not working

 

here the code which we are using ...............

 

String id = "xxxxxxx"; 
String url = "xxxxxxx";
int port = 1;
byte serverType = PushApplicationDescriptor.SERVER_TYPE_BPAS;

ApplicationDescriptor descriptor = ApplicationDescriptor.currentApplicationDescriptor();

PushApplicationDescriptor pushDescriptor = new PushApplicationDescriptor(id, port, url,
serverType, descriptor);

PushApplicationStatus pushApplicationStatus =
PushApplicationRegistry.getStatus( pushDescriptor );

byte pasStatus = pushApplicationStatus.getStatus();
if( pasStatus == PushApplicationStatus.STATUS_ACTIVE ) {
Dialog.alert("Already registered with Push API");
return;
}else if(pasStatus == PushApplicationStatus.STATUS_PENDING ){
Dialog.alert("Registration with Push API already scheduled");
return;
}
PushApplicationRegistry.registerApplication(pushDescriptor);

 

note :

The String id and url are private and so didn't share that

Please use plain text.
Developer
simon_hain
Posts: 15,845
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: BIS Not Working

did you register the mds connection string with the connection factory?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Contributor
ArulRaja
Posts: 18
Registered: ‎04-10-2013
My Device: 9900
My Carrier: xxxx

Re: BIS Not Working

Thanks for the quick response

 

No........

 

how to register the mds connection string with the connection factory?

 

plz give sample code

Please use plain text.