Android Question Help: Problem with GPS in service module

kepler

Active Member
Licensed User
Longtime User
Good evening,

I'm a little bit stuck in the past days regarding an app I'm doing for a client. I must admit that I've been a little bit boring in the forum.... sorry.

Still, here's my problem: the app must send (among other things) the correct GPS location of the user (truck drivers). I've implemented (tryed at least...) the usual GPS and Location Manager lib in a service module, since it must be running all the time of the driving.

That service was defined in the Service_Create as Service.StartForeground
I believe this is correct.

But, what I've noticed is that the app sends the correct info to the server IF the mobile is more or less stilled.

My client started to complain that the app was stopping (error) when he was on motion. So I've made an experiment: I've removed all the GPS, etc, initializations, and began to move the cell phone quicly in the air (it sounds ridiculous, I know...). The app was ok. But when I putted again the initialization of the GPS, listening routine, and did the same stupid thing, the app really stoped... (same thing with Location lib).

This leads me to believe that the problem is not on the service itself - but in the GPS calls...and the movement.

Any idea will be very welcome...I'm off schedule in this work.

Kind regards,

Kepler
 

Beja

Expert
Licensed User
Longtime User
did you have a drive with the (driver) phone, instead of swinging it around in the air? moving it fast in the air will fire fast successive events of almost all of the sensors, exhausting
processor resources. this may be non-sense talk because I never try it.
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Hi,

Thanks for the reply. Yes, I did a small driving and had no problems. But the truck drivers didn't had such luck.... Maybe they are moving too fast. I'm thinking on creating a service module only for the GPS location and turn it in a sticky service module?

What do you think?

Kepler
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Good morning Erel,

I want to believe that. But why, without the GPS routines, I get no problems? Can it be in the variables of the GPS.Start? Should I define them to, for instance, (5000,16) (5 seconds, 16 meters)? I' not aware of the parameters for this kind of app...

Regards,

Kepler
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Hi,

I've tested again the application, but with the GPS defined to GPS.Start(5000,10)

No crashes...thank God.

Kind regards,

Kepler
 
Upvote 0
Top