GPS usage

Hello Friends

I am developing an application in which i have to use the current location address. So how can i get the current location as an address. including street number and all.

hoping for your reply soon.

Regards
Varun [import]uid: 130269 topic_id: 34646 reply_id: 334646[/import]

The simplest solution is to call a MapView’s [lua]nearestAddress[/lua] function. But this would mean you would have to display a MapView onscreen.
http://docs.coronalabs.com/api/type/Map/nearestAddress.html

If you don’t want to use a MapView, then you can fetch this information from Google’s servers via their HTTP API (see the link below) and Corona’s [lua]network.request()[/lua] function. That’s a task for you, but I remember someone else on our forum who figured out how to do this.
https://developers.google.com/maps/documentation/geocoding/
[import]uid: 32256 topic_id: 34646 reply_id: 137758[/import]

Hi Joshua

Thanks for your reply, i used nearestAddress, but that is not working on android device. Can you suggest me how can i use it in android device. For Iphone it is working perfectly fine but for android it is not.

Hoping for your reply

Regards
Varun [import]uid: 130269 topic_id: 34646 reply_id: 137822[/import]

Have a look at sample app “Interface/MapView” that is included with the Corona SDK for an example on how to use this API and what Android permissions that you need to set up in your “build.settings” file. You need those Android permissions in order to get location data from the device. [import]uid: 32256 topic_id: 34646 reply_id: 137940[/import]

The simplest solution is to call a MapView’s [lua]nearestAddress[/lua] function. But this would mean you would have to display a MapView onscreen.
http://docs.coronalabs.com/api/type/Map/nearestAddress.html

If you don’t want to use a MapView, then you can fetch this information from Google’s servers via their HTTP API (see the link below) and Corona’s [lua]network.request()[/lua] function. That’s a task for you, but I remember someone else on our forum who figured out how to do this.
https://developers.google.com/maps/documentation/geocoding/
[import]uid: 32256 topic_id: 34646 reply_id: 137758[/import]

Hi Joshua

Thanks for your reply, i used nearestAddress, but that is not working on android device. Can you suggest me how can i use it in android device. For Iphone it is working perfectly fine but for android it is not.

Hoping for your reply

Regards
Varun [import]uid: 130269 topic_id: 34646 reply_id: 137822[/import]

Have a look at sample app “Interface/MapView” that is included with the Corona SDK for an example on how to use this API and what Android permissions that you need to set up in your “build.settings” file. You need those Android permissions in order to get location data from the device. [import]uid: 32256 topic_id: 34646 reply_id: 137940[/import]