BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-27-2009, 07:09 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Location: Bilbao
Model: 8900
PIN: N/A
Carrier: Vodafone
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Check coverage on start-up

Please Login to Remove!

Hi,

I have an application that run on start-up.
The first thing that i must do before show the first screen is check a web service for update of my local db.

In simulator it work fine, but in my 8900 I have an error because (i think) it start before that i can put my pin and there isn't any conection to internet (gprs or wi-fi).
I try to do something like this before start my process
Code:
int retry=0;
while (!CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT,RadioInfo.WAF_WLAN,false) && retry++<20)
        try{Thread.sleep(2000);}catch(InterruptedException e){}
updateTableTask.run();
I use WAF_WLAN becautse now I use a WLAN conection, but i try with other and it's the same.
I know that the problem is the connection because when the application start on start-up it "crash" but if I start it when the bb have a connection it work fine.

Any idea?
Thank for help!
Offline  
Old 08-27-2009, 10:02 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

I would try looking at ApplicationManager.getApplicationManager().inStart up()

Or, you might try setting a CoverageStatusListener, which will call you back when the coverage has changed.
Offline  
Old 08-28-2009, 05:17 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Location: Bilbao
Model: 8900
PIN: N/A
Carrier: Vodafone
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank for answer!

Quote:
Originally Posted by Dougsg38p View Post
I would try looking at ApplicationManager.getApplicationManager().inStart up()
when I start the application, I wait for the end of startup, but when it end i still don't have coverage.

Quote:
Originally Posted by Dougsg38p View Post
Or, you might try setting a CoverageStatusListener, which will call you back when the coverage has changed.
I try it, but seems that when the coverage change to CoverageInfo.COVERAGE_DIRECT I can't send nothing because i don't have the sufficient coverage (or something like it)
Offline  
Old 09-25-2009, 05:08 PM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Location: Bilbao
Model: 8900
PIN: N/A
Carrier: Vodafone
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb

Finally i find the solution in the forum with a link
Livelink - Redirection

I have a methode like this
Code:
private synchronized boolean getInCoverage() {
	return (RadioInfo.getNetworkService() & RadioInfo.NETWORK_SERVICE_DATA)>0;
    }
Thank for help!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.