- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am developing a communication between an Android smartphone and a wifi unit (ESP8266) with tcp sockets. I have already done successfully with a Windows PC.
I created an HTML5 + Cordova project with the XDK environment.
I used the "Third-Party Add-Plugin" and imported "org.chromium.sockets.tcp", with "Plugin is Located in the Apache Cordova Plugins Registry".
My code:
/* button Create socket */ $(document).on("click", ".uib_w_1", function(evt) { /* your code goes here */ alert ("Creation sockets"); chrome.sockets.tcp.create ({}, function (createInfo) {chrome.sockets.tcp.connect(createInfo.socketld,"192.168.4.1",1336,onConnected); } ); // fin de code Create sockets });
In debug I get the following message:
"Uncaught ReferenceError: chrome is not defined index_user_scripts.js:18(anonymous function) index_user_scripts.js:18(anonymous function) appframework.js:2552proxyfn appframework.js:2377touchLayer.fireEvent appframework.ui.js:3415touchLayer.onTouchEnd appframework.ui.js:3358touchLayer.handleEvent"
Apparently XDK reaches not to import the Chrome plugin .
Can anyone help me?
Thanks for your help.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please refer these links which might solve your problem.
I believe you need to change the order of .JS files under script tag.
https://software.intel.com/en-us/forums/intel-xdk/topic/555056
http://stackoverflow.com/questions/2075337/uncaught-referenceerror-is-not-defined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the answer, but after search, it appears that XDK does not support modes "Debug" and "Test" in the case of thrid party plugin, only the "Build" mode is possible.
With "Build" it runs fine, but the development cycle has a little long time. Each time we have to build application, donwload, install it and test on the smartphone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try using the EA release, it supports the use of third-party plugins with the Debug tab. Our next major release of the XDK will also support the use of third-party plugins with the Debug tab, in a few weeks.
BTW - the latest version available in the git repo is labeled 1.3.4, which is more recent than what you are getting from the plugin registry. For those CCA plugins you're probably better off getting them straight from the repo, because that project has gone quiet. To do that with the current release of the XDK you can specify the plugin as being located in a git repo and naming it like this:
https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-tcp.git#1.3.4
And since the forum is probably going to clip what I just wrote, above, because it wants to turn it into a link, I'll repeat it, below, with spaces that you need to remove to turn it into the complete URL that you need to provide to the XDK:
https: // github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-tcp.git # 1.3.4
(remove the spaces in the line above)
See the main readme for that project: https://github.com/MobileChromeApps/mobile-chrome-apps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the "EA release" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page