Comments (17)
I don't have any control over which GPS points get sent back via the Native API's. GPS inaccuracies can be caused by a bunch of different things, including your location.
Can you elaborate on what you mean by "track isnt smooth".
What platform are you using (Android / iOS) ?
What are the accuracy readings that you get back in the location passed back through the location update callback?
from cordova-background-geolocation-services.
Hi, below is a screenshot of my previous tracking. I think you see whats going on. (I was driving accross the "yellow" road (Hodoninska) towards the blue marker, and this is how my route got tracked.
Tested on Android (on more devices with same, or similar unaccurate results).
Accuracy readings coming in a while.
from cordova-background-geolocation-services.
If its device agnostic I'd like to say its probably that your hitting an area with bad GPS, but the accuracy readings will tell us if its the plugins problem or the GPS's problem.
from cordova-background-geolocation-services.
Accuracy: unfortunately, I didn't store accuracy in this tracking. But currently, while moving around the building, I'm getting various numbers from 5 to 95. Maybe I should give it a try once again, and make a few kilometer driving to check it. I'm in a location with standard GPS signal, other applications are tracking my movement well.
from cordova-background-geolocation-services.
OK, I made a test drive around a block, which gave me a bit better (but still not accurate) results, and the accuracy was like 6 (average). The highest number I received was 109.43, lowest was 5.
from cordova-background-geolocation-services.
The other applications your using might also be throwing away GPS positions with low accuracy (higher accuracy numbers mean less accurate). If you get coordinates back over 70 accuracy I would throw them away.
On android especially, the coordinates you get passed back are out of my hands, that is up to the device and android Location libraries, the configuration you have is the most accurate you can go on android.
The most important being :
desiredAccuracy: 0
Which translates to give me the most accurate results and put all the power you can into the GPS.
from cordova-background-geolocation-services.
Yes, that's good idea to throw the inaccurate coordinates away. I'll try this right away and post you the results.
from cordova-background-geolocation-services.
OK, I was able to get better results, by some tweaking of result coordinates data set. I'm not displaying inaccurate results, and moreover, I'm checking the distance between two adjacent coordinates. If they're too far away, I will not display the second one.
Haven't you thought about implementing "Location.distanceBetween()" inside the plugin?
(you'll not send coordinate, which is too far away from the previous one).
from cordova-background-geolocation-services.
I'm glad you were able to get better results!
There isn't really a reason to implement that in the native code since you can do so just as easily via JavaScript and everyone has different requirements from the plugin. I want to leave the plugin as open and broad as possible.
I would implement it if there was a good enough reason of why it couldn't / would be harder to do via JavaScript.
from cordova-background-geolocation-services.
Hi pmwisdom and Stepo45 , I have the same problem when tracking, specially with android. Stepo45 can you show how you are checking the distance between two adjacent coordinates?
The program that I am developing is Cordova base and it should support all the functionality same for both iOS and Android.
With iOS sometimes is it good and sometimes it is not working good. I have attached the same track with different result on iOS. here is my configure:
desiredAccuracy: 0, distanceFilter: 3, debug: true, interval: 1000, fastestInterval: 1000, useActivityDetection: true
from cordova-background-geolocation-services.
@sepideh68 Its very simple. You can use the formula in this stack overflow.
from cordova-background-geolocation-services.
@pmwisdom I am receiving almost accurate coordinates on iOS but it is not working on android.
Is it because of config I am using?! If so why it is working good on iOS?! I am developing my app with ionic. here is the code I have put on ionic.Platform.ready function:
ionic.Platform.ready(function(){
cordova.plugins.backgroundMode.enable();
cordova.plugins.backgroundMode.onactivate = function () {
bgLocationServices.start();
$scope.isBackground = true;
}
cordova.plugins.backgroundMode.ondeactivate = function () {
bgLocationServices.stop();
$scope.isBackground = false;
}
navigator.geolocation.getCurrentPosition(function(p){}); // it is required
bgLocationServices = window.plugins.backgroundLocationServices;
//Congfigure Plugin
bgLocationServices.configure({
//Both
desiredAccuracy: 0,
distanceFilter: 0,
debug: false,
interval: 2000,
fastestInterval: 1000,
useActivityDetection: false,
notificationTitle: '', // customize the title of the notification
notificationText: '', //customize the text of the notification
});
bgLocationServices.registerForLocationUpdates(function(location) {
if($scope.started){
var position = encapsulateLocation(location);
showPosition2(position);
}
}
from cordova-background-geolocation-services.
@sepideh68 Please fix your styling and be more specific. Show me some coordinates on android vs iOS.
Also why are you using the cordova backgroundMode plugin? It might be unwise to do so with this plugin since it starts another service in the background.
from cordova-background-geolocation-services.
@pmwisdom I am using cordova backgroundMode plugin to enable tracking when background is activate and user started the geolocation. Does it have conflict with your plugin?! BTW I want to collect Gyro and Accelerometer data even if user is on backgroundMode. Here is the result of same route:
from cordova-background-geolocation-services.
@sepideh68 My plugin has the effect of keeping your app alive for however long you are tracking with it, so you don't need the background mode plugin. I don't know if its causing conflict but I would remove it.
Also, try starting the background plugin before you transition to the background, and before the will resign callback.
from cordova-background-geolocation-services.
@pmwisdom
Because ios does not compile the app when I add the plugin to work?
help me.. @sepideh68
from cordova-background-geolocation-services.
@srsarcasmo This is a completely unrelated issue. Please do not spam the other issues.
from cordova-background-geolocation-services.
Related Issues (20)
- IOS 11 turning off the accelorometer seems to do nothing
- Uncaught TypeError: Cannot read property 'backgroundLocationServices' of undefined
- Can't install plugin HOT 1
- Couple Questions
- Very bad accuracy on Android?
- Phonegap Build error Android
- Cordova Build Error
- Android app was closed HOT 1
- SWIFT 3 not supported anymore by Apple HOT 2
- [email protected] getting crashed while start the service HOT 1
- Plugin put app in background
- How to authorize background geolocation on the phone ? HOT 1
- Error on install plugin ionic 3 project HOT 2
- Frequency of updates HOT 5
- [HELP] Cannot read property 'backgroundLocationServices' of undefined HOT 1
- Request to include accelerometer and compass information
- Different intervals between iOS and Android devices HOT 2
- Doesn't work on Android 8 (Oreo) HOT 5
- Send geolocation data to backend
- Android 6.0.1: Plugin not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-background-geolocation-services.