Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

GPS on Windows Phone
Started by montipayton Jun 21 2016 11:41 AM

3 replies to this topic
gps windows phone location
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

montipayton

[GLOBAL: userInfoPane.html]
montipayton
  • Observer

  • 16 posts
  • Corona SDK

Hello everyone.

 
I have a question. I've written the code to derive my position by GPS. This code works on iOS, but does not work on Windows Phone. So I ask: GPS is usable on windows phone or is not supported? I ask this because it is not written in the official documentation (https://docs.coronalabs.com/api/event/location/index.html#TOC), while for what concerns the use of mapView is clearly written the ban.
I leave the code used, which works on iOS.
 
  local Tentativo = 0

  local function Posizionamento( event )

    if ( event.errorCode or ( event.latitude == 0 and event.longitude == 0 ) ) then

      Tentativo = Tentativo + 1

      if ( Tentativo > 10 ) then
        native.showAlert( "Segnale GPS assente...", { "OK" } )
      else
        timer.performWithDelay( 1000, Posizionamento )
      end
    else
        

            
      LATI = event.latitude
      LONG = event.longitude
       

      print( "Latitudine: ", LATI )
      print( "Longitudine: ", LONG )

    end
  end

  Runtime:addEventListener( "location", Posizionamento )
  ------------------------------------------------------------
If you can not use the GPS there is no other way to get its position?
 
Thank you in advance.


[TOPIC: post.html]
#2

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,807 posts
  • Enterprise

I don't know if it is supported. I checked out the docs and it does not look like it. You should be able to in c# and .net to get gps if you really need gps. There is a tutorial similar to this here: https://coronalabs.com/blog/2015/02/24/tutorial-inputting-text-on-windows-phone-8/

[TOPIC: post.html]
#3

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Moderator

  • 3,397 posts
  • Corona Staff

Unfortunately, we do not support GPS on Windows Phone.

 

We list out what APIs are supported on Windows Phone here...

   https://docs.coronalabs.com/daily/coronacards/wp8/support.html

 

If you need this feature, then you'll have to implement it yourself using our .NET/Lua bridging APIs as documented here...

   https://docs.coronalabs.com/daily/coronacards/wp8/communication.html



[TOPIC: post.html]
#4

montipayton

[GLOBAL: userInfoPane.html]
montipayton
  • Observer

  • 16 posts
  • Corona SDK

Thanks of responses and documentation links.




[topic_controls]
[/topic_controls]