cancel
Showing results for 
Search instead for 
Did you mean: 

How to use wi-fi connection on Blackberry app - SUP

tahir_z
Contributor
0 Kudos

Hi,

I have created app by DAD and running BB application on device but it uses GPRS not WI-FI well even though i have enabled both GPRS-WIFI on device it doesnt use wi-fi transport. I have seen following code in generated code API's :

/**

  • Returns list of transports available on blackberry device. This list may

  • include 0 or more from the following transports: <br>

  • BES, BIS, TCP, WAP1.0, WAP2.0, WIFI, UNITE

  • <p>

  • While setting transport for synchronization user should check for the

  • suffificient coverage using {@link isCoverageSufficient()} and set the

  • transport in sycnhronization profile as follows:

  • <p>

  • <code>

  • if(MyDatabase.isCoverageSufficient("WIFI"))

  • {

  • MyDatabase.getSynchronizationProfile().setString("transport", "WIFI");

  • MyDatabase.synchronize();

  • }

  • </code>

  • @return

*/

well i dont know where to add this code to affect whole application to use wi-fi. Anyone if has experience on it could please help me.

Regards

Tahir

Edited by: ozmrdn on Mar 29, 2011 1:18 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all,

I am facing an error while connecting to sup server via wifi in blackberry device. I am getting a Communication error :tunnel failed ..

I saw this code

if(MyDatabase.isCoverageSufficient("WIFI"))

{

MyDatabase.getSynchronizationProfile().setString("transport", "WIFI");

MyDatabase.synchronize();//line 1

}

but I don't know whether to add any parameter to sychronize() function call in line 1 or not and where exactly to add this code.

Former Member
0 Kudos

Hi

Replace the synchronize() method of ProjectNameDB.java with

public void synchronize(){
if(MyDatabase.isCoverageSufficient("WIFI"))
 {
 MyDatabase.getSynchronizationProfile().setString("transport", "WIFI");
 MyDatabase.synchronize(...);
 }else {
MyDatabase.synchronize(...);
}
}

It will work now.

I have tested the above code in Blackberry Storm 2

Edited by: Pradeep Gudipati on May 16, 2011 9:01 PM

Edited by: Pradeep Gudipati on May 16, 2011 9:02 PM

Former Member
0 Kudos

wi fi does not work. We are waiting for an update ... however there are old topics on this forum that explain how to enable it manually like this:

Edited by: Alessandro Iannacci on Apr 6, 2011 10:56 AM

tahir_z
Contributor
0 Kudos

Hi,

Wi-fi doesn't work completely or it works if i set some settings ? I have tried to add the custom codes which explained in other topics as well. But it didnt work so my question is where to add this code ? in which class etc..?

Regards