Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,463 members, 7,781,337 topics. Date: Friday, 29 March 2024 at 12:40 PM

Has Anyone Done A Blackberry App That Accessed The Net - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Has Anyone Done A Blackberry App That Accessed The Net (1341 Views)

Help! I Where Will I Learn Android And Blackberry App Programming! / How Can I Create Blackberry App For My Blog? / Programmers' Joke Picked Off The Net (2) (3) (4)

(1) (Reply) (Go Down)

Has Anyone Done A Blackberry App That Accessed The Net by EfeAriaroo: 10:31am On Mar 16, 2013
hi everyone. I'm currently writing a blackberry app for blackberry phones with OS 6. the app can access the internet on the simulator but when the app is deployed on the app it can't access the internet. please can anyone help with this? thanks a mil'
Re: Has Anyone Done A Blackberry App That Accessed The Net by Javanian: 5:16pm On Mar 16, 2013
Do you have an active internet connection on your system??
Re: Has Anyone Done A Blackberry App That Accessed The Net by EfeAriaroo: 6:10pm On Mar 16, 2013
yes.
Re: Has Anyone Done A Blackberry App That Accessed The Net by EfeAriaroo: 6:14pm On Mar 16, 2013
I'm sorry everyone. I reread my question again. I sounded stupid. I meant that, when the app is deployed on a phone the app can't access the internet I.e the app thinks the phone has no internet connection which is wrong. this is confusing because on the simulator all works as it should. I really need this fellas so that the app can be launched as soon as possible.
Re: Has Anyone Done A Blackberry App That Accessed The Net by dpuzo: 7:38pm On Mar 16, 2013
public static String getConnectionString(){
String con="";
if(WLANInfo.getWLANState()==WLANInfo.WLAN_STATE_CONNECTED){
con="interface=wifi";
}
else if ((CoverageInfo.getCoverageStatus()&CoverageInfo.COVERAGE_BIS_B)==
CoverageInfo.COVERAGE_BIS_B){
// blackberry internet service
ServiceRecord rec = getBIBSRecord();
if (rec == null){//couldn't find the right record
con = ";deviceside=true";// let the phone try to do the work
}else{//found the record, get the id
/*con = ";deviceside=false;connectionUID=" + rec.getUid()+ ";ConnectionType=mds-public";*/
con = ";deviceside=false;ConnectionType=mds-public";
}
}

else if((CoverageInfo.getCoverageStatus()&CoverageInfo.COVERAGE_MDS)==
CoverageInfo.COVERAGE_MDS){
con=";&deviceside=false";
}
else if((CoverageInfo.getCoverageStatus()&CoverageInfo.COVERAGE_DIRECT)==
CoverageInfo.COVERAGE_DIRECT){
String carrierUid=getCarrierBIBSUid();
if(carrierUid==null){
con=";deviceside=true";
}
else{
con=";deviceside=false?connectionUID="+carrierUid+"?;ConnectionType=mds-public";
}
}
else if(CoverageInfo.getCoverageStatus()==CoverageInfo.COVERAGE_NONE);
return con;
}
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"wink)){
if(records[currentRecord].getName().toLowerCase().indexOf("bibs"wink>=0){
return records[currentRecord].getUid();
}
}
}
return null;
}
public static ServiceRecord getBIBSRecord(){
try{
ServiceRecord[] ippps = ServiceBook.getSB().getRecords();
for (int i = 0; i < ippps.length; i++){
if (ippps[i].getCid().equals("IPPP"wink){
if (ippps[i].getName().indexOf("BIBS"wink >= 0){
return ippps[i];
}else if (ippps[i].getName().indexOf("5 Click"wink >= 0){
return ippps[i];
}
}
}
}catch(Exception e){
System.out.println(e.toString());
}
return null;
}

Then for your connection

HttpConnection connection = (HttpConnection) Connector.open(url+getConnectionString(), Connector.READ, true);

2 Likes

Re: Has Anyone Done A Blackberry App That Accessed The Net by EfeAriaroo: 12:37pm On Mar 17, 2013
Thanks dpuzo. I'll try that and get back to you.
Re: Has Anyone Done A Blackberry App That Accessed The Net by dpuzo: 2:12pm On Mar 17, 2013
Your welcome, what are you working on? I'm creating a blackberry app too and its ready, just debugin. Kinda hard to find blackberry developers
Re: Has Anyone Done A Blackberry App That Accessed The Net by EfeAriaroo: 2:53pm On Mar 17, 2013
@dpuzo Thanks men for the code, I really appreciate it but it didn't work on the simulator. Is it supposed to? I replaced the smiley faces with closing parenthesis. I hope that was okay? I think I should give you more information. Maybe it can help shine some more light on the situation. Apart from the 'GET' and 'POST' requests I make to my server-side code, in the app, I use a free facebook library in order to bring up a facebook login screen. On the simulator this screen displays and I could enter my facebook details and log in. But on a phone, when my friends tested the app the facebook log in screen couldn't display. It's almost as if my App doesn't set something that both my code and the facebook library would use. Any thoughts you may have about this would be most helpful. Thanks again and I hope to read from you soon.
Re: Has Anyone Done A Blackberry App That Accessed The Net by dpuzo: 3:59pm On Mar 17, 2013
Yes it should work, without the addition to the url you cant connect to internet on real device. It worked well for me. Mayb u ddnt do something right or you have another problem
Re: Has Anyone Done A Blackberry App That Accessed The Net by EfeAriaroo: 6:12pm On Mar 17, 2013
thanks dpuzo for your contribution. I guess I gotta look into my code again. if I can't find the problem I will try to reach out again.
Re: Has Anyone Done A Blackberry App That Accessed The Net by EfeAriaroo: 12:14am On Mar 24, 2013
permissions were the problem. it appears since my app wasn't downloaded from appworld it wouldn't be allowed to access the internet. I had to make the app ask the user for the permissions it needed which included internet access. That fixed the problem. hope this helps someone else.
Re: Has Anyone Done A Blackberry App That Accessed The Net by EfeAriaroo: 12:17am On Mar 24, 2013
ApplicationPermissions
beckyPermissions = new
ApplicationPermissions();
beckyPermissions.addPermission(Applicati­
onPermissions.PERMISSION_INTERNET);

/*
Several permissions can be added to the same
ApplicationPermissions object */

ApplicationPermissionsManager
appPermissionsManager = ApplicationPermissio­
nsManager.getInstance();

if(appPermissionsManager.invokePermissio­
nsRequest(beckyPermissions)){
//Permissions allowed
// Dialog.alert("Yippie!!! Permissions allowed."wink;
} else {
//Permissions denied
Dialog.alert("I have to close now. I can't function
properly without the right permissions."wink;
System.exit(0);
}
Re: Has Anyone Done A Blackberry App That Accessed The Net by dpuzo: 6:55am On Mar 25, 2013
EfeAriaroo: ApplicationPermissions
beckyPermissions = new
ApplicationPermissions();
beckyPermissions.addPermission(Applicati­
onPermissions.PERMISSION_INTERNET);

/*
Several permissions can be added to the same
ApplicationPermissions object */

ApplicationPermissionsManager
appPermissionsManager = ApplicationPermissio­
nsManager.getInstance();

if(appPermissionsManager.invokePermissio­
nsRequest(beckyPermissions)){
//Permissions allowed
// Dialog.alert("Yippie!!! Permissions allowed."wink;i
} else {
//Permissions denied
Dialog.alert("I have to close now. I can't function
properly without the right permissions."wink;
System.exit(0);
}

Ok, i ddnt not do dat, my wen u run my app the first time it ask for permission. Check dis out www.nairaland.com/1234656/please-us-test-app
Re: Has Anyone Done A Blackberry App That Accessed The Net by dpuzo: 8:24am On Mar 25, 2013
Got ur pm, my email address is donpuzoxx[at]gmail[dot]com
Re: Has Anyone Done A Blackberry App That Accessed The Net by Finconizer: 6:20pm On Jul 14, 2013
Yea, its very difficult to find a blackberry developer, thank God I found you guys cheesy. I also was facing the BIS connection issue and I found out that it seems RIM keeps the bis connection string as a secret until you register for a push service or so. But I stumbled on this ";deviceside=false;ConnectionType=mds-public"

(1) (Reply)

Create A Sec,ure / Google Hash Code 2016 / Which Computer Program Would You Choose

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 24
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.