pdiddy
pdiddy

Reputation: 6297

android location detection

So I wanted to detect the user current location when my main activity starts.

The way I implemented was to have the GPS location manager and the Wifi location manager and one locationlistener listening to Both. As soon as the locationlistener found the current location. it will stop listening for location change and consider this location the current location.

My question is, do you see any danger in using both GPS and Wifi? I used both in case the device don't have the GPS activated or vice versa ....

Thanks,

Upvotes: 2

Views: 647

Answers (2)

Ashterothi
Ashterothi

Reputation: 3282

I have seen several places where they actually recommend this kind of approach. However, word of warning: always make sure you have it made so that if no lock is made it times out. Otherwise you may melt phones if they are indoors.

Upvotes: 2

jakewp11
jakewp11

Reputation: 450

I don't see an issue with it. I know a lot of applications use both wifi and GPS to get a more accurate location. The only problem with using that stuff is battery life, but that's something you sacrifice for performance.

Upvotes: 2

Related Questions