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: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Check & configure available network connection

Hi Everyone,

 

I have an application in which I want to check for

 

(1.) All types of Internet Connections and current available connection on the device,

(2.) Configure the application accordingly.


Any idea how to do that?Thanx for ur help/suggestion.

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Check & configure available network connection

Any response neededforabove post... Any guidance plz.Actually,I musing a function:

 



 private static String TransportAvailability()
 {
                    ServiceBook sb = ServiceBook.getSB();
                    ServiceRecord[] records = sb.getRecords();
  
                    for (int i = 0; i < records.length; i++)
                    {
                        ServiceRecord myRecord = records[i];
                        String cid, uid;
      
                            if (myRecord.isValid() && !myRecord.isDisabled())
                            {
                                    cid = myRecord.getCid().toLowerCase();
                                    uid = myRecord.getUid().toLowerCase();
                              
                                // BIS
                                    if (cid.indexOf("ippp") != -1 && uid.indexOf("gpmds") != -1)
                                    {
                                            return ";deviceside=true;ConnectionUID=" + myRecord.getUid();
                                    }                     
                                      
                                // BES
                                    if (cid.indexOf("ippp") != -1 && uid.indexOf("gpmds") == -1)
                                    {
                                            return ";deviceside=false";
                                    }
                                  
                               // WiFi
                                    if (cid.indexOf("wptcp") != -1 && uid.indexOf("wifi") != -1)
                                    {
                                            return ";interface=wifi";
                                    }                               
                                                                               
                               // Wap2.0
                                    if (cid.indexOf("wptcp") != -1 && uid.indexOf("wifi") == -1 && uid.indexOf("mms") == -1)
                                    {
                                            return ";deviceside=true";
                                    }
                            }     
                        }
                    return ";deviceside=true";
 } 

 

Is above the right way I m going on?

 

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Highlighted
Developer
Posts: 43
Registered: ‎09-28-2009
My Device: Not Specified

Re: Check & configure available network connection

Hi kanaksony,

 

This issue has been extensively covered by the local experts peter_strange and co in this thread to help explain and understand how to listen for and connect effectively. Also on the last page of the Thread there is a reference to versatilemonkey the creator of PodTrapper who has created an brilliant wrapper class that does all that work for you if you are not interested in doing the research yourself.

 

Hope this helps and best of luck

 

Andre