Current location in codenameone is null - location

I use the following code to take current location of mobile in codename
Location location = LocationManager.getLocationManager()
.getCurrentLocationSync(60000);
And i test it on Android mobile it always show location is null
Also in simulator it gives
latitude 40.715353
longitude -74.00497299999999
How to solve this problem and get current gps position of mobile?

The simulator has the ability to simulate locations in the latest version you can point at the location you want to simulate.
Null will be returned if a location isn't available, you can query the status of the GPS based on that. Make sure your GPS is turned on.

Related

Geolocator.RequestAccessAsync() taking too much time for returning its value in UWP with xamarin.forms

Initially Allow Apps to access location and my app's access precise location is off in my windows machine. I opened my app and GPS is unavailable. I enabled both Allow Apps to access location and my app's access precise location. after that, I tap the location icon and it will trigger Geolocator.RequestAccessAsync() to check GPS-enabled via dependency service. Geolocator.RequestAccessAsync() taking too much time for returning its value in UWP with Xamarin.Forms. Need to reduce the time or better alternatives with lesser timing in UWP for Xamarin.Forms.
var accessStatus = await Geolocator.RequestAccessAsync();

How to get current location in Xamarin.Forms.Maps?

I need to get the current location map and need to pin the current coordinates. Users will pin the coordinates. When the users pin the coordinates, the data is stored in the database.
I am using VS 2015 /.Net 4.5 Framework - I have to get this application on cross platform - Android / iOS / Windows. Samples which I can refer online such as MKMapView aren't supported on .Net 4.5 Framework.
How to get the current location map and how to pin the current coordinates.
Refer
How to get current location or move to current location in Xamarin.Forms.Map
OR
http://www.informit.com/articles/article.aspx?p=2422805

Does the xcode simulator strip gps coordinates from image meta data?

I'm extracting GPS coordinates from image meta data. A picture that has GPS coordinates, verified using the Finder's Get Info function, when added to the simulator it seems the GPS coordinates are no longer present.
I can't be sure I actually found the image on disk as finding albums is tricky, but I think I found it and Finder doesn't display the coordinates. Yet when I run my app on the phone it does find GPS coordinates.
So that means to me the xcode simulator strips GPS meta data, though I couldn't find confirmation. Does this sound right?
For xcode Version 6.1.1 (6A2008a).
Yes. The same thing happens to me with photos with confirmed latitude/longitude on my device and desktop.
Makes it VERY difficult to create screenshots and videos demonstrating location services for the App Store for all the devices I do not own.

Genymotion GPS is not getting my current position

As the title says, my genymotion is getting the static position declared in the gps options. Theres another option that I could get my current position? Im using cordova application testing with genymotion.
Genymotion does not plug the GPS position to your computer's position.
If you want to customize your position you can do it on several ways:
Use the GPS Widget (free feature) located on the right bar of the device. You can either set manually GPS data or use the Map view to do it easily
Use the Genyshell (free feature) to script the positions injection.
Use the Java API (paid feature). By including the JAR of this feature you can control the GPS and other device sensors. This feature is very useful to improve code coverage, for unit testing for example.
I was using cordova geolocation plugin.
navigator.geolocation.getCurrentPosition(onSuccess,onError,options);
And I was also facing the same problem, It wasn't working in genymotion. Setting enableHighAccuracy to true worked for me like below.
var options = {
enableHighAccuracy: true,
maximumAge: 0
};
For programming, you could give fake position by using any app. For instance you might use Fake GPS location to give static GPS position.

Wp7 source of location data

It's possible to get the source of the location data (for example GPS receiver, WI-FI or cellular radio) in windows phone 7 ?
If so, how do I do it?
Thank you.
This isn't available to the developer as it is done at Windows Phone OS level
GeoCoordinateWatcher
However specifying the property "DesiredAccuracy" to high will use the GPS receiver - But will use more battery power!
setting it at "Default" will use WiFi or Cell Phone towers to give a much less accurate fix on your location but will be better on battery

Resources