2

I am looking for device's location, I used the code provided by google (https://github.com/googlesamples/android-play-location/tree/master/BasicLocationSample) but it seems working differently if in different devices. The two devices are Samsung Galaxy Ace Plus 7500 (S7500) and HUAWEI Y530-U00, I used GPS and 3G, the result was a very big location difference (about 300 or 400 meters). I used FINE location to perform my location but it seems the same.

Another problem is about S7500 which seems to update his location only if an app require internet, so I have to open an app and after check again location.

I would know if 2 people are near but with an approximation of about 50 meters, how could I get it?

Thanks in advance!

user4789408
  • 1,196
  • 3
  • 14
  • 31
  • are you using the GPS Provider or the Network Provider to get you location? – ichthyocentaurs Apr 19 '15 at 12:54
  • @AkshatArora I am using what is provided by the link, I installed the project to my devices, I able Internet and GPS when I check the position – user4789408 Apr 19 '15 at 12:56
  • Read the comments in the code, it says // applications that do not require a fine-grained location and that do not need location // updates. – ichthyocentaurs Apr 19 '15 at 12:59
  • @AkshatArora I know, I modified the code, I changed the manifest to use fine location. It should work, but what I can't understand is why HUAWEI provides me the correct location and S7500 not. – user4789408 Apr 19 '15 at 13:06
  • just because you changed the manifest, dows not mean a library will start using/fetching fine location. Manifest entry is just a permission. The code that google api, says that it does not fetch the fine location, unless you changed the play library code, I dont see how that would be possible. – ichthyocentaurs Apr 19 '15 at 13:10
  • @AkshatArora I am not sure, theoretically the precision choosed is the same declared in manifest, so if I set manifest with "fine location" app should use this if I able both Internet and GPS. I am in wrong? (If yes how could I solve?) – user4789408 Apr 19 '15 at 13:19
  • Theoritically its just a permission, the developer, you, or the third party api provider (google play in this case) can choose to not use it in your app (Which is bad because the user who installs the app sees these permissions). If you really want to use fine location, you will find a lot of code samples on SO. You would benefit from using the logic in this question - http://stackoverflow.com/questions/20210565/android-locationmanager-get-gps-location-if-no-gps-then-get-network-provider-l – ichthyocentaurs Apr 19 '15 at 13:28
  • @AkshatArora My app need to know the precise position, because my services are based with position, if I can't get the position (with max distance of 50 meters) I can not do anything – user4789408 Apr 19 '15 at 13:40

0 Answers0