Hi everyone,
Hopefully this is an easy one, I have been trying to import the bluno hello world example into Intel XDK. https://github.com/evothings/evothings- ... helloworld
I have been using the Evothings workbench successfully, however I usually develop my apps in the Intel XDK framework (which is cordova essentially). It has a nice build service interface and emulators I have become accustomed to, and handles cross building very well.
I have been able to import the example, along with the required resources folder. Everything looks OK visually (css appears to be OK), however I am having trouble loading / initialising with the easyble library.
The error I am getting when clicking the 'scan' button inside the application - Uncaught TypeError: Cannot read property 'stopScan' of undefined
I have imported the https://github.com/evothings/cordova-ble.git library into the XDK project.
Has anyone successfully imported any of these examples into the Intel XDK? I would be forever grateful if someone could steer me in the right direction in getting a very basic bluno app to run inside the Intel XDK.
if I can get it going, I am more than happy to share the source code for your examples library.
cheers
Got the examples working inside Intel XDK
Got the examples working inside Intel XDK
Last edited by cbc on 05:39, 01 Apr 2015, edited 2 times in total.
Re: Got the examples to work in Intel XDK
Well I have answered my own question, I will post my findings so it of use to anyone else using the Intel XDK for app development.
In short, the examples work perfectly fine in the Intel XDK with one caveat. The device emulator, along with device app preview do not pull in third party plugins, so the only way to test the apps is to actually build it and install on the device.
So to get any of the examples running in Intel XDK, do the following (assumes a windows development environment):
Software prerequisites
Download and install Ruby for windows if you haven't already, http://rubyinstaller.org/downloads/ (ensure "Add to PATH" option is checked when installing)
Download and install Intel XDK https://software.intel.com/en-us/html5/tools
Build the examples libary
Download the example library from https://github.com/evothings/evothings-examples
From a command line, cd into the evothings-examples-master folder and run build.rb, this ruby script will copy assets to the correct locations in the examples
Setup the project in Intel XDK
From Intel XDK >> Projects >> Start a new project >> Import your HTML5 code base with the following settings:
Select the example folder you want within evothings-examples-master/examples
Give the project a name and use the following settings when prompted
www folder = app
Cordova hybrid app project = yes
Game Project = No
From Intel XDK >> Projects >> Build settings, set Cordova CLI version to 3.7.0 for all device platforms, select "update" if prompted
Setup standard cordova plugins inside Intel XDK
From Intel XDK >> Projects >> Plugins
Select all Standard Cordova plugins
Setup third party cordova plugins inside Intel XDK
We need two third party plugins to make this work
From Intel XDK >> Projects >> Plugins >> Third party plugins >> get plugin from web
Name = cordova-ble
Plugin ID = com.evothings.ble
Repo URL = https://github.com/evothings/cordova-ble.git
Name = megster-bt-serial
Plugin ID = com.megster.cordova.bluetoothserial
Repo URL = https://github.com/don/BluetoothSerial.git
Test and build
Build the project using the Intel XDK >> build tab for iOS or Android - details out of scope for this post
Install the application onto the target device
Third party plugins are not supported via the Intel XDK emulate or test tabs, or via Intel App Preview on the device. The only way to test the app is to build it, and install the native app on the target device.
Hope this helps anyone..
In short, the examples work perfectly fine in the Intel XDK with one caveat. The device emulator, along with device app preview do not pull in third party plugins, so the only way to test the apps is to actually build it and install on the device.
So to get any of the examples running in Intel XDK, do the following (assumes a windows development environment):
Software prerequisites
Download and install Ruby for windows if you haven't already, http://rubyinstaller.org/downloads/ (ensure "Add to PATH" option is checked when installing)
Download and install Intel XDK https://software.intel.com/en-us/html5/tools
Build the examples libary
Download the example library from https://github.com/evothings/evothings-examples
From a command line, cd into the evothings-examples-master folder and run build.rb, this ruby script will copy assets to the correct locations in the examples
Setup the project in Intel XDK
From Intel XDK >> Projects >> Start a new project >> Import your HTML5 code base with the following settings:
Select the example folder you want within evothings-examples-master/examples
Give the project a name and use the following settings when prompted
www folder = app
Cordova hybrid app project = yes
Game Project = No
From Intel XDK >> Projects >> Build settings, set Cordova CLI version to 3.7.0 for all device platforms, select "update" if prompted
Setup standard cordova plugins inside Intel XDK
From Intel XDK >> Projects >> Plugins
Select all Standard Cordova plugins
Setup third party cordova plugins inside Intel XDK
We need two third party plugins to make this work
From Intel XDK >> Projects >> Plugins >> Third party plugins >> get plugin from web
Name = cordova-ble
Plugin ID = com.evothings.ble
Repo URL = https://github.com/evothings/cordova-ble.git
Name = megster-bt-serial
Plugin ID = com.megster.cordova.bluetoothserial
Repo URL = https://github.com/don/BluetoothSerial.git
Test and build
Build the project using the Intel XDK >> build tab for iOS or Android - details out of scope for this post
Install the application onto the target device
Third party plugins are not supported via the Intel XDK emulate or test tabs, or via Intel App Preview on the device. The only way to test the app is to build it, and install the native app on the target device.
Hope this helps anyone..
Re: Got the examples working inside Intel XDK
Third party plugins are not supported via the Intel XDK emulate or test tabs, or via Intel App Preview on the device. The only way to test the app is to build it, and install the native app on the target device.
this makes sense - great that you figured it out.
it definitely is an issue to try to interact with native functionality (such as BLE) withing a simulator/emulator. you definitely need to build and deploy onto a real device for this functionality to work.
Re: Got the examples working inside Intel XDK
I have been trying to follow these instructions without success.
I am using Cordova CLI 4.1.2 and XDK refuses to build with versions 3.7.0 (and also 3.5 and 3.5.1).
I also had to set www folder to empty (instead of app) or the sample would not build.
Does anyone have a sample XDK project that works?
I am using Cordova CLI 4.1.2 and XDK refuses to build with versions 3.7.0 (and also 3.5 and 3.5.1).
I also had to set www folder to empty (instead of app) or the sample would not build.
Does anyone have a sample XDK project that works?
Re: Got the examples working inside Intel XDK
hello I am trying to create an APP with the XDK to print in the Bluetooth Printer
I tried to follow the above procedures without success
anyone have any project to provide ?
I tried to follow the above procedures without success
anyone have any project to provide ?
Return to “Questions and answers”
Who is online
Users browsing this forum: No registered users and 25 guests