This is a migrated thread and some comments may be shown as answers.

device undefined

3 Answers 46 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 14 Apr 2014, 09:01 AM
I'm trying to access the "device" object of PhoneGap to get the device name, version etc but I keep getting "Cannot read property 'name' of undefined".
Seems like "device" is undefined?
I used the example code from http://docs.phonegap.com/en/1.5.0/phonegap_device_device.md.html

var phoneName = device.name;

I can see that in the project the Device plugin is enabled.

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 15 Apr 2014, 06:23 AM
Hi Erik,

The problem that you are having is not directly related to Kendo UI, but to the PhoneGap tool that you are using. As a component framework Kendo UI does not have control over device's hardware and handling the PhoneGap API. I would suggest you to check in their documentation and forums if some more information about this particular issue is available, as we are not able to provide you with any assistance on this.

In case you have any Kendo UI related questions, please do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Erik
Top achievements
Rank 1
answered on 16 Apr 2014, 06:05 PM
Seems like the problem was that I was trying to access it before the ondeviceready event.
Now it works.
0
Kiril Nikolov
Telerik team
answered on 17 Apr 2014, 10:26 AM
Hello Erik,

I am glad you found the solution for this issue.

In case you have any Kendo UI specific questions, please do not hesitate to contact us

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Erik
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Erik
Top achievements
Rank 1
Share this question
or