I am using HTML5 Geo-location API for getting the GPS cordinates
navigator.geolocation.getCurrentPosition(geolocationSuccess,
[geolocationError],
[geolocationOptions]);
This is working in all version except Blackberry 9800. I am using the api in blackberry webworks . Could somebody help me out, whether blackberry 9800 supports the above api, or I have to do something else.
Or can anyone tell me any blackberry webworks extension for Geolocation.
That's the correct way to retrieve GPS coordinates in a BlackBerry WebWorks app.
Confirm that your device can retrieve GPS coordinates in general. If it works on some devices except one, then I think its a connectivity issue. Try this:
1) Open Settings --> Device --> Location Settings
2) Make sure the "Location Services" is set to 'On'.
3) Open the menu, and select "Refresh Location"
You should see the GPS coordinates populated in the 'Location' section of this screen. These values will be sent to the navigator.geolocation.getCurrentPosition() method. If these values remain empty, then your app will get empty values too.
Hope that helps.
Related
I am trying to develop an app that access HERE map through its API to get the direction route using transit (not drive or walking) on WP8.1. When I go to HERE developer website, I didn't see the mobile SDK for windows phone. Is HERE maps API still support for WP8.1? Why can't I see HERE maps and its other apps (HERE drive+, HERE transit) in windows phone app store now? Has anyone tried HERE API in WP8.1 before?
The reason I want to use HERE maps API because the native WP8.1 map API does not return route in transit mode.
Thanks.
It was available 4-5 years ago but not anymore.
I am using Xamarin and have tried many Google Map examples. The map is not displaying on any of the emulators.
My question is this: Can a Google Map be displayed on an emulator, or can it only be displayed on a real device?
You cannot use Google Maps in an emulator because it works only in a real device, you have the option to debug directly in a mobile or tablet to show it, or paste your apk and install it later in order to test it.
I guess this is your answer.
Bye
When it comes to Maps v2, you are better off using a device than the emulator.
That said, you can use the emulator. Google Maps is only supported on emulators that are running an AVD that is running the most recent Google API. See comment 29 in bug 57880.
Problem
I want to launch Nokia Maps inside Windows Phone 8 but I can't find the URI scheme which would allow me to do this.
Nokia Maps doesn't seem to listen to their REST Api or url either. (While this does work in Windows Phone, it's not using the Nokia Map it uses the browers)
My eventual goal is to figure out all the things Nokia Maps can do (X to Y, center on a gps coordinate, label locations, etc), and access them through app launching.
I originally tried the bingmaps URI scheme:
http://msdn.microsoft.com/en-us/library/windows/apps/jj635237.aspx
However this did not work, as Windows Phone 8 does not have Bing Maps, and does not listen to the old Bing Maps schema. I did try "nokiamaps:" but no luck :)
Additional Information
In Windows Phone 8 it's pretty trivial to launch another app if you know the URI scheme:
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh779672(v=win.10).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-4
If I could find documentation on their schema I'd be set!
TLDR
Can you solve the following problem: Fill in the empty string launchNokiaMaps to launch the Nokia Maps app.
private async void launch()
{
string launchNokiaMaps = "";
await Windows.System.Launcher.LaunchUriAsync(new Uri(launchNokiaMaps));
}
After investigation, I found the Uri:
private async void launch()
{
string launchNokiaMaps = "explore-maps://v1.0/?latlon=56.615495,12.1865081&zoom=5";
await Windows.System.Launcher.LaunchUriAsync(new Uri(launchNokiaMaps));
}
That will lauch the Nokia Maps app.
However you should be careful with that because Nokia Maps is not necessarily installed on Windows Phone 8 devices. For example, HTC devices come with the default "Maps" app.
So if you just want to open the default Maps app, you should use the MapsTask. That will work on every Windows Phone 8 device.
I couldn't find any information on if Nokia Drive subscribes to the new App2app protocols. However, the nokia based maps application has a task launcher that lets you do quite a bit. (Bing Map Task is depreciated)
MapsTask mapsTask = new MapsTask();
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206989(v=vs.105).aspx
I would suggest implementing your own map control using the Maps API and get full control over the user experience.
http://www.developer.nokia.com/Resources/Library/Lumia/#!guide-to-the-maps.html
http://www.developer.nokia.com/Community/Wiki/What%27s_new_in_Windows_Phone_8
Nokia have recently introduced a set of APIs specifically to launch HERE Maps on the device, as well as HERE Drive and HERE Transit.
The API documentation specifies the following use cases:
HERE Launchers are simple to use APIs which enable you to launch
HERE applications from your own Windows Phone application, to perform
services provided by those applications.
The API is compatible with Windows Phone 8 devices. Additionally the
API requires the HERE applications implementing the services being
present in the device. In case the API is used without the
implementing application being present in the device, then the user
will be forwarded to the Application store for obtaining the required
application.
Currently there are three HERE applications which are providing the
services implemented in the HERE launchers API: HERE Maps, HERE Drive,
and HERE Transit.
HERE Maps, Drive, and Public Transport are available worldwide on all
Nokia Lumia Phones, and they may be available for other Windows Phones
via Windows Phone store.
Code examples (covering use cases such as the one displayed below) can be found here.
In my blog I put some information that could be useful if you want to insert in your WP8 app the capability to start a navigation to a destination.
http://enzocontini.wordpress.com/2013/04/07/how-to-start-a-turn-by-turn-navigation-to-a-destination-from-your-windows-phone-app/
;-)
Enzo Contini
I would like to integrate a simple 'route to my store' using Google Maps MyLocation, for distribution through a mobile browser.
The perfect solution (from the end users viewpoint) would be - A plotted route from the Users GEO-Location, to a pre-configured POI (my store). That's it. I would like to avoid having the 'get directions' dialogue (it'll look squashy on a mobile device). Just a map with a start point, an end point and the route in between.
I'm not certain that this satisfies your goal of avoiding a "Get Directions" dialog, as it will certain involve an intermediate step by the user. But the dialog won't "look squashy" on a mobile device; indeed, it will be optimized for mobile viewing.
If you only plug in the daddr (destination address) coordinates to a map call, using the latitude and longitude of your store (or whatever location), Google Maps will try to set the start location to default to the user's "My Location" position if the device supports it, and otherwise will prompt the user to enter the start location. It will also allow the user to select which of the supported modes of transportation is desired (walk, bike, transit, or car).
This example plots the route from your location to the Martin Luther King, Jr. birth home in Atlanta:
https://maps.google.com/maps?daddr=33.755418,-84.371100
I tested this successfully on the following devices:
Windows 7 desktop using Chrome;
Windows 7 desktop using Firefox;
Windows 7 desktop using Internet Explorer;
Android phone with Jelly Bean OS using installed Google Maps app;
Android phone with Jelly Bean OS using the default browser;
Android phone with Jelly Bean OS using Chrome;
iPhone with iOS6 using the default browser.
Based on the consistency of the responses I got in those tests, I feel confident it would work in most, if not all, scenarios.
Here's my situation; I've built a very simple web app that looks up a users location and plots it on a Google map.
Here's my code: http://pastebin.com/d3a185efd
When I test it, my location is detected as being >= 500 meters from where I actually stand.
BUT
When I open up Google Maps or Gowalla my location is correct to within <20 meters?
So my question is: Do native iPhone apps benefit from a higher accuracy rate than web apps?
If so, why?
According to the specification, webapp geolocation should use whatever positioning method works best in any situation - so in theory, one would assume it uses GPS when available. The discussion linked in the "best answer" by rohit doesn't seem conclusive to me - here is another one, with someone reporting a similar problem to yours and other users professing to getting accurate gps data (scroll down to comments 26-28 Sept):
http://www.thecssninja.com/javascript/geolocation-iphone
But it does seem like the geolocation stuff is buggy still. I'd suspect your problem is basically that, some bug.
Based on the following link, I believe you are getting coordinates in web app through tower triangulation and not using GPS. I really doubt if GeoIP can give coordinates within 500 meters.
http://phonegap.lighthouseapp.com/projects/20116/tickets/16-navigatorgeolocation-does-not-make-use-of-gps-data
The geolocation API allows for a high accuracy parameter.
http://dev.w3.org/geo/api/spec-source.html#position_options_interface
(But uses extra battery, so probably best use sparsely)
Have you tested that?
Boolean: enableHighAccuracy
I think you are getting different results since you are overlooking the aspect of time. The GPS uses lots of battery and only starts up on command.
The HTML5 getCurrentPosition takes a snapshot of the coordinates before the GPS has had a chance to accurately 'zone in' on your position. The Google Maps app on the other hand starts and then watches your position, accuracy increasing over time (you all know how the marker moves). HTML5 also supports this feature of watching the position.
Side note! In my experience from the iPhone, the device will actually store your position for a little while, meaning that if I start up Google Maps and let it 'zone in' on my position, close it and THEN start my webapp and use getCurrentPosition I get an equally accurate reading.
Accuracy is all about letting the GPS do its thing..
I think that a webapp relies on a geoip service that (does its best to...) converts your IP address into a GPS coordinate.
ex: service ex
However such way to retrieve a coordinate cannot be as accurate as the "classic" one that uses a GPS device (such as the one included in the 3G or 3Gs iphone) to really retrieve your actual location and not approximate it at its best like a geoip service.
UPDATE: GEOIP is used when using google maps on a laptop for instance, but maybe your question was : "when I use the HTML 5 position object in my web page, does it comes from the GPS hardware or from a geoip service ?". This I couldn't really tell, I would say it uses geoip service instead of GPS hardware but I'm not 100% sure...
The code doesn't show where you get position from - are you using Navigator and Geolocation objects?
http://developer.apple.com/iphone/library/documentation/AppleApplications/Reference/SafariWebContent/GettingGeographicalLocations/GettingGeographicalLocations.html
for google geo api first it tries to find your location by device gps , if failed it goes cell triangulation (virtual gps) if failed it try to use to wifi mac and ip addresses , the last try is to use the client IP to get his location