Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

Geolocation plugin problem

In your "Building a GPS tracking app" tutorial you say "Because this is a native app (with PhoneGap), the app will continue tracking the location even if in the background or with the phone screen locked." Unfortunately this only works for a relatively short time until the OS stops the background app. I need to have continuous tracking so have investigated plugins and have found this:-
https://github.com/christocracy/cordo...

The test app builds OK but this :-

var bgGeo = window.plugins.BackgroundGeoLocation;

always returns 'undefined' This is on the device (Android)
I understand that third party code is outside the scope of your support but would be grateful if you could check to see if I have installed the plugin correctly. I have shared the app (geoPluginTest). Thanks in advance!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation plugin problem

Hi Kevin,

We'll check this.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation plugin problem

Hi Kevin,

1) In file config.xml replace:precom.phonegap.plugins.BackgroundGeoLocation.BackgroundGeoLocation/preWith:precom.phonegap.plugins.BackgroundGeoLocation/pre
2) In BackgroundGpsPlugin.java replace:prepackage com.tenforwardconsulting.cordova.bgloc;/preWith:prepackage com.phonegap.plugins.BackgroundGeoLocation;/pre

Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

Geolocation plugin problem

Katya,
Thank you for your response, I tried this before and have done so again but unfortunately it still doesn't work. Replacing the files as you suggest results in a build error because of
codepackage com.tenforwardconsulting.cordova.bgloc;/code
in
LocationUpdateService.java
If I replace
codepackage com.tenforwardconsulting.cordova.bgloc;/code
with
codepackage com.phonegap.plugins.BackgroundGeoLocation;/code
then it will build again but I still get undefined here
codevar bgGeo = window.plugins.BackgroundGeoLocation; /code
Kevin

Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

Geolocation plugin problem

Is there any way that support can install this plugin in a simple app (doesn't have to do anything just get over the undefined problem)

https://github.com/christocracy/cordo...

and share it with me so that I can see how it should be done? I have wasted a lot of time because of the error in your "Building a GPS tracking app" tutorial and am now under pressure to find a solution to background tracking so I can finish my app. The installation of plugins seems to cause problems for many people and I would have thought that proper background tracking would also be of interest to other developers.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation plugin problem

Hi Kevin,

All .java files should be in the same packet, that is why you should specify the name from App settings in all custom files. For example, in this format: io.appery.project190713.

Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

Geolocation plugin problem

I am sorry Katya but I do not understand what you mean.
It would save a lot of time, yours as well as mine, if you could just install the plugin
( https://github.com/christocracy/cordo... )
on a shared test app so that I can see how it should be done, it should take less than 10 minutes.
The ability to use plugins is an important one and I would have thought that the whole point of Appery is that it hides the complexity of this, if plugins can't be added automatically then at least there should be clear detailed and complete instructions on how to do it.
As I said before I am not asking for support on the plugin itself, just how to add it so that the app builds and the plugin doesn't return undefined. I have shared geoPluginTest2 as a completely new app.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation plugin problem

Hi Kevin,

After adding plug-in http://devcenter.appery.io/documentat... it will work only for native app. Just add JS and Java files and make changes to config.xml.

Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

Geolocation plugin problem

I am disappointed with your response, I know that it will only work for a native app and repeatedly saying to follow the tutorial (which is incomplete as evidenced by responses in other threads ) is no help at all. I have followed the tutorial as modified by the other responses numerous times without success. I am perfectly happy to accept that I may be doing something wrong but need help to find out what. If I was an expert in phonegap/cordova I wouldn't be using Appery in the first place.
I repeat I do not want help with the actual plugin ONLY ON HOW TO INSTALL A REAL WORLD EXAMPLE rather than your simplistic beep example.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation plugin problem

Hello Kevin,

I'm sorry that you cannot handle this. The advised tutorial works properly for me.

As you know 3rd party PhoneGap plugins fall outside the scope of our support unfortunately.

However, we checked your application and didn't see the plug-in there... It is geoPluginTest2, right?

Return to “Issues”