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

Web and WebWorks Development

Reply
Developer
ignites
Posts: 466
Registered: ‎04-11-2012
My Device: Bold 9900
My Carrier: Rogers
Accepted Solution

Detect if there is access to WIFI/Internet

What do i need to do to detect whether or not a device is connected to the internet. 


Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage. Please hit the like button below if what I said helped!
Please use plain text.
Developer
rorybarnes
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900
My Carrier: Rogers

Re: Detect if there is access to WIFI/Internet

Check blackberry.system.hasDataCoverage

 

https://bdsc.webapps.blackberry.com/html5/apis/blackberry.system.html#.hasDataCoverage

 

--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Please use plain text.
Developer
ignites
Posts: 466
Registered: ‎04-11-2012
My Device: Bold 9900
My Carrier: Rogers

Re: Detect if there is access to WIFI/Internet

this doesnt seem to work. it seems to kill my app and it comes up blank.. did it do somethign wrong?

 

Here is my html file

 

<body onload="fun()">
<script type="text/javascript">
 function fun(){
if (!blackberry.system.hasDataCoverage()) {
alert("This app requires access to internet for the content to work. Please turn on Wifi and restart this application");
}
else{ 

alert('Im in');

}

}

</script></body></html> 


Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage. Please hit the like button below if what I said helped!
Please use plain text.
Trusted Contributor
zahirw
Posts: 134
Registered: ‎04-15-2012
My Device: Bold 9900
My Carrier: Vodafone

Re: Detect if there is access to WIFI/Internet

Did you manage to fix this?
Please use plain text.
Developer
ignites
Posts: 466
Registered: ‎04-11-2012
My Device: Bold 9900
My Carrier: Rogers

Re: Detect if there is access to WIFI/Internet

nope goinng to submit my app without it and fix the bug after. I want to make it to orlando loll


Developer for easyDial for BlackBerry Bold & inLink for BlackBerry PlayBook
Find me online via twitter, or on the techfruits.com webpage. Please hit the like button below if what I said helped!
Please use plain text.