Software Archive
Read-only legacy content
17061 Discussions

Cordova API vs Intel XDK API

Михаил_К_
Beginner
653 Views

What different in Cordova API and Intel XDK API?

I want use geolocation, what do i should use: geolocation.getCurrentPosition or intel.xdk.geolocation.getCurrentPosition?

0 Kudos
9 Replies
John_H_Intel2
Employee
653 Views

You should stick to the cordova api's. The intel.xdk api are older and not as maintained as the cordova api's.

0 Kudos
Михаил_К_
Beginner
653 Views

Thanks for answer!

I tried to change intel.xdk.geolocation.getCurrentPosition to navigator.geolocation.getCurrentPosition and Intel XDK Emulator GeoLocation not work more:

PositionError {message: "Timeout expired", code: 3, PERMISSION_DENIED: 1, POSITION_UNAVAILABLE: 2, TIMEOUT: 3}

Can I fix this?

0 Kudos
John_H_Intel2
Employee
653 Views

Did you update which plugins you are using in the project settings? You can do so under the Projects tab in the xdk. 

0 Kudos
Михаил_К_
Beginner
653 Views

I open Plugins section in Projects tab. Standart Cordova Plugins - Geolocation 0.3.11 selected.Снимок экрана от 2015-06-03 10:32:50.png

0 Kudos
John_H_Intel2
Employee
653 Views

See the demo that we provide on geolocation. Start a new project, Samples and Demos, HTML5 + Cordova, Geolocation.

0 Kudos
Михаил_К_
Beginner
653 Views

I tried and got the same:

 

Снимок экрана от 2015-06-03 17:28:05.png

0 Kudos
John_H_Intel2
Employee
653 Views

Works for me :) Are you connected to the internet? 

Does it work on device for you?

Could your firewall be blocking the XDK from connecting to the internet?

0 Kudos
khin_sin_c_
Beginner
653 Views

try to run app on the actual device instead of in the emulator. i can get the location once deploy to actual device.

0 Kudos
PaulF_IntelCorp
Employee
653 Views

The Emulate tab and the geo API is kind of tricky if you set it to use an Android device. It is easier to play with if you tell the Emulate tab to use an iOS device. It has to do with the way the Emulate tab interprets the geo JS files for Android. It will work better on a real device.

0 Kudos
Reply