BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-08-2007, 08:17 PM   #1
ZaBlanc
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 7105T
Carrier: T-Mobile
Posts: 19
Default GPS Fails on BB 7520 -- But Works in Emulator

Please Login to Remove!

I am getting so frustrated. My code works fine on the emulator, but when running on an actual Nextel 7520, it fails. Here is my code:

Quote:
public class GeoPointLocator {
public static GeoPoint locate() throws Exception {
// keep testing the hardware until we get a good result
while (true) {
Criteria cr = new Criteria();

// cr.setSpeedAndCourseRequired(true);
// cr.setHorizontalAccuracy(Criteria.NO_REQUIREMENT);
// cr.setPreferredPowerConsumption(Criteria.NO_REQUIR EMENT);

LocationProvider lp = LocationProvider.getInstance(cr);

if (lp == null) {
return new GeoPoint(0.0, 0.0, 0);
}

Location l = lp.getLocation(-1);

Coordinates c = l.getQualifiedCoordinates();

if (c != null) {
double latitude = c.getLatitude();
double longitude = c.getLongitude();

return new GeoPoint(latitude, longitude, 0);
}
}
}
It dies at the bold line. I am running this code within a thread. The 7520 OS is at v4.1.0.273

HELP!
Offline  
Old 05-09-2007, 08:26 AM   #2
knezek
Thumbs Must Hurt
 
Join Date: Mar 2007
Model: 8800
Carrier: The New ;) AT&T
Posts: 60
Default

Quote:
Originally Posted by ZaBlanc View Post
I am getting so frustrated. My code works fine on the emulator, but when running on an actual Nextel 7520, it fails. Here is my code:



It dies at the bold line. I am running this code within a thread. The 7520 OS is at v4.1.0.273

HELP!
You need to upgrade to 4.1.0.359 or higher before gps works on 7520.(I'm at 4.1.0.380 currently)

If you check your emulator, it's probably running 4.1.0.359, which was the first to support jsr 179(location).

Last edited by knezek; 05-09-2007 at 08:31 AM..
Offline  
Old 05-09-2007, 01:17 PM   #3
ZaBlanc
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 7105T
Carrier: T-Mobile
Posts: 19
Default Silly question...

Silly question...how do I upgrade the OS?
Offline  
Old 05-09-2007, 02:28 PM   #4
Skipper_Joe
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Default

This is not true, JSR179 is supported since 4.0.2 at least.
My guess is that you need to sign your application. What exactly exception is thrown in bold line?
Offline  
Old 05-09-2007, 08:21 PM   #5
ZaBlanc
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 7105T
Carrier: T-Mobile
Posts: 19
Default Don't Know

It IS true the app is not signed, however. I don't get any exception saying as such. I can't get a good handle on the error...I get LocationException. Can't extract any more info. It fails immediately.

What error would you expect if it wasn't signed?
Offline  
Old 05-09-2007, 10:40 PM   #6
Skipper_Joe
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Default

I would expect SecurityException.
So it looks like it really can't get LocationProvider for some reason. Can you get exception's message? Is it possible your Nextel data plan is not enabled? Or you are not in coverage?
Offline  
Old 05-09-2007, 11:00 PM   #7
ZaBlanc
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 7105T
Carrier: T-Mobile
Posts: 19
Default GPS does work.

GPS does work on the device with the other apps.
Offline  
Old 05-09-2007, 11:17 PM   #8
Skipper_Joe
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Default

and what is exception message? Can you just catch this exception and print ex.toString() to debug output?
Offline  
Old 05-10-2007, 07:25 AM   #9
knezek
Thumbs Must Hurt
 
Join Date: Mar 2007
Model: 8800
Carrier: The New ;) AT&T
Posts: 60
Default Sorry to disagree...but

Nothing in your code needs to be signed, and you don't need a data plan to use the gps functionality. I have working gps apps that I wrote on a 7520 with no service at all that work just fine.

I do know however that they did not work until I upgrade my os. Skipper is right about the gps being supported before 4.1.359, but not with JDE 4.1 at least from my experience....

Here's the link to update your OS:

https://www.blackberry.com/Downloads...B9D5EE16489088

Just pick 7520 from the list.
Offline  
Old 05-10-2007, 08:42 AM   #10
Skipper_Joe
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Default

I have application working with GPS under 4.0.2 OS with 7520.

Knezek, can you tell in more details how it works without network? This is very interesting to me: I tried to run GPS on 7520 outside US (thus no Nextel coverage) and it fails (either native GPS widget or my own app), though I have valid sim card.
Offline  
Old 05-10-2007, 09:28 AM   #11
knezek
Thumbs Must Hurt
 
Join Date: Mar 2007
Model: 8800
Carrier: The New ;) AT&T
Posts: 60
Default

Quote:
Originally Posted by Skipper_Joe View Post
I have application working with GPS under 4.0.2 OS with 7520.

Knezek, can you tell in more details how it works without network? This is very interesting to me: I tried to run GPS on 7520 outside US (thus no Nextel coverage) and it fails (either native GPS widget or my own app), though I have valid sim card.
You only need network coverage if you are downloading something, i.e. maps. My app is a distance calculator that works standalone thus does not need a network connection.
Offline  
Old 05-10-2007, 12:40 PM   #12
ZaBlanc
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 7105T
Carrier: T-Mobile
Posts: 19
Default Jde

I'm using JDE 4.1 so I will try to upgrade the OS first. Judging by the API in JDE 4.1, the API isn't locked. And I'm not about to spend $100 to find out for sure. if the OS upgrade doesn't work, I will jut keep hacking I guess.

Thanks!
Offline  
Old 05-18-2007, 11:38 AM   #13
tclark
Knows Where the Search Button Is
 
Join Date: Apr 2007
Model: 8800
PIN: N/A
Carrier: telus
Posts: 15
Default

just curious you are using a cr
LocationProvider lp = LocationProvider.getInstance(cr);

what happens if you dont use a cr
eg
LocationProvider lp = LocationProvider.getInstance(null);

This code works for me on a full fleet of courier drivers using 7520 for delivery dispatch
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


MEASUREMENT COMPUTING PCI-DDA08/16 8-channel, 16-bit Analog Output Board 48 D IO picture

MEASUREMENT COMPUTING PCI-DDA08/16 8-channel, 16-bit Analog Output Board 48 D IO

$349.99



Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog picture

Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog

$422.50



Computer Boards Measurement Computing PCM-DAS08 picture

Computer Boards Measurement Computing PCM-DAS08

$200.00



Computer Based Andon Alert Signal Manufacturing Software Application picture

Computer Based Andon Alert Signal Manufacturing Software Application

$499.00



Onset Computer Analog/Temp/RH/Light Data Logger MX1104 Onset Computer MX1104 picture

Onset Computer Analog/Temp/RH/Light Data Logger MX1104 Onset Computer MX1104

$261.31



Measurements Computing PCI-DDA02/16 Analog Output and Digital I/O Card picture

Measurements Computing PCI-DDA02/16 Analog Output and Digital I/O Card

$699.99







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