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
New Developer
jwhanes
Posts: 18
Registered: ‎08-13-2008
My Device: Not Specified

Sprint GPS is driving me insane.

I have been trying to figure out how to get Sprint GPS to work for I don't know how long. 

 

The dumbed down version of my GPS solution, that works on every other carrier other then Sprint looks like this..

 

Criteria c = new Criteria();

LocationProvider lp = LocationProvider.getInstance(c);

 

When I do this on a Sprint device, the LocationProvider object does not get initialized.

 

So, I've gathered that their Location API (JSR-179) is blocked.  And to unblock it on your phone you need to get some code that registers your phone number with Sprint.  But if you wanted to distribute your application, you would need to have some partnership with Sprint which will allow you to sign your application, which will unlock the Location API.  And this will cost an ungodly amount of money.  I was even in contact with some Sprint people and they verified this. 

 

So after hearing this, I decided to create a Bluetooth GPS solution which would not use the Location API.  All I would need to do was parse the Bluetooth data myself.  It worked great.  But it does require you to purchase a GPS puck device, which is dumb.

 

But now I'm hearing of other companies getting this Sprint GPS to function just fine.  And I KNOW they are not coughing up the money for the partnership cause the cost is ridiculous.

 

So I recently ran across a thread on the sprint forum stating if you initialized the LocationProvider as shown below, everything will work just fine...

 

Criteria c = new Criteria();
c.setPreferredPowerConsumption(Criteria.POWER_USAG E_LOW);
LocationProvider lp = LocationProvider.getInstance(c); 

 

So I gave this a try and it WORKED!  I actually got some stupid GPS points from my stupid Sprint device when doing it this way.  And I could not be more pissed.  Now I have to go to my boss and tell him I'm a moron and I wasted months and months of time developing and testing this stupid Bluetooth GPS solution when all I had to do was add in the one line of code.

 

Is this true?  Did this seriously just happen to me? If I distribute this solution to my customers is it going to still work!?!?  Its driving me insane.  How could I have missed this?

 

Has anyone had any problems like this?  Can anyone validate the correctness of this message?  I REALLY do not want to go to the higher-ups and say, "Yeah, it works now, I wasted a crazy amount of time on the Bluetooth Solution, here is the correct way to do it" then when the customers get it, it doesn't work.

 

Sorry this is so long, but can anyone empathize or sympathize or whatever?

Please use plain text.
Developer
skicson
Posts: 56
Registered: ‎07-14-2008
My Device: Not Specified

Re: Sprint GPS is driving me insane.

Actually, our experience with the Sprint GPS has been pretty good.  Both of my partners are on Sprint (I'm on Verizon) and they've had pretty good results.  I've changed that code a bit, but I think I used LocationProvider lp = LocationProvider(null) and it worked for Sprint (but not Verizon).

 

Doing it the bluetooth puck way is okay, but I've found you're at the mercy of the bluetooth connectivity which seems spotty sometimes.

Please use plain text.
New Developer
jwhanes
Posts: 18
Registered: ‎08-13-2008
My Device: Not Specified

Re: Sprint GPS is driving me insane.

Thanks for the feedback. 

 

And no kidding those bluetooth connections can be spotty.  Thats one of the reasons the development and testing took so long.  Such a pain.

 

Did you ever run into the JSR-179 restriction?  When I was trying to get the GPS to function on the Sprint device thats all I heard about on a lot of forums.  "You need to have your app signed by sprint to have access to the location API".  I figured this was true since my app's GPS did not function on Sprint, but worked great on others.

 

Now it sounds like the way you define the Criteria object, will determine how your phone gets its GPS data.   Either through the cell towers, OR through the GPS chip in the phone.  It seems to me the JSR-179 restriction pertains ONLY to gathering data from the GPS chip.  If I wanted to use the Cell towers, its no big deal.

 

This sound about right?

Please use plain text.
Administrator
MSohm
Posts: 14,528
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Sprint GPS is driving me insane.

I recommend having a look at these links.

 

What Is - The BlackBerry smartphone models and their corresponding GPS capabilities
Article Number: DB-00615

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800703/What_Is...

 

What Is - Best practices for designing GPS applications for BlackBerry smartphones operating on CDMA networks 
Article Number: DB-00671

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800703/What_Is...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
Developer
gtj
Posts: 319
Registered: ‎07-20-2008
My Device: Not Specified

Re: Sprint GPS is driving me insane.

Well, I've had nothing but good luck with Sprint GPS.   In fact, it's the only carrier I've tested where everything works as advertized. 

 

This code has worked for me every time...

 

        Criteria gpscrit = new Criteria();
        gpscrit.setHorizontalAccuracy(10);
        gpscrit.setVerticalAccuracy(10);
        gpscrit.setAltitudeRequired(true);
        gpscrit.setSpeedAndCourseRequired(true);
        gpscrit.setCostAllowed(false);
        gpscrit.setPreferredPowerConsumption(Criteria.POWER_USAGE_HIGH);
        LocationProvider lp = LocationProvider.getInstance(gpscrit);

 

 Two things to note though...

 

First, the criteria you're providing probably won't get you an accurate  fix.  POWER_USAGE_LOW = CELL_SITE on a CDMA device.

 

Second, if the GPS in the device hasn't had a good fix recently, it could take more than a few minutes to geta valid one.

 

 

 

Please use plain text.
New Developer
jwhanes
Posts: 18
Registered: ‎08-13-2008
My Device: Not Specified

Re: Sprint GPS is driving me insane.

Thanks for the Info.

 

I got it working for the most part.  I think my original problem was with defining the criteria.  According to a couple links msohm posted, not only does it depend on the service, but also the phone as well.  And apparently the phone I'm working with does not support atonomous GPS.  

 

Well feels good to finally know what was happeneing.  Plus I didn't get fired.  so all is well.

 

Thanks everyone for their info and help.

 

 

Please use plain text.