Software Archive
Read-only legacy content
17061 ディスカッション

Cordova API vs Intel XDK API

Михаил_К_
ビギナー
1,176件の閲覧回数

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 件の賞賛
9 返答(返信)
John_H_Intel2
従業員
1,176件の閲覧回数

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

Михаил_К_
ビギナー
1,176件の閲覧回数

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?

John_H_Intel2
従業員
1,176件の閲覧回数

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

Михаил_К_
ビギナー
1,176件の閲覧回数

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

John_H_Intel2
従業員
1,176件の閲覧回数

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

Михаил_К_
ビギナー
1,176件の閲覧回数

I tried and got the same:

 

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

John_H_Intel2
従業員
1,176件の閲覧回数

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?

khin_sin_c_
ビギナー
1,176件の閲覧回数

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

PaulF_IntelCorp
従業員
1,176件の閲覧回数

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.

返信