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
shadowgolf
Posts: 35
Registered: ‎02-05-2012
My Device: Playbook
My Carrier: T-Mobile

Re: URL works over wifi but not over mobile data

That's what gave 400 over network and IllegalArgumentException over wifi. Seems I might be at a dead end!

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

Re: URL works over wifi but not over mobile data

OK, I' am being a pillock.  Ignore my comments.  Now thinking....

 

Do you see the problem on a simulator?

Please use plain text.
Contributor
shadowgolf
Posts: 35
Registered: ‎02-05-2012
My Device: Playbook
My Carrier: T-Mobile

Re: URL works over wifi but not over mobile data

No, works fine on a simulator.

Please use plain text.
Contributor
shadowgolf
Posts: 35
Registered: ‎02-05-2012
My Device: Playbook
My Carrier: T-Mobile

Re: URL works over wifi but not over mobile data

Sorted it with the following. No idea why it's different to the URL encoding I tried before but it works:

 

String _confUrl = wd.getConfirmUrl().substring(wd.getConfirmUrl().indexOf("?") + 1);

_url = wd.getConfirmUrl().substring(0,wd.getConfirmUrl().indexOf("?") + 1);

URLEncodedPostData _params = new URLEncodedPostData(
URLEncodedPostData.DEFAULT_CHARSET, false);

while (_confUrl.indexOf("=") > -1) {
if (_confUrl.indexOf("&") > -1) {
_params.append(_confUrl.substring(0, _confUrl.indexOf("=")),
_confUrl.substring(_confUrl.indexOf("=") + 1, _confUrl.indexOf("&")));
_confUrl = _confUrl.substring(_confUrl.indexOf("&") + 1);
} else {
_params.append(_confUrl.substring(0, _confUrl.indexOf("=")),
_confUrl.substring(_confUrl.indexOf("=") + 1));
_confUrl = _confUrl.substring(_confUrl.indexOf("=") + 1);
}
}

_url += new String(_params.getBytes());

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

Re: URL works over wifi but not over mobile data

Great!!!

 

So basically you get a 400 when here something, currently unknown, a little weird in your URL.  But only when using the mobile network.

 

I do so love problems like this......

Please use plain text.