1

For an Android 2.2 application, written in Java, I'm facing a problem when I try to get information about the GPS satellites. In the OnCreate function of my main Activity, I declare an object derived from a Listener to deal with GPS events.

In the execution of the Listener, everything is fine except when I try to get satellites information by using the getSatellites function of a GpsStatus object retrieved from a LocationManager : the application stops with an error message.

With the same objects, I can perfectly get the time to first fix.

Can anybody help me?

Thanks in advance for the time you will spend trying to help me.

Zelig
  • 157
  • 3
  • 12
  • Seems like this might be an Android question? – walkingTarget Mar 28 '11 at 16:49
  • This question is hopelessly vague as asked. Obviously, you're developing on some platform, and in some language, with a standard API, but you need to say which one. Further, "stops with an error message" is not very helpful even to somebody who knows what platform you're using and is familiar with it. Please edit your question to include platform as a tag, and write exactly what you are doing, what works, and what error message you get when it doesn't work. – David Thornley Mar 28 '11 at 16:49
  • Sorry about the missing information. I'm developping on Androïd 2.2 using the Java language. – Zelig Mar 29 '11 at 16:19
  • The error message is unclear : an unexpected error caused the application to stop! – Zelig Mar 29 '11 at 16:20
  • Can you post the logcat output please? – John Mar 29 '11 at 18:48

1 Answers1

1

It's quite possible that the getSatelites is not going to give you what you need even if you can get it to work. See How can I check the current status of the GPS receiver? for a method to test whether you have a live Gps fix (if that is what you are attempting to do).

Community
  • 1
  • 1
Judah Sali
  • 1,088
  • 1
  • 7
  • 12