Geolocalization via Titanium
Hi I'm developing an app that needs the most accurate GPS localization. Using the method that uses "kitchen sink" 开发者_JS百科to show all Titanium's possibilities it gives me the network geolocation, can I have the device detection?
PS: The project is actually developed for Android, but will be soon ported to iPhone.
So, to clarify, you're basing your code off of this example? And the issue is that you are getting network-based geolocation, instead of GPS-based geolocation?
Have you tried replacing the preferredProvider
with Geolocation.PROVIDER_GPS
, instead of the string "gps"? As in:
Ti.Geolocation.preferredProvider = Ti.Geolocation.PROVIDER_GPS;
If you are using TiStudio instead of TiDeveloper you can use the sample project GPS to start with. It's bundled in the download so just fire it up and use that code as a working copy to learn from. It's android ready as well :-)
精彩评论