Pergunta

I am trying to get my current location; my code is correct but wp8 emulator is giving every time same results (Microsoft place while I am in Asia). I also read people posts even on stack overflow but I could not understand their answer. they are saying set location from emulator ">>" "Location". I want to know can emulator give me correct answer when I run my app ? Is it emulator fault ? how will it work on real device ? will it give same wrong results or correct ones ?

Thanks

Foi útil?

Solução

The WP8 emulator doesn't have a GPS or other means to get a location like a phone or other devices might be able to. So, the emulator has other ways of getting location information.

If you want to change your location settings around, you need to click on the double chevron to the right of the emulator. This will open up the additional tools menu. Click on the Location tab. Then, click anywhere on the map to set your emulator's location to the place where you clicked. When you run code to get the location it will reflect the new location.

Windows Phone 8 Emulator with additional tools open

Now you asked

can emulator give me correct answer when I run my app

The emulator does not know where it is, you set its location in the way described above. So, as long as you give it a location you deem correct then it will be correct.

how will it work on real device

On a real device there are multiple ways of obtaining the location. 1. GPS. 2. Location of cellular towers. 3. You could connect to a Wifi network (The location of some wifi connection points can be ascertained by the phone.) The phone will use one of these mechanisms to get the location.

Outras dicas

It will work fine on real device. Emulator doesn't have required hardwares to detect your location correctly (such as mobile GPS) when a real windows phone device has.

That's the reason why people setting location in emulator manually for purpose of testing their location-aware application.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top