Quantcast
Channel: Intel Developer Zone Articles
Viewing all 3384 articles
Browse latest View live

Intel® Advisor XE 2016 Update 4 - What’s new

$
0
0

Intel® Advisor XE 2016 Update 4 - What’s new

 

We’re pleased to announce new version of the Vectorization Assistant tool - Intel® Advisor XE 2016 Update 4.

Below are highlights of the new functionality in Intel Advisor 2016 Update 4.

Full support for all analysis types on the second generation Intel® Xeon Phi processor (code named Knights Landing)

FLOPS and mask utilization

Tech Preview feature! Accurate hardware independent FLOPS measurement tool. (AVX512 only) Mask aware . Unique capability to correlate FLOPS with performance data.

Workflow

Batch mode, which lets you to automate collecting multiple analysis types at once.  You can collect Survey and Trip Counts in single run – Advisor will run the application twice, but automatically, without user actions. For Memory Access Patterns (MAP) and Dependencies analyses, there are pre-defined auto-selection criterias, e.g. check Dependencies only for loops with “Assumed dependencies” issue.

Improved MPI workflow allows you to create snapshots for MPI results, so you can collect data in CLI and transfer self-contained packed result to a workstation with GUI for analysis. We also fixed some GUI and CLI interoperability issues.

 

Memory Access Patterns

MAP analysis now detects Gather instruction usage, unveiling more complex access patterns. A SIMD loop with Gather instructions will work faster than scalar one, but slower, than SIMD loop without Gather operations.  If a loop has “Gather stride” category, check new “Details” tab in Refinement report for information about strides and mask shape for the gather operation. One of possible solutions is to inform compiler about your data access patterns via OpenMP 4.x options – for cases, when gather instructions are not necessary actually.

For AVX512 MAP analysis also detects Gather/scatter instruction usage, these instructions allow more code to vectorize but you can obtain greater performance by avoiding these types of instructions.

MAP report in enriched with Memory Footprint metric – distance in address ranges touched by given instruction. The value represents maximal footprint across all loop instances.

 

Variable name is now reported for memory accesses, in addition to source line and assembly instruction. Therefore, you have more accuracy in determining the data structure of interest. Advisor can detect global, static, stack and heap-allocated variables.

We added new recommendation to use SDLT for loops with an “Ineffective memory access” issue.

 

Survey and Loop Analytics

Loop Analytics tab has got trip counts and extended instruction mix, so you can see compute vs memory instruction distribution, scalar vs vector, ISA details, etc.

We have improved usability of non-Executed code paths analysis, so that you can see ISA and traits in the virtual loops and sort and find AVX512 code paths more easily.

 

Loops with vector intrinsics are exposed as vectorized in the Survey grid now.

 

Get Intel Advisor and more information

Visit the product site, where you can find videos and tutorials. .


Webcast: Parallel computing on Intel® Architecture

$
0
0

Regulatory pressures, which increase the amount of required computing, the need to improve operational efficiency and competition, which require faster computing,  are among the drivers that incent financial institutions to pursue significant improvements in computational efficiencies. As improvement in sequential computing slowed down, the adoption of parallel computing is growing noticeably.

Until recently, CPUs where thought of as engines for sequential computing. They improved performance through increased frequencies and architectural techniques such as out of order execution. By contrast, parallel computing was thought of as needing acceleration, and offloading onto a different compute engine. Contrast that thinking with modern day CPUs, where servers such as Intel® Xeon® based servers offer as many as 56 cores with Intel® Advanced Vector Extensions technology, while still providing high per-core performance via out of order execution, and the conclusion is that a CPU is a forceful platform for parallel computing. The presentation will provide data on the growth of parallelism in hardware, data on how that growth impacts performance of parallelized financial algorithms such as Binomial Option, Monte Carlo and LIBOR. These applications see speed-ups of up to 200X on a Intel® Xeon® based server, between their sequential and a parallel versions. Finally, the presentation will describe best practices in transitioning these algorithms to parallel computing.

Presenter: Robert Geva (Intel)

View Webcast (may require registration)

Download Presentation (PDF):  Downloadapplication/pdfDownload

 

 

Cordova Whitelisting with Intel® XDK for AJAX and Launching External Apps

$
0
0

Cordova CLI 5.1.1 and Higher

Starting with Apache* Cordova* CLI 5.1, the whitelisting security model that restricts and permits access to other domains from the app has changed. It is recommended that before you move your app to production you should provide a whitelist of the domains that you want your app to have access to.

Android 

Starting with Cordova Android 4.0, your Android app's security policy is managed through a Whitelist Plugin and standard W3C Content Security Policy (CSP) directives. The Android Cordova whitelist plugin understands three distinct whitelist tags:

  1. <access> tag for Network Requests
  2. <allow-intent> tag for Intent Requets
  3. <allow-navigation> for Navigation

CSP directives are set by including a meta-tag in the <head> section of your index.html file. An Introduction to Content Security Policy is a good place to go to understand how to configure and apply these whitelist rules to your app. The CSP Playground is also a very useful site for learning about CSP and validating your CSP rules.

iOS

Unlike Android, your Cordova iOS app's whitelist security policy is managed directly by the cordova-ios framework. Cordova iOS versions prior to 4.0 used only the W3C Widget Access specification for domain whitelisting (i.e., the <access> tag). Starting with Cordova iOS 4.0, your Cordova iOS app's whitelist uses the <access> tag, as before, and adds support for two additional tags: <allow-intent> and <allow-navigation> as described in the Whitelist Plugin.

Starting with iOS 9, a scheme called Application Transport Security (ATS) is used to implement whitelist rules. Cordova automatically converts your <access> and <allow-navigation> tags to their equivalent ATS directives. When used with iOS apps, the <access> and <allow-navigation> tags support two new attributes for extra security for a domain whose security attributes you have control over. They have their equivalents in ATS:

  1. minimum-tls-version
  2. requires-forward-secrecy

See the ATS Technote for more details.

Windows

On Windows platforms, Cordova continues to use the W3C Widget Access specification to enforce domain whitelisting, which is built into the Cordova Windows framework.

See the following section for information regarding CSP directives and the Windows platforms.

Content Security Policy (CSP)

CSP is managed by the webview runtime (the builtin web runtime on which your Cordova app executes). Network requests include such actions as retrieving images from a remote server, performing AJAX requests (XHR), etc. CSP controls are specified in a single meta tag in your html files. Most Cordova apps are single-page apps, meaning they have only a single index.html file. If your app contains multiple html files, it is recommended that you use CSP <meta> tag on all of your pages.

Android version 4.4 (KitKat) and above supports the use of CSP (the Android 4.4 native webview is based on Chromium 30). If you are using the Android Crosswalk webview, CSP is supported on Android version 4.0 (Ice Cream Sandwich) and later (the Crosswalk webviews are also based on Chromium).

Apple iOS 7.1 and later supports the use of CSP directives (Apple iOS devices run on the Safari webview).

Windows Phone 8.x devices provide partial support via the X-Content-Security-Policy directive (Windows Phone 8.x devices run on the IE10 and IE11 mobile webviews). Windows 10 devices include full support for standard CSP directives (Windows Phone 10 and Windows 10 tablets run on the Edge webview).

It is recommended that you use CSP whenever possible!!

To get started with CSP, you can include the following overly permissive directive in the <head> section of your index.html file:

<meta http-equiv="Content-Security-Policy" content="default-src 'self''unsafe-eval'data: blob: filesystem: ws: gap: cdvfile: https://ssl.gstatic.com *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline''unsafe-eval'; img-src * data: 'unsafe-inline'; connect-src * 'unsafe-inline'; child-src *;">

There is no single CSP directive that can be recommended for all applications. The correct CSP directive is the one that provides the access you need while simultaneously insuring the protection necessary to keep your app from being compromised and exposing customer or user data.

This StackOverflow post is very helpful to read as an introduction to how Content Security Policy rules work.

Intel XDK 3088 and Higher

Starting with Intel XDK version 3088, the UI provided to specify whitelist entries has changed to accommodate changes in Cordova whitelist rules. Please read the rest of this document to understand how to specify whitelist entries in the Intel XDK.

Network Request Whitelist (<access>):

Network Request controls which network requests, such as content fetching or AJAX (XHR), are allowed to be made from within the app. For those webviews that support CSP, it is recommended that you use CSP. This whitelist entry is intended for older webviews that do not support CSP.

These whitelist specifications are defined in a Cordova CLI config.xml file using the <access origin> tag. Within the Intel XDK UI you specify your URLs in the Build Settings section of the Projects tab. For example, to specify http://mywebsite.com as a whitelisted URL:

Networkwhitelist5.4.1

By default, only requests to file:// URLs are allowed, but Cordova applications by default include access to all website. It is recommended that you provide your whitelist before publishing your app.

Intent Whitelist (<allow-intent>):

The intent whitelist controls which URLs the app is allowed to ask the system (ie., the webview) to open. By default, no external URLs are allowed. This applies to inline hyperlinks and calls to the window.open() function (note, if you are using the inAppBrowser it may change the behavior of window.open(), especially regarding whitelist rules). You app can open "hyperlinks" like a browser (for http:// and https:// URLs) and can "open" other apps via hyperlinks, such as the phone, sms, email, maps etc. 

To allow your app to launch external apps through a URL or via window.open(), specify your rules in the Build Settings section of the Projects tab. 

Navigation Whitelist (<allow-navigation>):

The navigation whitelist rules control which URLs the application webview can be navigated to. Only top level navigations are allowed, with the exception of Android, where it also applies to iframes for non-http(s) schemes. By default, you can only navigate to file:// URLs.

Additional Whitelist Settings for iOS ATS:

The UI whitelist settings for iOS are similar to those described above, with the addition of an ATS setting. When you click the "Edit ATS settings" link you can specify ATS settings for the Network Request and Navigation whitelist rules on your iOS 9 device. ATS settings do not apply to iOS 8 and earlier devices.

Most users should not have to change the ATS settings and can use the default values. For more details about ATS you can read this tutsplus.com article or search the web for additional articles.

The ATS settings dialog looks like this:

Windows Platform Whitelist Rules:

Windows platforms use the W3C Widget Access for whitelisting (that is, the <access> tag). Windows 10 also supports the <allow-navigation> tag. The rules for those tags are consistent with those described above. The Windows platforms also support CSP whitelist rules, which were described in the CSP section above.

Intel XDK versions prior to 3088:

Navigation Whitelist :

Navigation Whitelist controls which URLs the WebView can be navigated to. (Only top level navigations are allowed, with the exception,for Android it applies to iFrames also for non-http(s) schemes.) By default, you can only navigate to file:// URLs. To allow other URLS,  <allow-navigation> tag is used in config.xml file. With the Intel® XDK you need not specify this in config.xml, the Intel XDK automatically generates config.xml from the Build settings.

In the Intel® XDK you specify the URL that you would like the WebView to be navigated to under Build Settings > Android > Cordova CLI 5.1.1 > Whitelist > Cordova Whitelist > Navigation. For example : http://google.com

CLI5.1.1AndroidNavigation.png

Intent Whitelist:

Intent Whitelist controls which URLs the app is allowed to ask the system to open. By default, no external URLs are allowed. This applies to only hyperlinks and calls to window.open(). App can open a browser (for http:// and https”// URLs)  or other apps like phone, sms, email, maps etc. To allow app to launch external apps through URL or launch inAppBrowser through window.open(), <allow-intent> tag is used in config.xml, but again you need not specify this in config.xml, the Intel® XDK takes care of it through Build settings. 

In the Intel® XDK specify the URL you want to whitelist for external applications under Build Settings > Android > Cordova CLI  5.1.1 > Whitelist > Cordova Whitelist > Intent. For example http://example.com or tel:* or sms:*

CLI5.1.1AndroidIntent.png

Network Request Whitelist:

Network Request Whitelist controls, which network requests, such as content fetching or AJAX (XHR) etc. are allowed to be made from within the app. For the web views that support CSP,  it is recommended that you use CSP. This whitelist is for the older WebViews that do not support CSP.  This whitelist is defined in the config.xml using <access origin> tag, but once again in Intel® XDK you provide the URL under Build Settings > Android > Cordova CLI 5.1.1 > Whitelist > Cordova Whitelist > Network Request.  For example: http://mywebsite.com

By default, only request to file”// URLs are allowed, but Cordova applications by default include access to all website. It is recommended that you provide your whitelist before publishing your app.

CLI5.1.1AndroidNetwork.png

Content Security Policy:

Content Security Policy controls, which network requests such as images, AJAX requests (XHR) etc. are allowed to be made via WebView directly. This is specified through meta tags in your html file. It is recommended that you use CSP <meta> tag on all of your pages. Android KitKat onwards supports CSP, but Crosswalk web view supports CSP on all android versions.

For example include this in your index.html file.

<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: cdvfile: https://ssl.gstatic.com; style-src 'self''unsafe-inline'; media-src *">

iOS W3CWidgetAcess CLI 5.1.1

For Microsoft Windows* platforms also, W3C Widget Access standards are used and the build settings for whitelisting are as follows.

iOS W3CWidgetAcess CLI 5.1.1

Cordova CLI 4.1.2

Cordova CLI 4.1.2 is no longer supported by the Intel XDK. Please update your project to use CLI 5.1.1 or later.

 

Linux* 上的Intel® Media Server Studio 通用(Generic)安装

$
0
0

在本文中,我们讨论Intel® Media Server Studio在Linux*上的安装。在 Getting Started Guide 中提供了Gold OS: CentOS* 7.1.1503的安装说明。本文解释如何安装到其他的Linux*发行版,如Ubuntu*。

请在Linux* Release Notes中检查硬件配置支持。

Intel只会处理那些可以在“Gold"配置中验证的问题。更多信息请参阅下面部分。

欢迎参阅: Media Server Studio CentOS Update Options

 

什么是"Gold", "Generic"和"Secondary OS"安装?

Intel Media Server Studio的安装会更新很多图形软件堆栈中的组件, 如内核,i915内核模块驱动,用户模式驱动,库文件,如何libdrm和libva。

"Gold"配置是完全验证和支持的。通常来说这是这默认并且没有更新操作系统更新镜像,如CentOS 7.1.1503。内核补丁是为默认并且没有更新的此特定版本准备的。 注意:任何影响图形堆栈和内核组件的情况,都会使得你的配置认为是通用(Generic)。 更多信息,请参阅 Media Server Studio CentOS Update Options

"Generic"方案允许你基于最小的需求创建自己的配置。更多详细信息参阅下一节。通常说,这意味着使用特定的内核分支 (3.14.5 for 16.4 drivers),但是,对于CentOS/RedHat 版本,你可使用现存的CentOS 7.1.1503 补丁作为起点。

这主要的"Gold"和"Generic"之间区别是支持的。功能上他们是相同的。但这意味着更多的自由会带来更多的责任。Intel可在"Generic"的问题上的帮助要少于"Gold"。  一般来说,任何发生来自使用Generic 安装系统问题必须要在Gold配置重现,Intel才会处理。实际上,主要的区别是安装和非媒体内核特性的支持 - 并不是Media SDK 特性本身。然而安装覆盖了一个非常宽广的范围,因此Intel只能给高层次的建议 - 如本文。

可能的下一步是把Generic 分支的 (3.14.5)内核补丁,移植到默认的非Gold配置的内核中。这个移植被认为是创建一个 "secondary OS"工程。Generic 包中的所有组件都需要这样做。通常来说,帮助移植这些补丁超出了Intel支持的范围。 

GCC, glibc 和libstdc++.so 版本:

"Generic"安装需求:

  • glibc >=2.12
  • gcc >=4.7

然而,你的Linux系统中可能有一个不同的gcc, glibc和libstdc++ 版本。

使用如下命令行在系统中检查gcc版本

[user@host]$ gcc -v
[user@host]$ gcc –version

Use following command line to check the glibc version

[user@host]$ ldd --version
ldd (GNU libc) 2.17
......

很多Linxu发行版带有更新工具或者其他的机制可以很容易的升级gcc。升级glibc被认为是更困难,并且是在产品级的系统中不推荐的。

 

Ubuntu* 14.04上安装Intel Media Server Studio

如下步骤在Ubuntu* 14.04 长期支持版本上安装Intel Media Server Studio。

注意:步骤对于其他的Ubuntu或者基于Ubuntu发行版是相似的, 如何Mint。

如果gcc版本太低,更新:

[root@host]# apt-get install g++-4.7    # 或者更高的gcc版本

Ubuntu 14.04上的安装步骤如下。你可以用root用户在MediaServerStudio*/SDK*/Generic 目录下运行如下的脚本。请注意,仅作为开始和参考使用。

install_ubuntu.sh

#!/bin/bash

echo "remove other libdrm/libva"
find /usr -name "libdrm*" | xargs rm -rf
find /usr -name "libva*" | xargs rm -rf

echo "Remove old MSS install files ..."
rm -rf /opt/intel/mediasdk
rm -rf /opt/intel/common
rm -rf /opt/intel/opencl


echo "install user mode components"
#unpack the generic package
tar -xvzf intel-linux*.tar.gz

#put the generic components in standard locations
/bin/cp -r etc/* /etc
/bin/cp -r opt/* /opt
/bin/cp -r usr/* /usr

#ensure that new libraries can be found
echo '/usr/lib64'> /etc/ld.so.conf.d/libdrm_intel.conf
echo '/usr/local/lib'>> /etc/ld.so.conf.d/libdrm_intel.conf
ldconfig

echo "install kernel build dependencies"
apt-get -y install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc g++

echo "download 3.14.5 kernel"
if [ ! -f ./linux-3.14.5.tar.xz ]; then
     wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz
fi
tar -xJf linux-3.14.5.tar.xz

echo "apply kernel patches"
cp  /opt/intel/mediasdk/opensource/patches/kmd/3.14.5/intel-kernel-patches.tar.bz2 .
tar -xvjf intel-kernel-patches.tar.bz2
cd linux-3.14.5
for i in ../intel-kernel-patches/*.patch; do patch -p1 < $i; done

echo "build patched 3.14.5 kernel"
make olddefconfig
make -j 8
make modules_install
make install


echo "Install finished, please "
echo "1. update LD_LIBRARY_PATH to include /usr/lib64;/usr/local/lib"
echo "2. add user to video group: usermod -a -G video user"
echo "3. reboot"

在其他发行版上安装Intel Media Server Studio

基本步骤如上所述,不同点需要注意:

  • 库的位置对于不同的发行版有很大的区别。是否LD_LIBRARY_PATH 包含了Media SDK 默认库的位置,或者其他您的产品安装位置。 
  • 包管理系统和需要构建内核的软件包在不同的发行版之间有很大的区别,然而构建内核需要的软件包通常会有文档说明。
  • glibc版本:通常问题只是由于版本过于低。但实际情况可能不止这些。
  • gcc 版本(通常问题只是由于版本过于低)
    • 对于 CentOS/Redhat, 容易使用开发工具集升级
    • 对于 Ubuntu 及其派生,使用apt-get升级
    • 对于SuSE/SLES, 使用zypper升级

 

2.4 冒烟测试

'vainfo'工具可以显示Intel iHD加载,并且显示很多VAProfile入口点。

$ vainfo
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.99 (libva 1.67.0.pre1)
vainfo: Driver version: 16.4.4.47109-ubit
vainfo: Supported profile and entrypoints
      VAProfileH264Baseline           :	VAEntrypointEncSlice

 

https://software.intel.com/en-us/intel-media-server-studio-support/code-samples下载MSDK 示例代码

[user@host]$ ./sample_multi_transcode_drm -hw -i::h264 input.h264 -o::h264 out.h264

 

重新编译libva 和 libdrm (可选)

 Media Server Studio 包含了所使用libdrm和libva的全部源码。基于prefix的不同配置,你可能需要更新LD_LIBRARY_PATH以便安装后可以找到库文件, 另外,记得首先移除其他的libdrm和libva版本。

find /usr -name "libdrm*" | xargs rm -rf
find /usr -name "libva*" | xargs rm -rf

 

1. 重建和安装libdrm:

[user@host msdk_install]$ cp /opt/intel/mediasdk/opensource/libdrm/*/libdrm-2.4.54.tar.bz2 .
[user@host msdk_install]$ tar xf libdrm-2.4.54.tar.bz2
[user@host msdk_install]$ cd libdrm-2.4.54
[user@host libdrm-2.4.54]$ ./configure --prefix=/usr/local
[user@host libdrm-2.4.54]$ make
[root@host libdrm-2.4.54]# make install

2. 重建和安装libva:

[user@host msdk_install]$ cp /opt/intel/mediasdk/opensource/libva/*/libva-1.3.1.tar.bz2 .
[user@host msdk_install]$ tar xf libva-1.3.1.tar.bz2
[user@host msdk_install]$ cd libva-1.3.1
[user@host libva-1.3.1]$ ./configure --prefix=/usr/local --with-drivers-path=/opt/intel/mediasdk/lib64
[user@host libva-1.3.1]$ make
[root@host libva-1.3.1]# make install

注意: 请首先编译libdrm,因为libva依赖于libdrm。

How to debug a Fortran application calling a managed DLL.

$
0
0

Currently Intel® Fortran Compiler for Windows projects created within Microsoft Visual Studio* just support "Native Only" option in "Debugger Type" setting (see Figure 1). If your project is a Fortran main program calling a managed DLL you will not be able to debug your Fortran code into managed code source line starting from your application.

 

Figure 1

 

Here is a workaround for this limitation:

1. Set your Visual Studio environment as written under "Debugging mixed language programs with Fortran does not work" at https://software.intel.com/en-us/articles/intel-visual-fortran-compiler-160-for-windows-release-notes-for-intel-parallel-studio-xe#known_issues, and then rebuild the Fortran application and the managed DLL projects.

 

2. Set the managed DLL project as the startup project of the VS solution by selecting it in the "Solution Explorer" windows, right-clicking and choosing "Set as Startup Project" (see Figure 2).

 

Figure 2

 

3. Open the project properties page of the managed DLL project and go to "Debug" page, select "Start external program" for "Start Action" field, and then input the full path to your Fortran application executable file generated by in step 1 (see Figure 3).

 

Figure 3

 

4. Toggle break points at your Fortran application and/or managed DLL source code lines where you want to break by key "F9".

 

5. Start debugging by key "F5".

 

Now you can debug your Fortran/Managed DLL mixed language code by stepping through source code lines.

 

Learning About Input and Output

$
0
0

Input and output (I/O) basics are key for getting deeper into prototyping your own Internet of Things device. This article provides the basics of I/O in electronics, with examples of its implementation.

For a circuit to perform a useful action, it must receive data (input) to which it will respond with an action (output). Think of a child’s toy where a press of a button turns a light turns on, and when you release the button, the light turns off. Sensors and actuators come into play to make this possible. Sensors fall under the input role: Their sole function is to sense a variety of changes in the physical world, such as temperature, touch, force, humidity, and magnetic field. Sensors are also referred to as transducers because they convert input energy found in the physical world into output energy. The output function is generally managed by actuators, which control devices such as light bulbs or speakers.

Sensors and Actuators

There are many different types of sensors, and they’re designed according to the energy change they measure. An accelerometer is a sensor commonly found in many projects. Measuring acceleration force, it’s composed of an element such as a beam that is subject to an electrical voltage to cause agitation. Within the accelerometer family you can find various categories depending on how the accelerometer senses the change in acceleration, such as capacitive (change in capacitance related to acceleration), piezoelectric (uses microcrystals to determine voltage output converted to acceleration), Hall effect (changing magnetic fields), magnetoresistive (change in magnetic field), heat transfer, and piezoresistive (change in electrical resistance). When buying a sensor for your project, note that the price may vary depending on the sensitivity, range, precision, and accuracy, among other factors. An actuator gathers the data from the sensor (electrical signal) and acts on it, causing a change in the physical world. It is also a transducer because it changes one type of quantity into another. Servos, motors, and buzzers all fall under the output category. In more complex networks, you can have multiple sensors and actuators connected on one network, where data collection and coordination can be set from sensor to sensor, sensor to actuator, or actuator to actuator.

There are many applications for sensors and actuators. In the health field, a glucometer is equipped with biological sensors that measure the amount of glucose in a patient’s body. A chemical transducer (input) triggers the release of insulin using a micropump (output). Figure 1 shows an I/O scenario in which a sound sensor (input) converts the sound into electrical impulses and a speaker (output) converts such impulses into sound. The flow starts with an input, followed by the process of morphing the physical energy into electrical waves, which leads to a physical output (sound). In Figure 1, the sensor and actuator are connected to an Intel® Edison board, which aids in the conversion of the physical observation of sound into the output the speaker creates.

Figure 1. Input and output for sound

When a sensor detects one or more signals (input), it converts those signals to an analog or digital representation for the actuator to receive. Analog changes vary at a continuous rate; their illustration is that of continuous smooth curves. Digital data is of a precise count, creating a step-like graph with sharp ups, constant sections, and sharp downs. In the example in Figure 1, the data is analog. Electronic devices that handle both analog and digital communications count with an analog-to-digital converter, which enables the microcontroller to connect to an analog sensor to read in an analog voltage. Figure 2 provides a visual representation of digital and analog waves. Sensors can be designed with either/or capabilities; in fact, there are both analog and digital accelerometers, whereas light sensors and sound are considered analog.

Figure 2. Digital and analog signal types

Explore Input and Output with an Intel® Edison Board

Let’s look more deeply into what enables the I/O functionality on a board, such as the Intel® Edison board. General-purpose input/output (GPIO) pins are located on the edges of the Arduino* expansion board, as shown of Figure 3. These pins are a physical interface between the physical world and the Intel® Edison board: Each pin can represent a high (“on” state, voltage change) or low (“off” state, no voltage). You can then mount a base shield on the pins to connect sensors and actuators. On the Intel® Edison board, I/O pin data is written on a file located at /sys/class/gpio. Given that the pins are bidirectional, the direction is stated at /sys/class/gpio/gpio<XX>/direction where <XX> represents the number given to enabled GPIO and direction can be either in or out.

Figure 3. Pins on the Intel® Edison board

Now that you have a clear understanding of what I/O is and the role it plays in your projects, let’s look at more concrete examples you might encounter daily and how you can create similar devices by using Intel technology, such as the Intel® Edison or Intel® Galileo board.

Light Sensors

A photo sensor is a passive analog device that converts light energy, whether visible or infrared, into an electrical signal output. Light sensors fall into four types, depending on how they react to the input (light): photoemissive, photoconductive, photovoltaic, and photojunction. This article focuses on photoconductive sensors, which vary their electrical resistance when subjected to light. The increase in light results in an increase in current. A light-dependent resistor (LDR) is a photoconductive sensor commonly used in devices that create an action depending on the presence or lack of light, as determined by the changes its electrical resistance.

Newer cars automatically turn on their lights in the absence of “sufficient” ambient light, such as at dusk or when entering a dark tunnel. Similarly, you can plug nightlights throughout your house or in outdoor areas to illuminate the space. You can create a simple homemade nightlight by using an LDR, a source of power (such as a battery), a light, a resistor, and and transistor. To add functionality, specify actions according to the input in the code loaded onto the Intel® Edison board.

Sound Sensors

The famous “clapper on/off” lights benefit from the use of a sound sensor. The device counts with a microphone that listens to the surrounding noise (input), which it turns into an electrical signal and amplifies. The filter matches claps by identifying which sound falls within a certain frequency. Depending on the outcome of the filter, the artifact will send (or not) an electrical signal to the plug outlet to power on or off the item connected to it.

Using an Intel® Edison board with an Arduino* extension board along with a speaker and some transistors, you can build your own clapper or “knocker,” such as the one presented in the “Secret Knock Detecting Door Lock” Instructables project at http://www.instructables.com/id/Secret-Knock-Detecting-Door-Lock.

Summary

You can use sensors to obtain data and combine them with an actuator so that data can result in a transformation of a physical input into a physical output. A wide range of available sensors accommodate diverse use cases and applications, such as thermal sensors, photo sensors, and pressure sensors just to name a few. Connect sensors and actuators to an Intel® Edison board or Intel® Galileo board to obtain data from the sensors and output a result on the actuators.

 

Additional Reading:

Login to leave a comment below. If you are not registered go to the Intel® Developer Zone to sign up.

Mapping an Intel® RealSense™ SDK Face Scan to a 3D Head Model

$
0
0

Download Code Samples

Download PDF [1.08 MB]

This code sample allows the user to scan their face using a front-facing Intel® RealSense™ camera, project it onto a customizable head mesh, and apply post-processing effects on it. It’s an extension of a previous code sample titled Applying Intel® RealSense™ SDK Face Scans to a 3D Mesh. This sample adds features and techniques to improve the quality of the final head result as well as provide a series of post mapping effects.

The following features have been added in this code sample:

  • Parameterized head. The user can shape the head using a series of sliders. For example, the user can change the width of the head, ears, jaw, and so on.
  • Standardized mesh topology. The mapping algorithm can be applied to a head mesh with a standardized topology and can retain the context of each vertex after the mapping is complete. This paves the way for animating the head, improved blending, and post-mapping effects.
  • Color and shape post processing. Morph targets and additional color blending can be applied after the mapping stages are complete to customize the final result.
  • Hair. There are new hair models created to fit the base head model. A custom algorithm is used to adjust the hair geometry to conform to the user’s chosen head shape.

The final results of this sample could be compelling to various applications. Developers could use these tools in their applications to allow their users to scan their face and then customize their character. It could also be used to generate character content for games. Additional morph targets could be added to increase the range of characters that can be created.


Figure 1: From left to right: (a) the face mesh returned from the Intel® RealSense™ SDK’s scan module, (b) the scanned face mapped onto a head model, (c) the head-model geometry morphed with an ogre morph target, and (d) the morphed head colorized.


Figure 2: Examples of effects created using the sample’s morphing and blending techniques.

Using the Sample

The sample includes two executables: ReleaseDX.exe, which supports face scanning, and ReleaseDX_NORS.exe, which only supports mapping of a previously scanned face. Both executables require the 64-bit Visual Studio* 2013 Runtime which can be downloaded here. ReleaseDX.exe requires the installation of Intel® RealSense™ SDK Runtime 2016 R1 (8.0.24.6528), which can be downloaded here or here.

Running the ReleaseDX.exe will begin the face-scanning process. Once the head-positioning hints are satisfied, press the Begin Scan button, turn your head slowly from side to side, and then click End Scan. For best results remove hats or glasses, pull back your hair, and scan in a well-lit area.

Once the scan is complete, or an existing scan has been loaded, the following categories in the UI can be used to customize the result:

  • Face scan. Adjust the yaw, pitch, roll, and z displacement to adjust the face scan’s orientation and position.
  • Head shaping. Use the provided sliders to change the shape of the head model. The idea is to build a head that matches the head of the person scanned. Adjustments to this shape can be made in the post-processing stage.
  • Blending. Use the color controls to choose two different colors that best match your skin color. The first color is the base color and the second color is for tone.
  • Post head shaping. Make any shape adjustments to the head that you want performed after the mapping process. In this stage you can do things like change your body mass index, turn yourself into an ogre, make your ears big, and so on.
  • Post blending. Select any color effects to apply on the entire head after the mapping is complete. These color effects won’t affect the lips or eyes. These effects will let you adjust or colorize the hue/saturation/luminance of the head.

The debug category contains many options for visualizing different parts of the face-mapping pipeline.

The sample allows exporting the resulting head and hair to an .OBJ file so that it can be loaded into other applications.


Figure 3: A screenshot from the code sample showing a small subset of the options available for customizing the head.

Art Assets

The art assets used in this code sample are briefly described in this section and will be referenced throughout the article. All texture assets are authored to the UV coordinates of the base head model. All texture assets are used during the blending stage of the pipeline with the exception of the displacement control map, which is used in the geometry stage.

  • Base head mesh. Base head mesh on which the scanned face mesh will be applied.
  • Head landmark data. Landmarks on the base head mesh that coincide with the landmarks the Intel RealSense SDK provides with each face scan.
  • Displacement control map. Controls which vertices of the base head mesh are displaced by the generated face displacement map.
  • Color control map. Controls blending between the face color and the head color.
  • Feature map. Grayscale map that gives the head texture for the final generated diffuse map.
  • Skin map. Used in the post blending stage to prevent color effects from affecting the eyes and lips.
  • Color transfer map. Controls the blending between the two user-selected colors.
  • Landmark mesh. Used to shift head vertices to their corresponding locations on the face map projection.
  • Head morph targets. Collection of morph targets that can be applied to the base head shape both before and after the face is projected onto the head.
  • Hair models. Collection of hair models that the user can select between.

Face-Mapping Pipeline

The face-mapping pipeline can be separated into four stages.

  1. Displacement and color map. We render the face scan geometry to create a displacement and color map that we project onto the head in a later stage.
  2. Geometry. This stage morphs the positions and normals of the head mesh. The values from the displacement map are used to protrude the face scan’s shape from the head model.
  3. Blending. We blend the head and face color channels together and output a single color map that maps to the UVs of the head model.
  4. Hair geometry. We remap the hair vertex positions to account for changes in the head shape made during the geometry stage.

Face Displacement and Color Map Stage

During this stage, the scanned face mesh is rendered using an orthographic projection matrix generating a depth map and color map. The face scan landmark positions are projected onto these maps and will be used in the geometry stage to project onto the head mesh.


Figure 4: Color and displacement maps created in the displacement map stage. The yellow dots are the landmarks provided by the Intel® RealSense™ SDK projected into the 2D map space.

Geometry Stage

This stage morphs the base head mesh shape and imprints the displacement map onto the head. This must be done while maintaining the context of each face vertex; a vertex on the tip of the nose of the head mesh will be moved so that when the face displaces the vertices, that vertex is still on the tip of the nose. Maintaining this context allows for rigging information on the base head mesh to persist on the resulting head mesh.

Details on this process are outlined in the sections below. The high-level steps include the following:

  1. Project the base head mesh vertices onto the landmark mesh. This will associate each head vertex with a single triangle on the landmark mesh, barycentric coordinates, and an offset along that triangles normal.
  2. Morph the head vertices using morph targets.
  3. Compute a projection matrix that projects the 2D displacement/color maps onto the head mesh and use it to calculate the texture coordinates of each vertex.
  4. Morph the landmark mesh using the face landmark data.
  5. Use the projection data from step one to shift the head vertices based on the morphed landmark mesh.
  6. Displace the head vertices along the z-axis using the displacement map value.
  7. Apply post-processing morph targets

Building a Parametric Head

A wide range of head shapes are available for the morphing system. Each shape sculpts a subset of the head’s range (for example, one of the targets simply controls the width of the chin. Another, body-mass-index (BMI), changes almost the entire head shape.) Each artist-authored head shape contains the same number of vertices, which must match the corresponding vertices in the base head shape.


Figure 5: Parametric head implemented with morph targets.

The artist-authored head shapes are turned into morph targets by compiling a list of delta positions for each vertex. The delta position is the difference, or change, between the vertex of the base head mesh and its associated target shape vertex. Applying a morph target is done by adding the delta positions for each vertex multiplied by some scalar value. A scalar of zero has no effect, while a scalar of one applies the exact target shape. Scalars above one can exaggerate the target shape, and negative scalars can invert it producing interesting effects.

The sample exposes some compound morph targets that allow a single slider to apply multiple morph targets. Some of the sliders apply a weight of zero to one, while others might allow values outside this range.

These morphing techniques can be applied both before and after the face is mapped to the head mesh.

Creating the Displacement and Color Map Projection Matrix

The displacement/color map projection orthographically projects head model vertex positions into UV coordinates of the Displacement and Color maps that were previously created. For more details on this process see the documentation of the previous sample.

Fitting-Face Geometry

The previous sample required the base head mesh to have a relatively dense vertex grid for the facial area. It displaced these vertices to match the scanned mesh’s shape. However, it didn’t discern vertices by their function (for example, vertex in the corner of the mouth). In this version of the sample the base head mesh is less dense and the vertices are fitted to the face scan, preserving vertex functionality. For example, the vertices around the eyes move to where the scan’s eyes are.

The Intel RealSense SDK provides a known set of face landmarks with the face scan. The authored base head mesh supplies matching, authored landmarks. A landmark mesh is used to map between faces. It has one vertex for each important landmark, forming relatively large triangles that subdivide the face. We identify where each base head mesh vertex projects onto the landmark mesh to compute its corresponding position on the scanned face.

During this process, the head vertices are projected onto the landmark mesh, the landmark mesh is morphed based on the base head mesh and face landmark data, and the vertex positions are reprojected onto the head. Finally, the displacement map is applied to the z component of each facial area vertex to extrude the scanned face shape. The displacement control map ensures only the face vertices are shifted and that there is a smooth gradient between vertices that are and are not affected.

The projection of vertices onto the landmark mesh is similar to the projection done in the hair-fitting stage.


Figure 6: Face color map with landmarks visible (left) and authored base head mesh with head landmarks visible (right).


Figure 7: The landmark mesh overlayed on top of the head mesh (left). Note that the inner vertices all line up over head landmarks. The landmark mesh morphed based on the face landmark information (right).


Figure 8: The head with landmark mesh overlay after reprojecting vertex positions and displacing them (left). Notice how the lips have been shifted upward. The head after reprojecting, displacing, and applying the face color map (right).

Blending Stage

The blending stage blends together the face scan color data and the artist-authored head textures producing a final diffuse texture built for the head UV coordinates.

The color transfer map is used to lerp between the two user-selected head colors. That resulting color is then multiplied by the head detail map to create a final color for the head. This color control map is then used to blend between that head color and the face color creating a smooth transition between.

After the color is determined, we can optionally apply some post-processing blending effects. The sample supports a colorize and color adjust effect. The colorize effect extracts the luminosity of the final blended color and then applies a user-specified hue, saturation, and additional luminance to it. The color adjust is similar except it adjusts the existing hue, saturation, and luminance instead of overriding them. Both of these effects support two colors/adjustments that are controlled by the color control map. These effects use the skin map mask allowing the color of the eyes and lips to remain unchanged.

All of this blending is done on the GPU. The shader can be found in Media/MyAssets/Shader/SculptFace.fx.


Figure 9: The Color Transfer Map, which is used to blend between the two user selected colors (left), and the Feature Map, which adds texture to the head (right).


Figure 10: The Color Control Map (left) controls blending between the head color and the face color. The blending process creates a color texture that maps to the head mesh’s UV coordinates (right).

Hair Geometry Stage

Hair information isn’t available from a face-only scan. Producing a complete head requires the application to provide hair. This sample includes only a few choices, with the intent being to demonstrate the technical capability and not to provide a complete solution. A full-featured application could include many choices and variations.

The sample supports changing the shape of the head, so it also supports changing the shape of the hair to match. One possibility might be to create hair morph targets to match each head morph target. However, this would create an unreasonable amount of required art assets, so the sample instead programmatically adjusts the hair shape as the head shape changes.


Figure 11: The base hair rendered on the base head mesh (left). Fitted morphed hair rendered on morphed head shapes (center and right).

The hair fitting is accomplished by locating each of the hair vertices relative to the base head model, then moving the vertices to the same head relative positions on the final head shape. Specifically, each hair vertex is associated with a triangle on the base head mesh, barycentric coordinates, and an offset along the normal.

An initial approach to mapping a hair vertex to a triangle on the base head mesh would be to iterate over each head mesh triangle, project the vertex onto the triangle’s plane using the triangle’s normal, and check whether the vertex lies within the triangle. This approach yields situations where a hair vertex might not map to any of the triangles. A better approach is to instead project each base head mesh triangle forward along each of the vertices’ normals until it intersects the hair vertex. In the event that a hair vertex can map to multiple head mesh triangles (since the head mesh is non-convex), the triangle closest to hair vertex along that triangle’s normal is chosen.


Figure 12: A simplified head mesh and hair vertex.


Figure 13: A single triangle is extruded along the vertex normals until it contains the hair vertex.


Figure 14: The new hair vertex position is calculated for the new head mesh shape. It’s located by the same barycentric coordinates, but relative to the triangle’s new vertex positions and normals.


Figure 15: Projecting the triangle onto the vertex - the math.

Figure 15 shows the vectors used to project the triangle onto the vertex, as seen from four different views.

  • Yellow triangle is the original head triangle.
  • Gray triangle is the yellow triangle projected onto the hair vertex.
  • Blue lines represent the vertex normals (not normalized).
  • Pink line is from the hair vertex to a point on the yellow triangle (note that one of the vertices serves as a point on the plane).
  • Green line shows the shortest distance from the vertex to the plane containing the triangle, along the triangle’s normal. The projected triangle’s vertex positions are computed by first computing the closest distance, d, from the hair vertex to the plane containing the triangle.

Nt = Triangle normal
Ns = Surface normal (that is, interpolated from vertex normals)
Vh = Hair vertex
P = Position on the plane (that is, one of the yellow triangle’s vertices)
Px= Intersection position. Position on the triangle intersected by the line from the hair vertex, along the surface normal
at = 2x the projected triangle area
d = Closest distance from the hair vertex to the plane containing the head triangle
l = distance from the hair vertex to the intersection point

The closest distance from the hair vertex to the plane containing the triangle gives the distance to project the triangle.

d = Nt(Vh-P)

The position of each projected vertex v’i where Ni is normal for Vi , is

Vi =Vi + dNi/(NtNi )

The barycentric coordinates of the hair vertex, relative to the projected triangle are a function of the total triangle area. Twice the triangle’s area is computed with a cross product.

at = |(V1 - V0) x (V2-V0)|

The three barycentric coordinates a, b, and c are then

a = |(V2 - V1) x (Vh-V1)|/at

b = |(V0 - V2) x (Vh-V2)|/at

c = |(V1 - V0) x (Vh-V0)|/at

The vertex lies inside the triangle if a, b, and c are greater than zero, and the sum of a, b, c are less than one. Note that this vertex lies on the surface normal line. The barycentric coordinates give the surface normal, interpolated from the three vertex normals. They similarly give the point on the triangle that also lies along that line (that is, the intersection point).

Ns = aN0 + bN1 + cN2

The intersection point is

Px = aV0 + bV1 + cV2

The distance (l) is stored from the hair vertex to Px. After the head is deformed, the hair vertex is moved this distance away from the triangle on the new head shape.

l = |(Px - Vh)|

The process is reversed to determine the hair vertex’s position relative to the head’s new shape. The intersection’s barycentric coordinates (previously computed relative to the base head mesh) are used to compute the hair vertex’s position and normal on the new head.

N’s = aN0 + bN1 + cN2

Px = aV0 + bV1 + cV2

The new hair vertex position is then

Vh = Px + lNs

Note that this approach just moves the vertices. It doesn’t check for other intersections, and so on. It produces excellent results in practice, but it does have limits. For example, an extreme head shape can poke a head vertex/triangle(s) through the hair.

Also note that the hair vertices are allowed to be on either side of the head triangle. This supports the case where an artist pushes some hair vertices inside the head. This distance is clamped to minimize the chances of associated a vertex with a triangle on the other side of the head.

Acknowledgements

Assets for the base head mesh, morph targets, textures, and some of the hair models were created by 3DModelForge (http://3dmodelforge.com).

Additional hair was created by Liquid Development (http://www.liquiddevelopment.com/).

Doug McNabb, Jeff Williams, Dave Bookout, and Chris Kirkpatrick provided additional help for the sample.

The Internet of Things on a Windows-Based Gateway

$
0
0

Organizations that are embracing the Internet of Things (IoT) face several challenges. For example, an organization must have a clear understanding of its infrastructure and how best to configure it to support new sensors and other edge devices. Beyond the physical hardware, the organization’s development team must be familiar with the necessary software that plays a critical role in successfully establishing an IoT program. This Trending Topic focuses on identifying existing opportunities for the IoT and illustrates ways in which the Windows® 10 operating system can work in conjunction with an Intel® Galileo or Intel® Edison board and Intel IoT Gateway Technology.

Identify Existing Resources

Depending on the situation, an organization may have a significant investment in remote sensors (e.g., motion detectors, entrance and exit monitors, automated light dimmers, temperature sensors). For these businesses, a critical first step is to create an inventory of all available sensors and monitors. This inventory should include interface details such as Arduino*-compatible devices, power needs, and mechanisms for data collection.

Transmit Sensor Data for Collection

Collecting data from remote sensors is the first step in using IoT data. Transferring, analyzing, and taking action based on collected sensor data require a highly available, reliable means of data transport.

The Intel® Galileo and Intel® Edison boards (see Figure 1) provide a wide range of wired and wireless data-collection capabilities, and many online resources detail how to configure a basic IoT sensor board. For example, the Windows* IoT with Intel® Galileo Getting Started Guide presents a demonstration program on an Intel® Galileo Gen 2 board running the Windows® 10 IoT Core operating system. In this example, the most common Windows development platform (Microsoft* Visual Studio* 2013) was used to create a simple C++ console application. Development teams familiar with Windows programming should have little difficulty adapting the approach to their needs.

https://software.intel.com/sites/default/files/managed/e4/19/iot_TEMP_galileoboard.png        

Figure 1. Intel® Galileo and Intel® Edison integration boards

A common mechanism for moving IoT data from machine to machine (M2M) is the Message Queuing Telemetry Transport (MQTT) protocol from OASIS. This lightweight protocol was created using a reliable “publish/subscribe” model, where clients are notified when data updates are published and can recover those data by using one of three reliability standards: deliver once, deliver at most once, or deliver at least once. Several implementations are available for setting up an MQTT client; for example, the Windows Dev Center provides example resources for implementing the M2Mqtt for .NET client with Visual Studio.

For the client to register interest in M2M messages, such as a sensor measurement update, it’s helpful to establish an MQTT broker or gateway so that more than one Galileo or Edison board can generate update messages. This approach uses the board’s preprocessing power to temporarily collect, store, and process raw sensor data from the sensor arrays into a more compact format (such as a compressed time series or fast Fourier transform).

Gateway Functionality

In an IoT implementation, a gateway acts as a data router to interested clients. Publishing data from the Intel® Galileo and Intel® Edison boards to the gateway (for example, by Ethernet, USB, Wi-Fi, or Bluetooth*) establishes a notification event that’s then sent to all registered clients. Using MQTT publish/subscribe in a network that has an IoT gateway that supports Intel® Galileo or Edison® data publishers (see Figure 2) requires that the IoT gateway act as an MQTT broker.

Figure 2. Internet of Things with a gateway

When each Intel® Galileo and Intel® Edison board configured with an MQTT client is publishing data to a Intel® IoT Gateway Technology with Windows® 10 IoT*, other network hosts can use a compatible MQTT client (for example, Mosquitto) to subscribe to the data. This technique allows for distributed data collection across a wide geographic region with many sensor devices. As an example of this large-scale data aggregation, a regional traffic sensor suite could have thousands of vehicle vibration sensors monitoring roadway degradation and reporting to hundreds of Intel® Galileo and Intel® Edison boards, which then preprocess the data and forward them to a central MQTT broker. Downstream systems receive the update notification and retrieve the data packet for further analysis and reporting. In this way, data-transmission bottlenecks are reduced, allowing rapid scaling of prototypes to full solutions.

Analytics and Cloud

The true power of IoT solutions lies with deep data analytics. Given thousands of sensors reporting millions of values, the usefulness of the Intel® Galileo and Intel® Edison board preprocessing step becomes clear. Instead of an analytical system dealing with a data overload, the data stream that the MQTT broker provides can be regulated and fed into an appropriate data store, such as Apache Hadoop*. Pattern analysis can then be conducted “offline,” looking for patterns or anomalies in the data.

The Intel® Cloud Technology Analytic site offers an open processing platform to introduce IoT implementers to the idea of cloud-based data collection and analysis. This site offers tools and frameworks for implementing web services–based calls to a cloud-hosted data analytics engine and alerting system. Visit the Intel® Developer Zone for an overview of the site.

Conclusion

By using hardware (for example, Intel® Galileo and Intel® Edison boards and custom IoT gateways), software (Mosquitto, Windows Configuration Software for Intel® IoT Gateway), and tools (Visual Studio, Windows PowerShell*, Microsoft* Office, and IBM* SPSS), an organization can effectively leverage an existing Microsoft-based infrastructure to facilitate IoT deployment. Challenges remain, especially when integrating with pre-existing sensor and monitoring equipment, but the distributed signal-processing capabilities of the Intel® Galileo and Intel® Edison boards combined with an MQTT-enabled broker offer great flexibility for a wide range of applications. Manufacturing, government, commercial, and other organization types can benefit directly from the approaches outlined here: The only limit is your imagination.

 

Additional Reading:

Login to leave a comment below. If you are not registered go to the Intel® Developer Zone to sign up.


What Is the Gateway and Why Should I Care?

$
0
0

An Internet of Things (IoT) gateway is an integral part of an IoT ecosystem, handling communication with local sensors and remote users among a suite of other functions. In this article you’ll explore the idea of the IoT gateway and how it can benefit your IoT application. You’ll also learn about the Intel® IoT Gateway Technology and how it meets this need.

An IoT ecosystem is made up of many components, or layers. The bottom layer contains the sensors and devices used to measure the world and effect changes. The gateway acts as a secure intermediary between these sensors and devices and the cloud (through networking and eventually persistence in a storage system). The top layer handles overall monitoring and management of the IoT ecosystem, with analytics of the collected and persisted data, including applications and the value the IoT ecosystem exposes (Figure 1).

Figure 1. Canonical Internet of Things Ecosystem Expressed Through Layers

The gateway of this ecosystem is not necessarily a singular component but rather a network of gateways that attach to all the remote devices, scaling with your device population. The gateway to your IoT sensors and devices is particularly important when new capabilities, such as security and manageability, enter the ecosystem. Let’s focus on the IoT gateway and explore its use, capabilities, and key benefits in your IoT solution.

What Is a Gateway?

An IoT gateway is an intermediate device between sensors and devices and the applications that create value from their data and access. The gateway allows you to efficiently collect and securely transport data from devices, remote users, and applications to serve a particular need. This is a gateway’s core capability, but it’s only one aspect that you’ll find important as a developer.

IoT Gateway Stack

IoT gateways consist of a hardware platform and an operating system and expose a rich set of services for your IoT application. What makes an IoT gateway important is the additional capabilities and focused set of services that provide benefits for IoT markets (Figure 2). An example of an IoT Gateway is the Intel® IoT Gateway Technology platform, which includes these capabilities and more.

Figure 2. Internet of Things Gateway Stack in a Nutshell

Above the operating system is a services layer that exposes key gateway features for the IoT application:

  • Connectivity provided by a variety of interfaces (such as 3G cellular, Bluetooth*, USB, serial, ZigBee*, and Wi-Fi) and protocols (such as virtual private networks [VPNs] and Message Queuing Telemetry Transport [MQTT])
  • Security features not only to protect the device against exploits but also to guard the data as it moves between the device and remote locations 
  • Manageability features for configuration, monitoring, and firmware updates

These three features are a key difference between an IoT gateway and a traditional embedded platform. The targeted protocols, interfaces, and firmware features for security and manageability create a new class of device that is optimal for IoT applications.

Another differentiator is operating system support. Intel® IoT Gateway Technology supports Wind River* Linux*, a secure and reliable platform that is fully integrated with connectivity, security, and manageability features.

Finally, at the top of the stack is your IoT application. This is your value-added element and what differentiates you and your market. This application gathers data from local devices and sensors as well as control aspects in the environment.

Now that you understand IoT gateways, let’s look at some scenarios for and benefits of an IoT gateway and the advantages it brings to you and your application.

How Do You Use a Gateway?

Consider the example of an automotive fleet monitoring application. In this environment, you would use an IoT gateway to provide three core features. The first feature is access to the vehicle’s internal network (such as a controller-area network [CAN] or onboard diagnostics 2), which provide information about the vehicle (for example, velocity, engine RPM) and access to a global positioning system device (using a serial interface). The second function is a compute platform to process or reduce this data and respond to requests from an external application. The final feature is communication with the remote location through cellular services (2G, 3G, or 4G). The IoT gateway provides all the capabilities you need to develop this fleet-monitoring application.

In an agricultural application, an IoT Gateway would provide three core features here, as well. The first feature accesses various sensors around the farm (using ZigBee*) to collect information about water usage and current flow state. The second feature is a compute platform to process this data into a temporal log. The third feature is communication with an agricultural application over Wi-Fi, which uses the data and weather information to optimize water use. The IoT gateway provides each capability, resulting in IoT agriculture.

In both examples above, Intel® IoT Gateway Technology provides the requisite interfaces and protocols to meet the demands of the application. But a key advantage is that the Intel® IoT Gateway Technology platform not only meets these requirements, but does so in a secure and manageable way.

Why Should I Care?

There are many benefits to using an IoT gateway like the Intel® IoT Gateway for your IoT application, including:

  • You get an integrated, prevalidated platform that allows quick prototyping and fast development and deployment of your gateway solution.
  • The gateway provides features to help you deploy a production solution (such as manageability and security features).
  • You’ll find the necessary communication hardware and drivers to enable connectivity for your application quickly, including ZigBee*; cellular 2G, 3G, and 4G; Bluetooth*; serial (RS-232, RS-485); USB; CAN; VPN; Wi-Fi; and MQTT. These capabilities are built into the provided Wind River* Linux* operating system that Intel uses, making them immediately available to your application.

Manageability features include standards-based protocols like Open Mobile Alliance Device Management, Technical Report 069 (an application-layer protocol for remote device management), and other web-based configuration interfaces. Security features include OpenSSL, encrypted storage, VPN, secure boot, and the McAfee® Application Integrity Monitor and Application Resource Control. The Intel® IoT Gateways are a family of platforms that target your particular application based on your desired processing capability, memory and storage requirements, and input/output requirements.

Summary

The IoT gateway is a critical piece of the IoT ecosystem. It provides the foundation of application development for sensor and device access, onboard processing, and communication to a remote application but in a secure and manageable way. Intel has you covered with an integrated and prevalidated platform that includes configuration options that focus on the industrial, energy, and transportation markets. The Intel® IoT Gateway Technology solutions offer an easy way to get your IoT application up and running in a secure and manageable fashion.

Additional Reading:

Login to leave a comment below. If you are not registered go to the Intel® Developer Zone to sign up.

When to Use the Intel® Galileo Board

$
0
0

The Intel® Galileo board is ideal for Internet of Things (IoT) projects, helping you improve the scope and function of your IoT projects. Whether you’re an embedded systems expert or an IoT enthusiast, you want to use the right resources to build your project. You want to maintain a balance between the investment you make while building your project and the function and features the final project will offer. The Intel® Galileo board is one of the most powerful IoT boards in the industry, and it can handle all your IoT needs, big or small. This article looks at some of applications for which the it would come in handy. Armed with this information, you’ll be able to make an informed decision when you purchase your hardware.

Figure 1. The Intel® Galileo board is ideal for Internet of Things projects.

IoT Applications with Heavy Server-Side Apps

For IoT projects, you can use the main board as a client or a server depending on your project’s design. When you use the board as a client, it works in conjunction with web-based applications hosted on online servers. The board uses GET and POST requests to send data to the applications, and receives data from the applications in JavaScript* Object Notation format or plain text by Ethernet or Wi-Fi (if you have installed a Wi-Fi card on your board).

If your project involves heavy data transfer, you’ll need a reliable board on your side. With its powerful 400 MHz 32-bit Intel Quark SoC X1000 application processor, the Intel® Galileo board can receive and send data at high speeds. It’s high clock speed allows it to execute more instructions at a time, reducing instances of data loss caused by timeout errors. Other boards that use microprocessors with slower clock speeds usually take longer to save and retrieve data, so accessing data from online servers takes longer as well, which can lead to data loss during large data transfers.

When you use your board as a web server, the web app is normally stored in the board’s flash memory or on an SD card mounted on the board. You can then access the web app over a wired network or the Internet. Many IoT boards are capable of this kind of application, but not all of them have sufficient storage space to accommodate large web apps, or lack the resources to run them efficiently.

The Intel® Galileo board, however, was made for such applications. It has ample space in its flash memory (8 MB) in which you can store web app code, but if you need more, you can store the code in an onboard 32 GB SD card. Moreover, the 256 MB of RAM gives the Intel® Galileo board enough space to handle data during runtime.

Interaction with Other Intel® Boards

Intel makes several open source boards, such as Intel® Edison. Unlike many other open source boards on the market, Intel boards support different programming languages, such as C++, and integrated development environments, such as Arduino* and Node.js*. Moreover, if you want to send output from the Intel® Galileo board to the Intel® Edison board by serial port, you can do so in text format, and the intel® Edison board will be able to access the data regardless of whether you used Arduino or Node.js to program it. This seamless transfer of data is made possible by the publisher-subscriber model used to share data between different programs running on Linux*.

Image- and Face-Recognition Applications

Image- and face-recognition applications aren’t easy to create on most IoT boards because they don’t support programming environments capable of performing such tasks. You can use the Intel® Galileo board for image processing, however, because it supports the OpenCV. OpenCV is an open source library specifically designed for machine learning and computer vision. Using it, you can build advanced IoT projects such as a centralized facial-recognition system.

A good example of a facial-recognition project you can create with the Intel® Galileo board is a room population monitor. To build such a project, use OpenCV in C++ to get the number of faces in a segment of camera footage, then pass the data to an Arduino* application. The Arduino application then sends the data in the form of a text file to a web server that you have used Node.js* to create. This way, you can monitor the number of people in a room from a remote location over the Internet.

Using Arduino*-Compatible Shields

The Intel® Galileo board is compatible with the Arduino* UNO R3 pin configuration, so you can mount any Arduino-compatible shield on the Intel® Galileo board with no extra hardware or software necessary. This compatibility makes project development faster and cheaper, and many affordable Arduino-compatible shields are available on the market.

Typically, the Intel® Galileo board operates on 3.3 V core voltage, so it will work with 3.3 V rated Arduino shields by default. If you want to use the Intel® Galileo board with a 5 V–rated shield, you’ll have to adjust the general-purpose input/output (GPIO) voltage to 5 V. Intel provides a jumper on the board that changes the GPIO to from 3.3 V to 5 V; all you have to do is change the jumper position.

Other Applications

In addition to the applications this article discussed, you can use the Intel® Galileo board in many other areas, depending on the scope of your project. By adding shields and different sensors compatible with Arduino*, you can add even more functions and build robust, interconnected systems for the Internet of Things.

 

Additional Reading:

Login to leave a comment below. If you are not registered go to the Intel® Developer Zone to sign up.

Intel® XDK FAQs - General

$
0
0

How can I get started with Intel XDK?

There are plenty of videos and articles that you can go through here to get started. You could also start with some of our demo apps. It may also help to read Five Useful Tips on Getting Started Building Cordova Mobile Apps with the Intel XDK, which will help you understand some of the differences between developing for a traditional server-based environment and developing for the Intel XDK hybrid Cordova app environment.

Having prior understanding of how to program using HTML, CSS and JavaScript* is crucial to using the Intel XDK. The Intel XDK is primarily a tool for visualizing, debugging and building an app package for distribution.

You can do the following to access our demo apps:

  • Select Project tab
  • Select "Start a New Project"
  • Select "Samples and Demos"
  • Create a new project from a demo

If you have specific questions following that, please post it to our forums.

Can I use an external editor for development in Intel® XDK?

Yes, you can open your files and edit them in your favorite editor. However, note that you must use Brackets* to use the "Live Layout Editing" feature. Also, if you are using App Designer (the UI layout tool in Intel XDK) it will make many automatic changes to your index.html file, so it is best not to edit that file externally at the same time you have App Designer open.

Some popular editors among our users include:

  • Sublime Text* (Refer to this article for information on the Intel XDK plugin for Sublime Text*)
  • Notepad++* for a lighweight editor
  • Jetbrains* editors (Webstorm*)
  • Vim* the editor

How do I get code refactoring capability in Brackets* (the Intel XDK code editor)?

...to be written...

Why doesn’t my app show up in Google* play for tablets?

...to be written...

What is the global-settings.xdk file and how do I locate it?

global-settings.xdk contains information about all your projects in the Intel XDK, along with many of the settings related to panels under each tab (Emulate, Debug etc). For example, you can set the emulator to auto-refresh or no-auto-refresh. Modify this file at your own risk and always keep a backup of the original!

You can locate global-settings.xdk here:

  • Mac OS X*
    ~/Library/Application Support/XDK/global-settings.xdk
  • Microsoft Windows*
    %LocalAppData%\XDK
  • Linux*
    ~/.config/XDK/global-settings.xdk

If you are having trouble locating this file, you can search for it on your system using something like the following:

  • Windows:
    > cd /
    > dir /s global-settings.xdk
  • Mac and Linux:
    $ sudo find / -name global-settings.xdk

When do I use the intelxdk.js, xhr.js and cordova.js libraries?

The intelxdk.js and xhr.js libraries were only required for use with the Intel XDK legacy build tiles (which have been retired). The cordova.js library is needed for all Cordova builds. When building with the Cordova tiles, any references to intelxdk.js and xhr.js libraries in your index.html file are ignored.

How do I get my Android (and Crosswalk) keystore file?

New with release 3088 of the Intel XDK, you may now download your build certificates (aka keystore) using the new certificate manager that is built into the Intel XDK. Please read the initial paragraphs of Managing Certificates for your Intel XDK Account and the section titled "Convert a Legacy Android Certificate" in that document, for details regarding how to do this.

It may also help to review this short, quick overview video (there is no audio) that shows how you convert your existing "legacy" certificates to the "new" format that allows you to directly manage your certificates using the certificate management tool that is built into the Intel XDK. This conversion process is done only once.

If the above fails, please send an email to html5tools@intel.com requesting help. It is important that you send that email from the email address associated with your Intel XDK account.

How do I rename my project that is a duplicate of an existing project?

See this FAQ: How do I make a copy of an existing Intel XDK project?

How do I recover when the Intel XDK hangs or won't start?

  • If you are running Intel XDK on Windows* it must be Windows* 7 or higher. It will not run reliably on earlier versions.
  • Delete the "project-name.xdk" file from the project directory that Intel XDK is trying to open when it starts (it will try to open the project that was open during your last session), then try starting Intel XDK. You will have to "import" your project into Intel XDK again. Importing merely creates the "project-name.xdk" file in your project directory and adds that project to the "global-settings.xdk" file.
  • Rename the project directory Intel XDK is trying to open when it starts. Create a new project based on one of the demo apps. Test Intel XDK using that demo app. If everything works, restart Intel XDK and try it again. If it still works, rename your problem project folder back to its original name and open Intel XDK again (it should now open the sample project you previously opened). You may have to re-select your problem project (Intel XDK should have forgotten that project during the previous session).
  • Clear Intel XDK's program cache directories and files.

    On a Windows machine this can be done using the following on a standard command prompt (administrator is not required):

    > cd %AppData%\..\Local\XDK
    > del *.* /s/q

    To locate the "XDK cache" directory on [OS X*] and [Linux*] systems, do the following:

    $ sudo find / -name global-settings.xdk
    $ cd <dir found above>
    $ sudo rm -rf *

    You might want to save a copy of the "global-settings.xdk" file before you delete that cache directory and copy it back before you restart Intel XDK. Doing so will save you the effort of rebuilding your list of projects. Please refer to this question for information on how to locate the global-settings.xdk file.
  • If you save the "global-settings.xdk" file and restored it in the step above and you're still having hang troubles, try deleting the directories and files above, along with the "global-settings.xdk" file and try it again.
  • Do not store your project directories on a network share (Intel XDK currently has issues with network shares that have not yet been resolved). This includes folders shared between a Virtual machine (VM) guest and its host machine (for example, if you are running Windows* in a VM running on a Mac* host). This network share issue is a known issue with a fix request in place.
  • There have also been issues with running behind a corporate network proxy or firewall. To check them try running Intel XDK from your home network where, presumably, you have a simple NAT router and no proxy or firewall. If things work correctly there then your corporate firewall or proxy may be the source of the problem.
  • Issues with Intel XDK account logins can also cause Intel XDK to hang. To confirm that your login is working correctly, go to the Intel XDK App Center and confirm that you can login with your Intel XDK account. While you are there you might also try deleting the offending project(s) from the App Center.

If you can reliably reproduce the problem, please send us a copy of the "xdk.log" file that is stored in the same directory as the "global-settings.xdk" file to html5tools@intel.com.

Is Intel XDK an open source project? How can I contribute to the Intel XDK community?

No, It is not an open source project. However, it utilizes many open source components that are then assembled into Intel XDK. While you cannot contribute directly to the Intel XDK integration effort, you can contribute to the many open source components that make up Intel XDK.

The following open source components are the major elements that are being used by Intel XDK:

  • Node-Webkit
  • Chromium
  • Ripple* emulator
  • Brackets* editor
  • Weinre* remote debugger
  • Crosswalk*
  • Cordova*
  • App Framework*

How do I configure Intel XDK to use 9 patch png for Android* apps splash screen?

Intel XDK does support the use of 9 patch png for Android* apps splash screen. You can read up more at https://software.intel.com/en-us/xdk/articles/android-splash-screens-using-nine-patch-png on how to create a 9 patch png image and link to an Intel XDK sample using 9 patch png images.

How do I stop AVG from popping up the "General Behavioral Detection" window when Intel XDK is launched?

You can try adding nw.exe as the app that needs an exception in AVG.

What do I specify for "App ID" in Intel XDK under Build Settings?

Your app ID uniquely identifies your app. For example, it can be used to identify your app within Apple’s application services allowing you to use things like in-app purchasing and push notifications.

Here are some useful articles on how to create an App ID:

Is it possible to modify the Android Manifest or iOS plist file with the Intel XDK?

You cannot modify the AndroidManifest.xml file directly with our build system, as it only exists in the cloud. However, you may do so by creating a dummy plugin that only contains a plugin.xml file containing directives that can be used to add lines to the AndroidManifest.xml file during the build process. In essence, you add lines to the AndroidManifest.xml file via a local plugin.xml file. Here is an example of a plugin that does just that:

<?xml version="1.0" encoding="UTF-8"?><plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="my-custom-intents-plugin" version="1.0.0"><name>My Custom Intents Plugin</name><description>Add Intents to the AndroidManifest.xml</description><license>MIT</license><engines><engine name="cordova" version=">=3.0.0" /></engines><!-- android --><platform name="android"><config-file target="AndroidManifest.xml" parent="/manifest/application"><activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:launchMode="singleTop" android:name="testa" android:theme="@android:style/Theme.Black.NoTitleBar"><intent-filter><action android:name="android.intent.action.SEND" /><category android:name="android.intent.category.DEFAULT" /><data android:mimeType="*/*" /></intent-filter></activity></config-file></platform></plugin>

You can inspect the AndroidManifest.xml created in an APK, using apktool with the following command line:

$ apktool d my-app.apk
$ cd my-app
$ more AndroidManifest.xml

This technique exploits the config-file element that is described in the Cordova Plugin Specification docs and can also be used to add lines to iOS plist files. See the Cordova plugin documentation link for additional details.

Here is an example of such a plugin for modifying the iOS plist file, specifically for adding a BIS key to the plist file:

<?xml version="1.0" encoding="UTF-8"?><plugin
    xmlns="http://apache.org/cordova/ns/plugins/1.0"
    id="my-custom-bis-plugin"
    version="0.0.2"><name>My Custom BIS Plugin</name><description>Add BIS info to iOS plist file.</description><license>BSD-3</license><preference name="BIS_KEY" /><engines><engine name="cordova" version=">=3.0.0" /></engines><!-- ios --><platform name="ios"><config-file target="*-Info.plist" parent="CFBundleURLTypes"><array><dict><key>ITSAppUsesNonExemptEncryption</key><true/><key>ITSEncryptionExportComplianceCode</key><string>$BIS_KEY</string></dict></array></config-file></platform></plugin>

How can I share my Intel XDK app build?

You can send a link to your project via an email invite from your project settings page. However, a login to your account is required to access the file behind the link. Alternatively, you can download the build from the build page, onto your workstation, and push that built image to some location from which you can send a link to that image.

Why does my iOS build fail when I am able to test it successfully on a device and the emulator?

Common reasons include:

  • Your App ID specified in the project settings do not match the one you specified in Apple's developer portal.
  • The provisioning profile does not match the cert you uploaded. Double check with Apple's developer site that you are using the correct and current distribution cert and that the provisioning profile is still active. Download the provisioning profile again and add it to your project to confirm.
  • In Project Build Settings, your App Name is invalid. It should be modified to include only alpha, space and numbers.

How do I add multiple domains in Domain Access?

Here is the primary doc source for that feature.

If you need to insert multiple domain references, then you will need to add the extra references in the intelxdk.config.additions.xml file. This StackOverflow entry provides a basic idea and you can see the intelxdk.config.*.xml files that are automatically generated with each build for the <access origin="xxx" /> line that is generated based on what you provide in the "Domain Access" field of the "Build Settings" panel on the Project Tab.

How do I build more than one app using the same Apple developer account?

On Apple developer, create a distribution certificate using the "iOS* Certificate Signing Request" key downloaded from Intel XDK Build tab only for the first app. For subsequent apps, reuse the same certificate and import this certificate into the Build tab like you usually would.

How do I include search and spotlight icons as part of my app?

Please refer to this article in the Intel XDK documentation. Create anintelxdk.config.additions.xml file in your top level directory (same location as the otherintelxdk.*.config.xml files) and add the following lines for supporting icons in Settings and other areas in iOS*.

<!-- Spotlight Icon --><icon platform="ios" src="res/ios/icon-40.png" width="40" height="40" /><icon platform="ios" src="res/ios/icon-40@2x.png" width="80" height="80" /><icon platform="ios" src="res/ios/icon-40@3x.png" width="120" height="120" /><!-- iPhone Spotlight and Settings Icon --><icon platform="ios" src="res/ios/icon-small.png" width="29" height="29" /><icon platform="ios" src="res/ios/icon-small@2x.png" width="58" height="58" /><icon platform="ios" src="res/ios/icon-small@3x.png" width="87" height="87" /><!-- iPad Spotlight and Settings Icon --><icon platform="ios" src="res/ios/icon-50.png" width="50" height="50" /><icon platform="ios" src="res/ios/icon-50@2x.png" width="100" height="100" />

For more information related to these configurations, visit http://cordova.apache.org/docs/en/3.5.0/config_ref_images.md.html#Icons%20and%20Splash%20Screens.

For accurate information related to iOS icon sizes, visit https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html

NOTE: The iPhone 6 icons will only be available if iOS* 7 or 8 is the target.

Cordova iOS* 8 support JIRA tracker: https://issues.apache.org/jira/browse/CB-7043

Does Intel XDK support Modbus TCP communication?

No, since Modbus is a specialized protocol, you need to write either some JavaScript* or native code (in the form of a plugin) to handle the Modbus transactions and protocol.

How do I sign an Android* app using an existing keystore?

New with release 3088 of the Intel XDK, you may now import your existing keystore into Intel XDK using the new certificate manager that is built into the Intel XDK. Please read the initial paragraphs of Managing Certificates for your Intel XDK Account and the section titled "Import an Android Certificate Keystore" in that document, for details regarding how to do this.

If the above fails, please send an email to html5tools@intel.com requesting help. It is important that you send that email from the email address associated with your Intel XDK account.

How do I build separately for different Android* versions?

Under the Projects Panel, you can select the Target Android* version under the Build Settings collapsible panel. You can change this value and build your application multiple times to create numerous versions of your application that are targeted for multiple versions of Android*.

How do I display the 'Build App Now' button if my display language is not English?

If your display language is not English and the 'Build App Now' button is proving to be troublesome, you may change your display language to English which can be downloaded by a Windows* update. Once you have installed the English language, proceed to Control Panel > Clock, Language and Region > Region and Language > Change Display Language.

How do I update my Intel XDK version?

When an Intel XDK update is available, an Update Version dialog box lets you download the update. After the download completes, a similar dialog lets you install it. If you did not download or install an update when prompted (or on older versions), click the package icon next to the orange (?) icon in the upper-right to download or install the update. The installation removes the previous Intel XDK version.

How do I import my existing HTML5 app into the Intel XDK?

If your project contains an Intel XDK project file (<project-name>.xdk) you should use the "Open an Intel XDK Project" option located at the bottom of the Projects List on the Projects tab (lower left of the screen, round green "eject" icon, on the Projects tab). This would be the case if you copied an existing Intel XDK project from another system or used a tool that exported a complete Intel XDK project.

If your project does not contain an Intel XDK project file (<project-name>.xdk) you must "import" your code into a new Intel XDK project. To import your project, use the "Start a New Project" option located at the bottom of the Projects List on the Projects tab (lower left of the screen, round blue "plus" icon, on theProjects tab). This will open the "Samples, Demos and Templates" page, which includes an option to "Import Your HTML5 Code Base." Point to the root directory of your project. The Intel XDK will attempt to locate a file named index.html in your project and will set the "Source Directory" on the Projects tab to point to the directory that contains this file.

If your imported project did not contain an index.html file, your project may be unstable. In that case, it is best to delete the imported project from the Intel XDK Projects tab ("x" icon in the upper right corner of the screen), rename your "root" or "main" html file to index.html and import the project again. Several components in the Intel XDK depend on this assumption that the main HTML file in your project is named index.hmtl. See Introducing Intel® XDK Development Tools for more details.

It is highly recommended that your "source directory" be located as a sub-directory inside your "project directory." This insures that non-source files are not included as part of your build package when building your application. If the "source directory" and "project directory" are the same it results in longer upload times to the build server and unnecessarily large application executable files returned by the build system. See the following images for the recommended project file layout.

I am unable to login to App Preview with my Intel XDK password.

On some devices you may have trouble entering your Intel XDK login password directly on the device in the App Preview login screen. In particular, sometimes you may have trouble with the first one or two letters getting lost when entering your password.

Try the following if you are having such difficulties:

  • Reset your password, using the Intel XDK, to something short and simple.

  • Confirm that this new short and simple password works with the XDK (logout and login to the Intel XDK).

  • Confirm that this new password works with the Intel Developer Zone login.

  • Make sure you have the most recent version of Intel App Preview installed on your devices. Go to the store on each device to confirm you have the most recent copy of App Preview installed.

  • Try logging into Intel App Preview on each device with this short and simple password. Check the "show password" box so you can see your password as you type it.

If the above works, it confirms that you can log into your Intel XDK account from App Preview (because App Preview and the Intel XDK go to the same place to authenticate your login). When the above works, you can go back to the Intel XDK and reset your password to something else, if you do not like the short and simple password you used for the test.

How do I completely uninstall the Intel XDK from my system?

Take the following steps to completely uninstall the XDK from your Windows system:

  • From the Windows Control Panel, remove the Intel XDK, using the Windows uninstall tool.

  • Then:
    > cd %LocalAppData%\Intel\XDK
    > del *.* /s/q

  • Then:
    > cd %LocalAppData%\XDK
    > copy global-settings.xdk %UserProfile%
    > del *.* /s/q
    > copy %UserProfile%\global-settings.xdk .

  • Then:
    -- Goto xdk.intel.com and select the download link.
    -- Download and install the new XDK.

To do the same on a Linux or Mac system:

  • On a Linux machine, run the uninstall script, typically /opt/intel/XDK/uninstall.sh.
     
  • Remove the directory into which the Intel XDK was installed.
    -- Typically /opt/intel or your home (~) directory on a Linux machine.
    -- Typically in the /Applications/Intel XDK.app directory on a Mac.
     
  • Then:
    $ find ~ -name global-settings.xdk
    $ cd <result-from-above> (for example ~/Library/Application Support/XDK/ on a Mac)
    $ cp global-settings.xdk ~
    $ rm -Rf *
    $ mv ~/global-settings.xdk .

     
  • Then:
    -- Goto xdk.intel.com and select the download link.
    -- Download and install the new XDK.

Is there a tool that can help me highlight syntax issues in Intel XDK?

Yes, you can use the various linting tools that can be added to the Brackets editor to review any syntax issues in your HTML, CSS and JS files. Go to the "File > Extension Manager..." menu item and add the following extensions: JSHint, CSSLint, HTMLHint, XLint for Intel XDK. Then, review your source files by monitoring the small yellow triangle at the bottom of the edit window (a green check mark indicates no issues).

How do I delete built apps and test apps from the Intel XDK build servers?

You can manage them by logging into: https://appcenter.html5tools-software.intel.com/csd/controlpanel.aspx. This functionality will eventually be available within Intel XDK after which access to app center will be removed.

I need help with the App Security API plugin; where do I find it?

Visit the primary documentation book for the App Security API and see this forum post for some additional details.

When I install my app or use the Debug tab Avast antivirus flags a possible virus, why?

If you are receiving a "Suspicious file detected - APK:CloudRep [Susp]" message from Avast anti-virus installed on your Android device it is due to the fact that you are side-loading the app (or the Intel XDK Debug modules) onto your device (using a download link after building or by using the Debug tab to debug your app), or your app has been installed from an "untrusted" Android store. See the following official explanation from Avast:

Your application was flagged by our cloud reputation system. "Cloud rep" is a new feature of Avast Mobile Security, which flags apks when the following conditions are met:

  1. The file is not prevalent enough; meaning not enough users of Avast Mobile Security have installed your APK.
  2. The source is not an established market (Google Play is an example of an established market).

If you distribute your app using Google Play (or any other trusted market) your users should not see any warning from Avast.

Following are some of the Avast anti-virus notification screens you might see on your device. All of these are perfectly normal, they are due to the fact that you must enable the installation of "non-market" apps in order to use your device for debug and the App IDs associated with your never published app or the custom debug modules that the Debug tab in the Intel XDK builds and installs on your device will not be found in a "established" (aka "trusted") market, such as Google Play.

If you choose to ignore the "Suspicious app activity!" threat you will not receive a threat for that debug module any longer. It will show up in the Avast 'ignored issues' list. Updates to an existing, ignored, custom debug module should continue to be ignored by Avast. However, new custom debug modules (due to a new project App ID or a new version of Crosswalk selected in your project's Build Settings) will result in a new warning from the Avast anti-virus tool.

  

  

How do I add a Brackets extension to the editor that is part of the Intel XDK?

The number of Brackets extensions that are provided in the built-in edition of the Brackets editor are limited to insure stability of the Intel XDK product. Not all extensions are compatible with the edition of Brackets that is embedded within the Intel XDK. Adding incompatible extensions can cause the Intel XDK to quit working.

Despite this warning, there are useful extensions that have not been included in the editor and which can be added to the Intel XDK. Adding them is temporary, each time you update the Intel XDK (or if you reinstall the Intel XDK) you will have to "re-add" your Brackets extension. To add a Brackets extension, use the following procedure:

  • exit the Intel XDK
  • download a ZIP file of the extension you wish to add
  • on Windows, unzip the extension here:
    %LocalAppData%\Intel\XDK\xdk\brackets\b\extensions\dev
  • on Mac OS X, unzip the extension here:
    /Applications/Intel\ XDK.app/Contents/Resources/app.nw/brackets/b/extensions/dev
  • start the Intel XDK

Note that the locations given above are subject to change with new releases of the Intel XDK.

Why does my app or game require so many permissions on Android when built with the Intel XDK?

When you build your HTML5 app using the Intel XDK for Android or Android-Crosswalk you are creating a Cordova app. It may seem like you're not building a Cordova app, but you are. In order to package your app so it can be distributed via an Android store and installed on an Android device, it needs to be built as a hybrid app. The Intel XDK uses Cordova to create that hybrid app.

A pure Cordova app requires the NETWORK permission, it's needed to "jump" between your HTML5 environment and the native Android environment. Additional permissions will be added by any Cordova plugins you include with your application; which permissions are includes are a function of what that plugin does and requires.

Crosswalk for Android builds also require the NETWORK permission, because the Crosswalk image built by the Intel XDK includes support for Cordova. In addition, current versions of Crosswalk (12 and 14 at the time this FAQ was written)also require NETWORK STATE and WIFI STATE. There is an extra permission in some versions of Crosswalk (WRITE EXTERNAL STORAGE) that is only needed by the shared model library of Crosswalk, we have asked the Crosswalk project to remove this permission in a future Crosswalk version.

If you are seeing more than the following five permissions in your XDK-built Crosswalk app:

  • android.permission.INTERNET
  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.ACCESS_WIFI_STATE
  • android.permission.INTERNET
  • android.permission.WRITE_EXTERNAL_STORAGE

then you are seeing permissions that have been added by some plugins. Each plugin is different, so there is no hard rule of thumb. The two "default" core Cordova plugins that are added by the Intel XDK blank templates (device and splash screen) do not require any Android permissions.

BTW: the permission list above comes from a Crosswalk 14 build. Crosswalk 12 builds do not included the last permission; it was added when the Crosswalk project introduced the shared model library option, which started with Crosswalk 13 (the Intel XDK does not support 13 builds).

How do I make a copy of an existing Intel XDK project?

If you just need to make a backup copy of an existing project, and do not plan to open that backup copy as a project in the Intel XDK, do the following:

  • Exit the Intel XDK.
  • Copy the entire project directory:
    • on Windows, use File Explorer to "right-click" and "copy" your project directory, then "right-click" and "paste"
    • on Mac use Finder to "right-click" and then "duplicate" your project directory
    • on Linux, open a terminal window, "cd" to the folder that contains your project, and type "cp -a old-project/ new-project/" at the terminal prompt (where "old-project/" is the folder name of your existing project that you want to copy and "new-project/" is the name of the new folder that will contain a copy of your existing project)

If you want to use an existing project as the starting point of a new project in the Intel XDK. The process described below will insure that the build system does not confuse the ID in your old project with that stored in your new project. If you do not follow the procedure below you will have multiple projects using the same project ID (a special GUID that is stored inside the Intel XDK <project-name>.xdk file in the root directory of your project). Each project in your account must have a unique project ID.

  • Exit the Intel XDK.
  • Make a copy of your existing project using the process described above.
  • Inside the new project that you made (that is, your new copy of your old project), make copies of the <project-name>.xdk file and <project-name>.xdke files and rename those copies to something like project-new.xdk and project-new.xdke (anything you like, just something different than the original project name, preferably the same name as the new project folder in which you are making this new project).
  • Using a TEXT EDITOR (only) (such as Notepad or Sublime or Brackets or some other TEXT editor), open your new "project-new.xdk" file (whatever you named it) and find the projectGuid line, it will look something like this:
    "projectGuid": "a863c382-ca05-4aa4-8601-375f9f209b67",
  • Change the "GUID" to all zeroes, like this: "00000000-0000-0000-000000000000"
  • Save the modified "project-new.xdk" file.
  • Open the Intel XDK.
  • Goto the Projects tab.
  • Select "Open an Intel XDK Project" (the green button at the bottom left of the Projects tab).
  • To open this new project, locate the new "project-new.xdk" file inside the new project folder you copied above.
  • Don't forget to change the App ID in your new project. This is necessary to avoid conflicts with the project you copied from, in the store and when side-loading onto a device.

My project does not include a www folder. How do I fix it so it includes a www or source directory?

The Intel XDK HTML5 and Cordova project file structures are meant to mimic a standard Cordova project. In a Cordova (or PhoneGap) project there is a subdirectory (or folder) named www that contains all of the HTML5 source code and asset files that make up your application. For best results, it is advised that you follow this convention, of putting your source inside a "source directory" inside of your project folder.

This most commonly happens as the result of exporting a project from an external tool, such as Construct2, or as the result of importing an existing HTML5 web app that you are converting into a hybrid mobile application (eg., an Intel XDK Corodova app). If you would like to convert an existing Intel XDK project into this format, follow the steps below:

  • Exit the Intel XDK.
  • Copy the entire project directory:
    • on Windows, use File Explorer to "right-click" and "copy" your project directory, then "right-click" and "paste"
    • on Mac use Finder to "right-click" and then "duplicate" your project directory
    • on Linux, open a terminal window, "cd" to the folder that contains your project, and type "cp -a old-project/ new-project/" at the terminal prompt (where "old-project/" is the folder name of your existing project that you want to copy and "new-project/" is the name of the new folder that will contain a copy of your existing project)
  • Create a "www" directory inside the new duplicate project you just created above.
  • Move your index.html and other source and asset files to the "www" directory you just created -- this is now your "source" directory, located inside your "project" directory (do not move the <project-name>.xdk and xdke files and any intelxdk.config.*.xml files, those must stay in the root of the project directory)
  • Inside the new project that you made above (by making a copy of the old project), rename the <project-name>.xdk file and <project-name>.xdke files to something like project-copy.xdk and project-copy.xdke (anything you like, just something different than the original project, preferably the same name as the new project folder in which you are making this new project).
  • Using a TEXT EDITOR (only) (such as Notepad or Sublime or Brackets or some other TEXT editor), open the new "project-copy.xdk" file (whatever you named it) and find the line named projectGuid, it will look something like this:
    "projectGuid": "a863c382-ca05-4aa4-8601-375f9f209b67",
  • Change the "GUID" to all zeroes, like this: "00000000-0000-0000-000000000000"
  • A few lines down find: "sourceDirectory": "",
  • Change it to this: "sourceDirectory": "www",
  • Save the modified "project-copy.xdk" file.
  • Open the Intel XDK.
  • Goto the Projects tab.
  • Select "Open an Intel XDK Project" (the green button at the bottom left of the Projects tab).
  • To open this new project, locate the new "project-copy.xdk" file inside the new project folder you copied above.

Can I install more than one copy of the Intel XDK onto my development system?

Yes, you can install more than one version onto your development system. However, you cannot run multiple instances of the Intel XDK at the same time. Be aware that new releases sometimes change the project file format, so it is a good idea, in these cases, to make a copy of your project if you need to experiment with a different version of the Intel XDK. See the instructions in a FAQ entry above regarding how to make a copy of your Intel XDK project.

Follow the instructions in this forum post to install more than one copy of the Intel XDK onto your development system.

On Apple OS X* and Linux* systems, does the Intel XDK need the OpenSSL* library installed?

Yes. Several features of the Intel XDK require the OpenSSL library, which typically comes pre-installed on Linux and OS X systems. If the Intel XDK reports that it could not find libssl, go to https://www.openssl.org to download and install it.

I have a web application that I would like to distribute in app stores without major modifications. Is this possible using the Intel XDK?

Yes, if you have a true web app or “client app” that only uses HTML, CSS and JavaScript, it is usually not too difficult to convert it to a Cordova hybrid application (this is what the Intel XDK builds when you create an HTML5 app). If you rely heavily on PHP or other server scripting languages embedded in your pages you will have more work to do. Because your Cordova app is not associated with a server, you cannot rely on server-based programming techniques; instead, you must rewrite any such code to user RESTful APIs that your app interacts with using, for example, AJAX calls.

What is the best training approach to using the Intel XDK for a newbie?

First, become well-versed in the art of client web apps, apps that rely only on HTML, CSS and JavaScript and utilize RESTful APIs to talk to network services. With that you will have mastered 80% of the problem. After that, it is simply a matter of understanding how Cordova plugins are able to extend the JavaScript API for access to features of the platform. For HTML5 training there are many sites providing tutorials. It may also help to read Five Useful Tips on Getting Started Building Cordova Mobile Apps with the Intel XDK, which will help you understand some of the differences between developing for a traditional server-based environment and developing for the Intel XDK hybrid Cordova app environment.

What is the best platform to start building an app with the Intel XDK? And what are the important differences between the Android, iOS and other mobile platforms?

There is no one most important difference between the Android, iOS and other platforms. It is important to understand that the HTML5 runtime engine that executes your app on each platform will vary as a function of the platform. Just as there are differences between Chrome and Firefox and Safari and Internet Explorer, there are differences between iOS 9 and iOS 8 and Android 4 and Android 5, etc. Android has the most significant differences between vendors and versions of Android. This is one of the reasons the Intel XDK offers the Crosswalk for Android build option, to normalize and update the Android issues.

In general, if you can get your app working well on Android (or Crosswalk for Android) first you will generally have fewer issues to deal with when you start to work on the iOS and Windows platforms. In addition, the Android platform has the most flexible and useful debug options available, so it is the easiest platform to use for debugging and testing your app.

Is my password encrypted and why is it limited to fifteen characters?

Yes, your password is stored encrypted and is managed by https://signin.intel.com. Your Intel XDK userid and password can also be used to log into the Intel XDK forum as well as the Intel Developer Zone. the Intel XDK does not store nor does it manage your userid and password.

The rules regarding allowed userids and passwords are answered on this Sign In FAQ page, where you can also find help on recovering and changing your password.

Why does the Intel XDK take a long time to start on Linux or Mac?

...and why am I getting this error message? "Attempt to contact authentication server is taking a long time. You can wait, or check your network connection and try again."

At startup, the Intel XDK attempts to automatically determine the proxy settings for your machine. Unfortunately, on some system configurations it is unable to reliably detect your system proxy settings. As an example, you might see something like this image when starting the Intel XDK.

On some systems you can get around this problem by setting some proxy environment variables and then starting the Intel XDK from a command-line that includes those configured environment variables. To set those environment variables, similar to the following:

$ export no_proxy="localhost,127.0.0.1/8,::1"
$ export NO_PROXY="localhost,127.0.0.1/8,::1"
$ export http_proxy=http://proxy.mydomain.com:123/
$ export HTTP_PROXY=http://proxy.mydomain.com:123/
$ export https_proxy=http://proxy.mydomain.com:123/
$ export HTTPS_PROXY=http://proxy.mydomain.com:123/

IMPORTANT! The name of your proxy server and the port (or ports) that your proxy server requires will be different than those shown in the example above. Please consult with your IT department to find out what values are appropriate for your site. Intel has no way of knowing what configuration is appropriate for your network.

If you use the Intel XDK in multiple locations (at work and at home), you may have to change the proxy settings before starting the Intel XDK after switching to a new network location. For example, many work networks use a proxy server, but most home networks do not require such a configuration. In that case, you need to be sure to "unset" the proxy environment variables before starting the Intel XDK on a non-proxy network.

After you have successfully configured your proxy environment variables, you can start the Intel XDK manually, from the command-line.

On a Mac, where the Intel XDK is installed in the default location, type the following (from a terminal window that has the above environment variables set):

$ open /Applications/Intel\ XDK.app/

On a Linux machine, assuming the Intel XDK has been installed in the ~/intel/XDK directory, type the following (from a terminal window that has the above environment variables set):

$ ~/intel/XDK/xdk.sh &

In the Linux case, you will need to adjust the directory name that points to the xdk.sh file in order to start. The example above assumes a local install into the ~/intel/XDK directory. Since Linux installations have more options regarding the installation directory, you will need to adjust the above to suit your particular system and install directory.

How do I generate a P12 file on a Windows machine?

See these articles:

How do I change the default dir for creating new projects in the Intel XDK?

You can change the default new project location manually by modifying a field in the global-settings.xdk file. Locate the global-settings.xdk file on your system (the precise location varies as a function of the OS) and find this JSON object inside that file:

"projects-tab": {"defaultPath": "/Users/paul/Documents/XDK","LastSortType": "descending|Name","lastSortType": "descending|Opened","thirdPartyDisclaimerAcked": true
  },

The example above came from a Mac. On a Mac the global-settings.xdk file is located in the "~/Library/Application Support/XDK" directory.

On a Windows machine the global-settings.xdk file is normally found in the "%LocalAppData%\XDK" directory. The part you are looking for will look something like this:

"projects-tab": {"thirdPartyDisclaimerAcked": false,"LastSortType": "descending|Name","lastSortType": "descending|Opened","defaultPath": "C:\\Users\\paul/Documents"
  },

Obviously, it's the defaultPath part you want to change.

BE CAREFUL WHEN YOU EDIT THE GLOBAL-SETTINGS.XDK FILE!! You've been warned...

Make sure the result is proper JSON when you are done, or it may cause your XDK to cough and hack loudly. Make a backup copy of global-settings.xdk before you start, just in case.

Where I can find recent and upcoming webinars list?

How can I change the email address associated with my Intel XDK login?

Login to the Intel Developer Zone with your Intel XDK account userid and password and then locate your "account dashboard." Click the "pencil icon" next to your name to open the "Personal Profile" section of your account, where you can edit your "Name & Contact Info," including the email address associated with your account, under the "Private" section of your profile.

What network addresses must I enable in my firewall to insure the Intel XDK will work on my restricted network?

Normally, access to the external servers that the Intel XDK uses is handled automatically by your proxy server. However, if you are working in an environment that has restricted Internet access and you need to provide your IT department with a list of URLs that you need access to in order to use the Intel XDK, then please provide them with the following list of domain names:

  • appcenter.html5tools-software.intel.com (for communication with the build servers)
  • s3.amazonaws.com (for downloading sample apps and built apps)
  • download.xdk.intel.com (for getting XDK updates)
  • debug-software.intel.com (for using the Test tab weinre debug feature)
  • xdk-feed-proxy.html5tools-software.intel.com (for receiving the tweets in the upper right corner of the XDK)
  • signin.intel.com (for logging into the XDK)
  • sfederation.intel.com (for logging into the XDK)

Normally this should be handled by your network proxy (if you're on a corporate network) or should not be an issue if you are working on a typical home network.

I cannot create a login for the Intel XDK, how do I create a userid and password to use the Intel XDK?

If you have downloaded and installed the Intel XDK but are having trouble creating a login, you can create the login outside the Intel XDK. To do this, go to the Intel Developer Zone and push the "Join Today" button. After you have created your Intel Developer Zone login you can return to the Intel XDK and use that userid and password to login to the Intel XDK. This same userid and password can also be used to login to the Intel XDK forum.

Installing the Intel XDK on Windows fails with a "Package signature verification failed." message.

If you receive a "Package signature verification failed" message (see image below) when installing the Intel XDK on your system, it is likely due to one of the following two reasons:

  • Your system does not have a properly installed "root certificate" file, which is needed to confirm that the install package is good.
  • The install package is corrupt and failed the verification step.

The first case can happen if you are attempting to install the Intel XDK on an unsupported version of Windows. The Intel XDK is only supported on Microsoft Windows 7 and higher. If you attempt to install on Windows Vista (or earlier) you may see this verification error. The workaround is to install the Intel XDK on a Windows 7 or greater machine.

The second case is likely due to a corruption of the install package during download or due to tampering. The workaround is to re-download the install package and attempt another install.

If you are installing on a Windows 7 (or greater) machine and you see this message it is likely due to a missing or bad root certificate on your system. To fix this you may need to start the "Certificate Propagation" service. Open the Windows "services.msc" panel and then start the "Certificate Propagation" service. Additional links related to this problem can be found here > https://technet.microsoft.com/en-us/library/cc754841.aspx

See this forum thread for additional help regarding this issue > https://software.intel.com/en-us/forums/intel-xdk/topic/603992

Troubles installing the Intel XDK on a Linux or Ubuntu system, which option should I choose?

Choose the local user option, not root or sudo, when installing the Intel XDK on your Linux or Ubuntu system. This is the most reliable and trouble-free option and is the default installation option. This will insure that the Intel XDK has all the proper permissions necessary to execute properly on your Linux system. The Intel XDK will be installed in a subdirectory of your home (~) directory.

Inactive account/ login issue/ problem updating an APK in store, How do I request account transfer?

As of June 26, 2015 we migrated all of Intel XDK accounts to the more secure intel.com login system (the same login system you use to access this forum).

We have migrated nearly all active users to the new login system. Unfortunately, there are a few active user accounts that we could not automatically migrate to intel.com, primarily because the intel.com login system does not allow the use of some characters in userids that were allowed in the old login system.

If you have not used the Intel XDK for a long time prior to June 2015, your account may not have been automatically migrated. If you own an "inactive" account it will have to be manually migrated -- please try logging into the Intel XDK with your old userid and password, to determine if it no longer works. If you find that you cannot login to your existing Intel XDK account, and still need access to your old account, please send a message to html5tools@intel.com and include your userid and the email address associated with that userid, so we can guide you through the steps required to reactivate your old account.

Alternatively, you can create a new Intel XDK account. If you have submitted an app to the Android store from your old account you will need access to that old account to retrieve the Android signing certificates in order to upgrade that app on the Android store; in that case, send an email to html5tools@intel.com with your old account username and email and new account information.

Connection Problems? -- Intel XDK SSL certificates update

On January 26, 2016 we updated the SSL certificates on our back-end systems to SHA2 certificates. The existing certificates were due to expire in February of 2016. We have also disabled support for obsolete protocols.

If you are experiencing persistent connection issues (since Jan 26, 2016), please post a problem report on the forum and include in your problem report:

  • the operation that failed
  • the version of your XDK
  • the version of your operating system
  • your geographic region
  • and a screen capture

How do I resolve build failure: "libpng error: Not a PNG file"?  

f you are experiencing build failures with CLI 5 Android builds, and the detailed error log includes a message similar to the following:

Execution failed for task ':mergeArmv7ReleaseResources'.> Error: Failed to run command: /Developer/android-sdk-linux/build-tools/22.0.1/aapt s -i .../platforms/android/res/drawable-land-hdpi/screen.png -o .../platforms/android/build/intermediates/res/armv7/release/drawable-land-hdpi-v4/screen.png

Error Code: 42

Output: libpng error: Not a PNG file

You need to change the format of your icon and/or splash screen images to PNG format.

The error message refers to a file named "screen.png" -- which is what each of your splash screens were renamed to before they were moved into the build project resource directories. Unfortunately, JPG images were supplied for use as splash screen images, not PNG images. So the files were renamed and found by the build system to be invalid.

Convert your splash screen images to PNG format. Renaming JPG images to PNG will not work! You must convert your JPG images into PNG format images using an appropriate image editing tool. The Intel XDK does not provide any such conversion tool.

Beginning with Cordova CLI 5, all icons and splash screen images must be supplied in PNG format. This applies to all supported platforms. This is an undocumented "new feature" of the Cordova CLI 5 build system that was implemented by the Apache Cordova project.

Why do I get a "Parse Error" when I try to install my built APK on my Android device?

Because you have built an "unsigned" Android APK. You must click the "signed" box in the Android Build Settings section of the Projects tab if you want to install an APK on your device. The only reason you would choose to create an "unsigned" APK is if you need to sign it manually. This is very rare and not the normal situation.

My converted legacy keystore does not work. Google Play is rejecting my updated app.

The keystore you converted when you updated to 3088 (now 3240 or later) is the same keystore you were using in 2893. When you upgraded to 3088 (or later) and "converted" your legacy keystore, you re-signed and renamed your legacy keystore and it was transferred into a database to be used with the Intel XDK certificate management tool. It is still the same keystore, but with an alias name and password assigned by you and accessible directly by you through the Intel XDK.

If you kept the converted legacy keystore in your account following the conversion you can download that keystore from the Intel XDK for safe keeping (do not delete it from your account or from your system). Make sure you keep track of the new password(s) you assigned to the converted keystore.

There are two problems we have experienced with converted legacy keystores at the time of the 3088 release (April, 2016):

  • Using foreign (non-ASCII) characters in the new alias name and passwords were being corrupted.
  • Final signing of your APK by the build system was being done with RSA256 rather than SHA1.

Both of the above items have been resolved and should no longer be an issue.

If you are currently unable to complete a build with your converted legacy keystore (i.e., builds fail when you use the converted legacy keystore but they succeed when you use a new keystore) the first bullet above is likely the reason your converted keystore is not working. In that case we can reset your converted keystore and give you the option to convert it again. You do this by requesting that your legacy keystore be "reset" by filling out this form. For 100% surety during that second conversion, use only 7-bit ASCII characters in the alias name you assign and for the password(s) you assign.

IMPORTANT: using the legacy certificate to build your Android app is ONLY necessary if you have already published an app to an Android store and need to update that app. If you have never published an app to an Android store using the legacy certificate you do not need to concern yourself with resetting and reconverting your legacy keystore. It is easier, in that case, to create a new Android keystore and use that new keystore.

If you ARE able to successfully build your app with the converted legacy keystore, but your updated app (in the Google store) does not install on some older Android 4.x devices (typically a subset of Android 4.0-4.2 devices), the second bullet cited above is likely the reason for the problem. The solution, in that case, is to rebuild your app and resubmit it to the store (that problem was a build-system problem that has been resolved).

How can I have others beta test my app using Intel App Preview?

Apps that you sync to your Intel XDK account, using the Test tab's green "Push Files" button, can only be accessed by logging into Intel App Preview with the same Intel XDK account credentials that you used to push the files to the cloud. In other words, you can only download and run your app for testing with Intel App Preview if you log into the same account that you used to upload that test app. This restriction applies to downloading your app into Intel App Preview via the "Server Apps" tab, at the bottom of the Intel App Preview screen, or by scanning the QR code displayed on the Intel XDK Test tab using the camera icon in the upper right corner of Intel App Preview.

If you want to allow others to test your app, using Intel App Preview, it means you must use one of two options:

  • give them your Intel XDK userid and password
  • create an Intel XDK "test account" and provide your testers with that userid and password

For security sake, we highly recommend you use the second option (create an Intel XDK "test account"). 

A "test account" is simply a second Intel XDK account that you do not plan to use for development or builds. Do not use the same email address for your "test account" as you are using for your main development account. You should use a "throw away" email address for that "test account" (an email address that you do not care about).

Assuming you have created an Intel XDK "test account" and have instructed your testers to download and install Intel App Preview; have provided them with your "test account" userid and password; and you are ready to have them test:

  • sign out of your Intel XDK "development account" (using the little "man" icon in the upper right)
  • sign into your "test account" (again, using the little "man" icon in the Intel XDK toolbar)
  • make sure you have selected the project that you want users to test, on the Projects tab
  • goto the Test tab
  • make sure "MOBILE" is selected (upper left of the Test tab)
  • push the green "PUSH FILES" button on the Test tab
  • log out of your "test account"
  • log into your development account

Then, tell your beta testers to log into Intel App Preview with your "test account" credentials and instruct them to choose the "Server Apps" tab at the bottom of the Intel App Preview screen. From there they should see the name of the app you synced using the Test tab and can simply start it by touching the app name (followed by the big blue and white "Launch This App" button). Staring the app this way is actually easier than sending them a copy of the QR code. The QR code is very dense and is hard to read with some devices, dependent on the quality of the camera in their device.

Note that when running your test app inside of Intel App Preview they cannot test any features associated with third-party plugins, only core Cordova plugins. Thus, you need to insure that those parts of your apps that depend on non-core Cordova plugins have been disabled or have exception handlers to prevent your app from either crashing or freezing.

Back to FAQs Main

Connecting to IBM* Bluemix* Internet of Things using MQTT*

$
0
0

IBM* Bluemix* IoT initial setup

  1. Create an account, if you do not yet have one.

  2. Log into your account.

  3. Select New Dashboard if that option is presented.

Add an Internet of Things Platform

  1. Go to your dashboard and click Use Services or APIs to add a new service.

  2. Click Internet of Things Platform.

  3. In the Service Name field, type a name of your choosing.

  4. From the Selected Plan drop-down list, choose a pricing plan.

  5. Click the Create button.

Add a device type

  1. Under Connect your devices, click the Launch dashboard button.

  2. This opens a new IBM Watson IoT Platform window.

  3. On the Device Types tile, click the Add Device button.

  4. Click the Create device type button.

  5. This opens the Create Device Type page.

  6. Click the Create device type button.

  7. Fill the Name and Description fields and click Next.

  8. Specify the attributes for your template and click Next.

  9. In the Submit Information step, click Next.

  10. If necessary, add metadata and click Create.

Add a device

  1. From the Choose Device Type drop-down list, select the new device type you created in the previous section, and click Next.

  2. In the Device ID field, type the ID of your device and click Next.

  3. If necessary, add metadata and click Next.

  4. In the Security step, auto-generate an authentication token by clicking Next.

  5. Click Add.

  6. Make a note of the Authentication Token displayed under Your Device Credentials.

Summary

If you have followed all the steps above, you should have all the information that your program needs to connect to the MQTT* server:

MQTT_SERVER - use \<Your organization ID\>.messaging.internetofthings.ibmcloud.com, along with the ssl:// (for C++) or mqtts:// (for JavaScript*) protocol

MQTT_CLIENTID - use d:\<Your organization ID\>:\<Your device type\>:\<Your device ID\>

MQTT_TOPIC - use iot-2/evt/status/fmt/json

MQTT_USERNAME - use use-token-auth

MQTT_PASSWORD - use the string with the authorization token of your device

Additional setup for C++

When running your C++ code on the Intel® Edison board, you need to set the MQTT* client parameters in Eclipse*. To do that:

  1. Go to Run configurations and, in the Commands to execute before application field, type the following:

    chmod 755 /tmp/<Your app name>; export MQTT_SERVER="ssl://<Your organization ID>.messaging.internetofthings.ibmcloud.com:8883"; export MQTT_CLIENTID="d:<Your organization ID>:<Your device type>:<Your device ID>"; export MQTT_USERNAME="use-token-auth"; export MQTT_PASSWORD="<Your authorization token>"; export MQTT_TOPIC="iot-2/evt/status/fmt/json"
  2. Click the Apply button to save these settings.

  3. Click the Run button to run the code on your board.

Additional setup for JavaScript*

When running your JavaScript* code on the Intel® Edison board, you need to set the MQTT* client parameters in the Intel® XDK IDE. Add the following entries to the config.json file:

    {"MQTT_SERVER": "mqtts://<Your organization ID>.messaging.internetofthings.ibmcloud.com:8883","MQTT_CLIENTID": "d:<Your organization ID>:<Your device type>:<Your device ID>","MQTT_USERNAME": "use-token-auth","MQTT_PASSWORD": "<Your authorization token>","MQTT_TOPIC": "iot-2/evt/status/fmt/json"
    }

Connecting to Microsoft* Azure* IoT Hub using MQTT*

$
0
0

Microsoft* Azure* initial setup

  1. Create an account on https://azure.microsoft.com/en-us, if you do not yet have one.

  2. Log into your account.

  3. Click New > Internet of Things > Azure IoT Hub.

  4. Enter the required information for your new Azure* IoT Hub and click Create.

Your new Azure* IoT Hub is created within a few moments.

Obtain a shared access signature (SAS) token for administrative use

Once your Azure* IoT Hub is created, you need to obtain an SAS token to perform administrative actions, such as creating or listing devices. To do this:

  1. On your dashboard, click the link to your new Azure* IoT Hub.

  2. Go to Settings > Shared access policies > registryReadWrite.

  3. Obtain the Primary key and the corresponding Connection string.

  4. Create an SAS token as follows:

    sastoken <Your IoT Hub Name>.azure-devices.net/devices/ <Your primary key> 1440 registryReadWrite

Note: For this to work, you must be in the directory where you downloaded/cloned this example (e.g.,C:\Users\me\Documents\GitHub\intel-iot-examples-mqtt\support\azure\build\windows).

Your SAS token should look similar to this:

It is valid for 24 hours and should be used only for performing administrative functions, such as creating new devices. Each device also needs its own SAS token, which we will create in subsequent steps.

You can find the sastoken program under support\azure. Precompiled binaries for Windows*, OS X*, and Linux* can be found in the support\azure\build folder.

Create a new device

You can use the curl command to create a new device for your Azure* IoT Hub using the SAS token with registryReadWrite access as obtained above. For example, to create a new device named "edison1", issue the following command:

$ curl -i -X PUT -H "Content-Type: application/json" -H "Authorization: <Your SharedAccessSignature>" -d "{deviceId: \"edison1\"}" https://<Your IoT Hub Name>.azure-devices.net/devices/edison1?api-version=2016-02-03

If you are using Windows*, you may need to install Cygwin* to be able to use curl. See installing cygwin.md for instructions.

You should receive a response that looks like this:

Get the list of devices

You can use curl to get the list of current devices for your Azure* IoT Hub using the SAS token with registryReadWrite access as follows:

curl -i -H "Accept: application/json" -H "Authorization: <Your SharedAccessSignature>" https://<Your IoT Hub Name>.azure-devices.net/devices?api-version=2016-02-03

You should receive a response that looks like this:

You need the device's Primary key or Secondary key to obtain an SAS token for enabling the device to connect to the Azure* IoT Hub.

Obtain an SAS token for device use

You need to create an SAS token for enabling the Intel® Edison board to connect to your Azure* IoT Hub for recording data. The SAS token for this purpose has fewer privileges than the one created for administrative use. You can use sastoken as follows:

sastoken <Your IoT Hub Name>.azure-devices.net/devices/<Your device name> <Your device primary key> 1440
 

Your SAS token should look similar to this:

It is valid for 24 hours and should be used only for the device for which it is created. In other words, each device that you wish to connect needs its own SAS token.

Summary

If you have followed all the steps above, you should have all the information that your program needs to connect to the MQTT* server:

  • MQTT_SERVER - use \<Your IoT Hub Name\>.azure-devices.net, along with the ssl:// (for C++) or the mqtts:// (for JavaScript*) protocol

  • MQTT_CLIENTID - use \<Your device name\>

  • MQTT_TOPIC - use devices/\<Your device name\>/messages/events/

  • MQTT_USERNAME - use \<Your IoT Hub Name\>.azure-devices.net/\<Your device name\>

  • MQTT_PASSWORD - use the string with your device's SAS token.

Additional setup for C++

When running your C++ code on the Intel® Edison board, you need to set the MQTT* client parameters in Eclipse*. To do that:

  1. Go to Run configurations and, in the Commands to execute before application field, type the following:

    chmod 755 /tmp/<Your app name>; export MQTT_SERVER="ssl://<Your IoT Hub Name>.azure-devices.net:8883"; export MQTT_CLIENTID="<Your device ID>"; export MQTT_USERNAME="<Your IoT Hub Name>.azure-devices.net/<Your device name>"; export MQTT_PASSWORD="<Your device SAS token>"; export MQTT_TOPIC="devices/<Your device name>/messages/events/"
  2. Click the Apply button to save these settings.

  3. Click the Run button to run the code on your board.

Additional setup for JavaScript*

When running your JavaScript* code on the Intel® Edison board, you need to set the MQTT* client parameters in the Intel® XDK IDE. Add the following entries to the config.json file:

{"MQTT_SERVER": "mqtts://<Your IoT Hub Name>.azure-devices.net:8883","MQTT_CLIENTID": "<Your device name>","MQTT_USERNAME": "<Your IoT Hub Name>.azure-devices.net/<Your device name>","MQTT_PASSWORD": "<Your device SAS token>","MQTT_TOPIC": "devices/<Your device name>/messages/events/"
}

 

Connecting to Amazon* Web Services* (AWS*) IoT using MQTT*

$
0
0

AWS* IoT initial setup

  1. Create an account on https://aws.amazon.com, if you do not yet have one.

  2. Install the AWS* CLI by following the instructions at http://docs.aws.amazon.com/cli/latest/userguide/installing.html.

Adding the AWS* CLI path to environment variables on Windows*

  1. Go to Control Panel and click System.

  2. Click Advanced system settings.

  3. On the Advanced tab, click Environment Variables.

  4. In the User variables for me box, double-click PATH.

  5. Click New, add the full path to the AWS* CLI installation directory, and click OK.

  6. In the System variables box, double-click Path.

  7. If the AWS* CLI installation directory is not listed, repeat the actions from step 5.

  8. In the Environment Variables window, click OK.

  9. In the SystemProperties window, click OK.Note: For ease of use on Windows*, while using the AWS* CLI, follow the subsequent steps of this tutorial in the directory where you cloned this repository (for example, C:\Users\me\Documents\GitHub\intel-iot-examples-mqtt\support\aws).

Verify the setup by running this command:

aws iot help

You should see the output like this:

Create a new device

To create a new device, use the create-thing command as follows:

aws iot create-thing --thing-name "edison1"

You should see the output like this:

Get the list of devices

To list your devices, use the list-things command as follows:

aws iot list-things

You should see the output like this:

Obtain and configure a certificate for device use

  1. Provision a certificate:

    aws iot create-keys-and-certificate --set-as-active --certificate-pem-outfile cert.pem --public-key-outfile publicKey.pem --private-key-outfile privateKey.pem

    You should see the output like this:

  2. Create/attach policy:

    aws iot create-policy --policy-name "PubSubToAnyTopic" --policy-document file:///intel/how-to-code-samples/docs/mqtt/aws-device-policy.json

    You should see the output like this:

  3. Attach the certificate to a device (you need certificate-arn from step 1):

    aws iot attach-principal-policy --principal "certificate-arn" --policy-name "PubSubToAnyTopic"

Determine the AWS* endpoint

You can obtain the host to use by running the following command:

aws iot describe-endpoint
 

You should see the output like this:

Installing certificates to the Intel® Edison board

From your computer, run the following commands:

scp -r cert.pem USERNAME@xxx.xxx.x.xxx:/home/root/.ssh
scp -r publicKey.pem USERNAME@xxx.xxx.x.xxx:/home/root/.ssh
scp -r privateKey.pem USERNAME@xxx.xxx.x.xxx:/home/root/.ssh
 

where USERNAME@xxx.xxx.x.xxx is the username and IP address you set for your board.

Installing certificates to the Intel® Edison board (Windows* only)

We'll be using WinSCP* for the next steps. For installation instructions, refer to https://github.com/intel-iot-devkit/how-to-code-samples/blob/master/docs/cpp/using-winscp.md.

  1. Log into your device using WinSCP*.

  2. Make sure your host machine is in the directory where you ran your previous AWS* CLI commands.

  3. Copy cert.pem, privateKey.pem, and publicKey.pem to your /home/root directory on your Intel® Edison board.

Summary

If you have followed all the steps above, you should have all the information that your program needs to connect to the MQTT* server:

MQTT_SERVER - use the host value you obtained by running the aws iot describe-endpoint command, along with the ssl://(for C++) or mqtts:// protocol (for JavaScript*)

MQTT_CLIENTID - use \<Your device name\>

MQTT_TOPIC - use devices/\<Your device name\>

MQTT_CERT - use the filename of the device certificate as described above

MQTT_KEY - use the filename of the device key as described above

MQTT_CA - use the filename of the CA certificate (/etc/ssl/certs/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem)

Additional setup for C++

When running your C++ code on the Intel® Edison board, you need to set the MQTT* client parameters in Eclipse*. To do that:

  1. Go to Run configurations and, in the Commands to execute before application field, type the following:

    chmod 755 /tmp/<Your app name>; export MQTT_SERVER="ssl://<Your host name>:8883"; export MQTT_CLIENTID="<Your device ID>"; export MQTT_CERT="/home/root/.ssh/cert.pem"; export MQTT_KEY="/home/root/.ssh/privateKey.pem"; export MQTT_CA="/etc/ssl/certs/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem"; export MQTT_TOPIC="devices/<Your device ID>"

     

  2. Click the Apply button to save these settings.

  3. Click the Run button to run the code on your board.

Additional setup for JavaScript*

When running your JavaScript* code on the Intel® Edison board, you need to set the MQTT* client parameters in the Intel® XDK IDE. Add the following entries to the config.json file:

    {"MQTT_SERVER": "mqtts://<Your host name>:8883","MQTT_CLIENTID": "<Your device ID>","MQTT_CERT": "/home/root/.ssh/cert.pem","MQTT_KEY": "/home/root/.ssh/privateKey.pem","MQTT_TOPIC": "devices/<Your device ID>"
    }

 

IoT Standards: All Grit, No Glamour

$
0
0

All technological change depends on standards. The days of closed, proprietary systems are rapidly coming to an end, and today we think more about building ecosystems around open standards. The open-source movement, in particular, has brought together diverse factions, even hardline competitors in the marketplace. The goal is to forge standardized operating environments and hardware platforms, to make building blocks and components that organizations can use to develop fresh solutions to longstanding business challenges.

Nonetheless, it’s hard to get excited about standards. We know that standards are essential, but we also know that creating them requires endless hours of debate about precise terminology, interfaces, protocols, APIs, and other minutiae. Internet of Things (IoT) standards are particularly challenging—instead of trying to cobble together a collection of servers from across the continent or create an API to communicate with a web service, we’re trying to connect all of the electronic devices in the world, unified through a common framework. Think about what it takes to set up communications across a spectrum of machines and devices, including automobiles, homes, energy grids, and factories. The magnitude of the challenge goes far beyond daunting.

Moving Beyond Moore’s Law

The exacting work that’s needed to create a global IoT ecosystem is being accomplished collaboratively across a number of open source projects, standards bodies, and consortia. At stake is the future of the worldwide IoT ecosystem that could revolutionize the way in which cities operate, energy grids perform, and goods are transported. However, unlike the limited computer capabilities available in the 60’s, today we have supercomputers and architectural advances that are moving beyond Moore’s Law to deliver incredible levels of compute performance and new capabilities. And, in parallel, we have entire computer systems on a chip, leading to compact circuit boards ideal for embedding into a wide range of devices to harness intelligence from the edge of an IoT network.

4G Technology Struggle   

Standards don’t emerge without birthing pains. The struggle over the foundation of 4G wireless technology offers a good example. Industry giants went toe-to-toe, pitting Long Term Evolution (LTE) and mobile WiMAX as successor to GSM as the future mobile standard and the foundation of 4G networks. Billions of dollars and fierce arguments ensued, leading to an eventual industry-wide migration to LTE as Sprint, the primary carrier that originally championed WiMAX, has been moving remaining customers to its LTE network. Today, the Global TD-LTE Initiative (GTI TD-LTE) is pushing a variant of LTE that has quickly gained momentum and the industry is turning to open source components and network function virtualization (NFV) as building blocks for 5G technology, which promises better support for the IoT. Struggles similar to the tug-of-war surrounding 4G technology are going on across industries as IoT gains maturity.   

List of IoT-Related Standards Bodies and Consortia

The growth of IoT technologies is set to explode in 2016, according to Gartner. Gartner projects that the number of “things” in the IoT world will increase 30 percent over 2015, to 6.4 billion connected devices, generating service spending of $235 billion. The establishment of necessary standards will depend on the degree of harmony or conflict in the bodies that are driving development. Competitive proposals keep the dialog dynamic and interesting, particularly in the realm of mobile IoT communications. A partial list of the IoT-related standards bodies and consortia—and their self descriptions—includes:

  • 3GPP*– Works toward mobile broadband standards and support for IoT.

  • AllSeen Alliance– Enables the interoperability of billions of devices, services, and apps that comprise the IoT.

  • IEC Smart Grid Standards– Provides a roadmap for identifying the standards that apply to the smart grid, for achieving optimal electricity delivery.

  • IEEE Standards Association on Innovation and IoT– Enables products with real-world applications.  

  • Industrial Internet Consortium– Helpsto shape and grow the industrial Internet with a membership represent large and small industry, entrepreneurs, academics, and government organizations with an interest in .

  • Internet of Things Consortium– Drives adoption of IoT products and services through strategic partnerships, market education, consumer research, and business development initiatives.

  • Intel® Internet of Things Solutions Alliance– Provides scalable, interoperable solutions that accelerate deployment of intelligent devices and end-to-end analytics.

  • IoTivity– Enables seamless device-to-device connectivity for IoT.

  • ISO/TC 204 Intelligent Transport Systems– Standardizes information, communication, and control systems in the field of urban and rural surface transportation.

  • ITU Internet of Things Global Standards Initiative– Promotes a unified approach for development of technical standards enabling the IoT on a global scale.

  • Open Connectivity Foundation* – Provides the software linking the IoT.

  • Thread– Creates the best way to connect and control products in the home.

Glamour in the Results

The unsung contributors in conference rooms forging the framework for the IoT hold the future of this technology in their hands. The decisions emerging from the standards environment will have a monumental effect on this entire industry. On top of this, we have ongoing questions about how government regulations will affect the growth and evolution of the market, how commercial interests will respond as the technologies unfold, how innovations from bright start-up companies will generate opportunities and interest, and how the ecosystem as a whole will support the activities and operations required to make IoT happen.

If there is glamour to the endeavor of establishing IoT standards, it is in the results. Like preproduction work in filmmaking, there is an endless procession of tiny, critical details that go into every project, none of which is particularly exciting on its own. The audience isn’t interested in the details—only the final result. Similarly, the standards—the foundation of the IoT—require a particular kind of dedication, an unusual amount of industry collaboration, and a spirit of invention. As the work comes together and we all drive smart cars, work in smart buildings, draw energy from a smart grid, the results of all the collaborative standards work will be realized.  

To get more deeply involved in furthering interoperability in the IoT ecosystem, consider joining the Open Connectivity Foundation, or engage with any of the standards bodies or consortia mentioned earlier.

For another perspective on the need for collaboration, this article, Collaboration is the platform for IoT success, offers more insights into the issue.

To dive more deeply into the IoT ecosystem, become a member of the Intel® Internet of Things Solutions Alliance.

 


Intel® XDK FAQs - Cordova

$
0
0

How do I set app orientation?

You set the orientation under the Build Settings section of the Projects tab.

To control the orientation of an iPad you may need to create a simply plugin that contains a single plugin.xml file like the following:

<config-file target="*-Info.plist" parent="UISupportedInterfaceOrientations~ipad" overwrite="true"><string></string></config-file><config-file target="*-Info.plist" parent="UISupportedInterfaceOrientations~ipad" overwrite="true"><array><string>UIInterfaceOrientationPortrait</string></array></config-file> 

Then add the plugin as a local plugin using the plugin manager on the Projects tab.

HINT: to import the plugin.xml file you created above, you must select the folder that contains the plugin.xml file; you cannot select the plugin.xml file itself, using the import dialg, because a typical plugin consists of many files, not a single plugin.xml. The plugin you created based on the instructions above only requires a single file, it is an atypical plugin.

Alternatively, you can use this plugin: https://github.com/yoik/cordova-yoik-screenorientation. Import it as a third-party Cordova* plugin using the plugin manager with the following information:

  • cordova-plugin-screen-orientation
  • specify a version (e.g. 1.4.0) or leave blank for the "latest" version

Or, you can reference it directly from its GitHub repo:

To use the screen orientation plugin referenced above you must add some JavaScript code to your app to manipulate the additional JavaScript API that is provided by this plugin. Simply adding the plugin will not automatically fix your orientation, you must add some code to your app that takes care of this. See the plugin's GitHub repo for details on how to use that API.

Is it possible to create a background service using Intel XDK?

Background services require the use of specialized Cordova* plugins that need to be created specifically for your needs. Intel XDK does not support development or debug of plugins, only the use of them as "black boxes" with your HTML5 app. Background services can be accomplished using Java on Android or Objective C on iOS. If a plugin that backgrounds the functions required already exists (for example, this plugin for background geo tracking), Intel XDK's build system will work with it.

How do I send an email from my App?

You can use the Cordova* email plugin or use web intent - PhoneGap* and Cordova* 3.X.

How do you create an offline application?

You can use the technique described here by creating an offline.appcache file and then setting it up to store the files that are needed to run the program offline. Note that offline applications need to be built using the Cordova* or Legacy Hybrid build options.

How do I work with alarms and timed notifications?

Unfortunately, alarms and notifications are advanced subjects that require a background service. This cannot be implemented in HTML5 and can only be done in native code by using a plugin. Background services require the use of specialized Cordova* plugins that need to be created specifically for your needs. Intel XDK does not support the development or debug of plugins, only the use of them as "black boxes" with your HTML5 app. Background services can be accomplished using Java on Android or Objective C on iOS. If a plugin that backgrounds the functions required already exists (for example, this plugin for background geo tracking) the Intel XDK's build system will work with it.

How do I get a reliable device ID?

You can use the Phonegap/Cordova* Unique Device ID (UUID) plugin for Android*, iOS* and Windows* Phone 8.

How do I implement In-App purchasing in my app?

There is a Cordova* plugin for this. A tutorial on its implementation can be found here. There is also a sample in Intel XDK called 'In App Purchase' which can be downloaded here.

How do I install custom fonts on devices?

Fonts can be considered as an asset that is included with your app, not shared among other apps on the device just like images and CSS files that are private to the app and not shared. It is possible to share some files between apps using, for example, the SD card space on an Android* device. If you include the font files as assets in your application then there is no download time to consider. They are part of your app and already exist on the device after installation.

How do I access the device's file storage?

You can use HTML5 local storage and this is a good article to get started with. Alternatively, there is aCordova* file plugin for that.

Why isn't AppMobi* push notification services working?

This seems to be an issue on AppMobi's end and can only be addressed by them. PushMobi is only available in the "legacy" container. AppMobi* has not developed a Cordova* plugin, so it cannot be used in the Cordova* build containers. Thus, it is not available with the default build system. We recommend that you consider using the Cordova* push notification plugin instead.

How do I configure an app to run as a service when it is closed?

If you want a service to run in the background you'll have to write a service, either by creating a custom plugin or writing a separate service using standard Android* development tools. The Cordova* system does not facilitate writing services.

How do I dynamically play videos in my app?

  1. Download the Javascript and CSS files from https://github.com/videojs and include them in your project file.
  2. Add references to them into your index.html file.
  3. Add a panel 'main1' that will be playing the video. This panel will be launched when the user clicks on the video in the main panel.

     
    <div class="panel" id="main1" data-appbuilder-object="panel" style=""><video id="example_video_1" class="video-js vjs-default-skin" controls="controls" preload="auto" width="200" poster="camera.png" data-setup="{}"><source src="JAIL.mp4" type="video/mp4"><p class="vjs-no-js">To view this video please enable JavaScript*, and consider upgrading to a web browser that <a href=http://videojs.com/html5-video-support/ target="_blank">supports HTML5 video</a></p></video><a onclick="runVid3()" href="#" class="button" data-appbuilder-object="button">Back</a></div>
  4. When the user clicks on the video, the click event sets the 'src' attribute of the video element to what the user wants to watch.

     
    Function runVid2(){
          Document.getElementsByTagName("video")[0].setAttribute("src","appdes.mp4");
          $.ui.loadContent("#main1",true,false,"pop");
    }
  5. The 'main1' panel opens waiting for the user to click the play button.

NOTE: The video does not play in the emulator and so you will have to test using a real device. The user also has to stop the video using the video controls. Clicking on the back button results in the video playing in the background.

How do I design my Cordova* built Android* app for tablets?

This page lists a set of guidelines to follow to make your app of tablet quality. If your app fulfills the criteria for tablet app quality, it can be featured in Google* Play's "Designed for tablets" section.

How do I resolve icon related issues with Cordova* CLI build system?

Ensure icon sizes are properly specified in the intelxdk.config.additions.xml. For example, if you are targeting iOS 6, you need to manually specify the icons sizes that iOS* 6 uses.

<icon platform="ios" src="images/ios/72x72.icon.png" width="72" height="72" /><icon platform="ios" src="images/ios/57x57.icon.png" width="57" height="57" />

These are not required in the build system and so you will have to include them in the additions file.

For more information on adding build options using intelxdk.config.additions.xml, visit: /en-us/html5/articles/adding-special-build-options-to-your-xdk-cordova-app-with-the-intelxdk-config-additions-xml-file

Is there a plugin I can use in my App to share content on social media?

Yes, you can use the PhoneGap Social Sharing plugin for Android*, iOS* and Windows* Phone.

Iframe does not load in my app. Is there an alternative?

Yes, you can use the inAppBrowser plugin instead.

Why are intel.xdk.istablet and intel.xdk.isphone not working?

Those properties are quite old and is based on the legacy AppMobi* system. An alternative is to detect the viewport size instead. You can get the user's screen size using screen.width and screen.height properties (refer to this article for more information) and control the actual view of the webview by using the viewport meta tag (this page has several examples). You can also look through this forum thread for a detailed discussion on the same.

How do I enable security in my app?

We recommend using the App Security API. App Security API is a collection of JavaScript API for Hybrid HTML5 application developers. It enables developers, even those who are not security experts, to take advantage of the security properties and capabilities supported by the platform. The API collection is available to developers in the form of a Cordova plugin (JavaScript API and middleware), supported on the following operating systems: Windows, Android & iOS.
For more details please visit: https://software.intel.com/en-us/app-security-api.

For enabling it, please select the App Security plugin on the plugins list of the Project tab and build your app as a Cordova Hybrid app. After adding the plugin, you can start using it simply by calling its API. For more details about how to get started with the App Security API plugin, please see the relevant sample app articles at: https://software.intel.com/en-us/xdk/article/my-private-photos-sample and https://software.intel.com/en-us/xdk/article/my-private-notes-sample.

Why does my build fail with Admob plugins? Is there an alternative?

Intel XDK does not support the library project that has been newly introduced in the com.google.playservices@21.0.0 plugin. Admob plugins are dependent on "com.google.playservices", which adds Google* play services jar to project. The "com.google.playservices@19.0.0" is a simple jar file that works quite well but the "com.google.playservices@21.0.0" is using a new feature to include a whole library project. It works if built locally with Cordova CLI, but fails when using Intel XDK.

To keep compatible with Intel XDK, the dependency of admob plugin should be changed to "com.google.playservices@19.0.0".

Why does the intel.xdk.camera plugin fail? Is there an alternative?

There seem to be some general issues with the camera plugin on iOS*. An alternative is to use the Cordova camera plugin, instead and change the version to 0.3.3.

How do I resolve Geolocation issues with Cordova?

Give this app a try, it contains lots of useful comments and console log messages. However, use Cordova 0.3.10 version of the geo plugin instead of the Intel XDK geo plugin. Intel XDK buttons on the sample app will not work in a built app because the Intel XDK geo plugin is not included. However, they will partially work in the Emulator and Debug. If you test it on a real device, without the Intel XDK geo plugin selected, you should be able to see what is working and what is not on your device. There is a problem with the Intel XDK geo plugin. It cannot be used in the same build with the Cordova geo plugin. Do not use the Intel XDK geo plugin as it will be discontinued.

Geo fine might not work because of the following reasons:

  1. Your device does not have a GPS chip
  2. It is taking a long time to get a GPS lock (if you are indoors)
  3. The GPS on your device has been disabled in the settings

Geo coarse is the safest bet to quickly get an initial reading. It will get a reading based on a variety of inputs, but is usually not as accurate as geo fine but generally accurate enough to know what town you are located in and your approximate location in that town. Geo coarse will also prime the geo cache so there is something to read when you try to get a geo fine reading. Ensure your code can handle situations where you might not be getting any geo data as there is no guarantee you'll be able to get a geo fine reading at all or in a reasonable period of time. Success with geo fine is highly dependent on a lot of parameters that are typically outside of your control.

Is there an equivalent Cordova* plugin for intel.xdk.player.playPodcast? If so, how can I use it?

Yes, there is and you can find the one that best fits the bill from the Cordova* plugin registry.

To make this work you will need to do the following:

  • Detect your platform (you can use uaparser.js or you can do it yourself by inspecting the user agent string)
  • Include the plugin only on the Android* platform and use <video> on iOS*.
  • Create conditional code to do what is appropriate for the platform detected

You can force a plugin to be part of an Android* build by adding it manually into the additions file. To see what the basic directives are to include a plugin manually:

  1. Include it using the "import plugin" dialog, perform a build and inspect the resulting intelxdk.config.android.xml file.
  2. Then remove it from your Project tab settings, copy the directive from that config file and paste it into the intelxdk.config.additions.xml file. Prefix that directive with <!-- +Android* -->.

More information is available here and this is what an additions file can look like:

<preference name="debuggable" value="true" /><preference name="StatusBarOverlaysWebView" value="false" /><preference name="StatusBarBackgroundColor" value="#000000" /><preference name="StatusBarStyle" value="lightcontent" /><!-- -iOS* --><intelxdk:plugin intelxdk:value="nl.nielsad.cordova.wifiscanner" /><!-- -Windows*8 --><intelxdk:plugin intelxdk:value="nl.nielsad.cordova.wifiscanner" /><!-- -Windows*8 --><intelxdk:plugin intelxdk:value="org.apache.cordova.statusbar" /><!-- -Windows*8 --><intelxdk:plugin intelxdk:value="https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin" />

This sample forces a plugin included with the "import plugin" dialog to be excluded from the platforms shown. You can include it only in the Android* platform by using conditional code and one or more appropriate plugins.

How do I display a webpage in my app without leaving my app?

The most effective way to do so is by using inAppBrowser.

Does Cordova* media have callbacks in the emulator?

While Cordova* media objects have proper callbacks when using the debug tab on a device, the emulator doesn't report state changes back to the Media object. This functionality has not been implemented yet. Under emulation, the Media object is implemented by creating an <audio> tag in the program under test. The <audio> tag emits a bunch of events, and these could be captured and turned into status callbacks on the Media object.

Why does the Cordova version number not match the Projects tab's Build Settings CLI version number, the Emulate tab, App Preview and my built app?

This is due to the difficulty in keeping different components in sync and is compounded by the version numbering convention that the Cordova project uses to distinguish build tool versions (the CLI version) from platform framework versions (the Cordova framework version) and plugin versions.

The CLI version you specify in the Projects tab's Build Settings section is the "Cordova CLI" version that the build system uses to build your app. Each version of the Cordova CLI tools come with a set of "pinned" Cordova platform framework versions, which are tied to the target platform.

NOTE: the specific Cordova platform framework versions shown below are subject to change without notice.

Our Cordova CLI 4.1.2 build system was "pinned" to: 

  • cordova-android@3.6.4 (Android Cordova framework version 3.6.4)
  • cordova-ios@3.7.0 (iOS Cordova framework version 3.7.0)
  • cordova-windows@3.7.0 (Cordova Windows framework version 3.7.0)

Our Cordova CLI 5.1.1 build system is "pinned" to:

  • cordova-android@4.1.1 (as of March 23, 2016)
  • cordova-ios@3.8.0
  • cordova-windows@4.0.0

Our Cordova CLI 5.4.1 build system is "pinned" to: 

  • cordova-android@5.0.0
  • cordova-ios@4.0.1
  • cordova-windows@4.3.1

Our CLI 5.4.1 build system really should be called "CLI 5.4.1+" because the platform framework versions it uses are closer to the "pinned" versions in the Cordova CLI 6.0.0 release than those "pinned" in the original CLI 5.4.1 release.

The Cordova platform framework version you get when you build an app does not equal the CLI version number in the Build Settings section of the Projects tab; it equals the Cordova platform framework version that is "pinned" to our build system's CLI version (see the list of pinned versions, above).

Technically, the target-specific Cordova frameworks can be updated [independently] for a given version of CLI tools. In some cases, our build system may use a Cordova platform framework version that is later than the version that was "pinned" to the CLI when it was originally released by the Cordova project (that is, the Cordova framework versions originally specified by the Cordova CLI x.y.z links above).

The reasons you may see Cordova framework version differences between the Emulate tab, App Preview and your built app are:

  • The Emulate tab has one specific Cordova framework version built into it. We try to make sure that version of the Cordova framework closely matches the default Intel XDK version of Cordova CLI.

  • App Preview is released independently of the Intel XDK and, therefore, may use a different version than what you will see reported by the Emulate tab or your built app. Again, we try to release App Preview so it matches the version of the Cordova framework that is considered the default version for the Intel XDK at the time App Preview is released; but since the various tools are not always released in perfect sync, that is not always possible.

  • Your app is built with a "pinned" Cordova platform framework version, which is determined by the Cordova CLI version you specified in the Projects tab's Build Settings section. There are always at least two different CLI versions available in the Intel XDK build system.

  • For those versions of Crosswalk that were built with the Intel XDK CLI 4.1.2 build system, the cordova-android framework version was determined by the Crosswalk project, not by the Intel XDK build system.

  • For those versions of Crosswalk that are built with Intel XDK CLI 5.1.1 and later, the cordova-android framework version equals the "pinned" cordova-android platform version for that CLI version (see lists above).

Do these Cordova framework version numbers matter? Occasionally, yes, but normally, not that much. There are some issues that come up that are related to the Cordova framework version, but they tend to be rare. The majority of the bugs and compatibility issues you will experience in your app have more to do with the versions and mix of Cordova plugins you choose to use and the HTML5 webview runtime on your test devices. See this blog for more details about what a webview is and why the webview matters to your app: When is an HTML5 Web App a WebView App?.

The "default version" of the CLI that the Intel XDK uses is rarely the most recent version of the Cordova CLI tools distributed by the Cordova project. There is always a lag between Cordova project releases and our ability to incorporate those releases into our build system and the various Intel XDK components. We are not able to provide every release that is made by the Cordova project.

How do I add a third party plugin?

Please follow the instructions on this doc page to add a third-party plugin: Adding Plugins to Your Intel® XDK Cordova* App -- this plugin is not being included as part of your app. You will see it in the build log if it was successfully added to your build.

How do I make an AJAX call that works in my browser work in my app?

Please follow the instructions in this article: Cordova CLI 4.1.2 Domain Whitelisting with Intel XDK for AJAX and Launching External Apps.

I get an "intel is not defined" error, but my app works in Test tab, App Preview and Debug tab. What's wrong?

When your app runs in the Test tab, App Preview or the Debug tab the intel.xdk and core Cordova functions are automatically included for easy debug. That is, the plugins required to implement those APIs on a real device are already included in the corresponding debug modules.

When you build your app you must include the plugins that correspond to the APIs you are using in your build settings. This means you must enable the Cordova and/or XDK plugins that correspond to the APIs you are using. Go to the Projects tab and insure that the plugins you need are selected in your project's plugin settings. See Adding Plugins to Your Intel® XDK Cordova* App for additional details.

How do I target my app for use only on an iPad or only on an iPhone?

There is an undocumented feature in Cordova that should help you (the Cordova project provided this feature but failed to document it for the rest of the world). If you use the appropriate preference in theintelxdk.config.additions.xml file you should get what you need:

<preference name="target-device" value="tablet" />     <!-- Installs on iPad, not on iPhone --><preference name="target-device" value="handset" />    <!-- Installs on iPhone, iPad installs in a zoomed view and doesn't fill the entire screen --><preference name="target-device" value="universal" />  <!-- Installs on iPhone and iPad correctly -->

If you need info regarding the additions.xml file, see the blank template or this doc file: Adding Intel® XDK Cordova Build Options Using the Additions File.

Why does my build fail when I try to use the Cordova* Capture Plugin?

The Cordova* Capture plugin has a dependency on the File Plugin. Please make sure you both plugins selected on the projects tab.

How can I pinch and zoom in my Cordova* app?

For now, using the viewport meta tag is the only option to enable pinch and zoom. However, its behavior is unpredictable in different webviews. Testing a few samples apps has led us to believe that this feature is better on Crosswalk for Android. You can test this by building the Hello Cordova sample app for Android and Crosswalk for Android. Pinch and zoom will work on the latter only though they both have:

<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes, minimum-scale=1, maximum-scale=2">.

Please visit the following pages to get a better understanding of when to build with Crosswalk for Android:

http://blogs.intel.com/evangelists/2014/09/02/html5-web-app-webview-app/

https://software.intel.com/en-us/xdk/docs/why-use-crosswalk-for-android-builds

Another device oriented approach is to enable it by turning on Android accessibility gestures.

How do I make my Android application use the fullscreen so that the status and navigation bars disappear?

The Cordova* fullscreen plugin can be used to do this. For example, in your initialization code, include this function AndroidFullScreen.immersiveMode(null, null);.

You can get this third-party plugin from here https://github.com/mesmotronic/cordova-fullscreen-plugin

How do I add XXHDPI and XXXHDPI icons to my Android or Crosswalk application?

The Cordova CLI 4.1.2 build system will support this feature, but our 4.1.2 build system (and the 2170 version of the Intel XDK) does not handle the XX and XXX sizes directly. Use this workaround until these sizes are supported directly:

  • copy your XX and XXX icons into your source directory (usually named www)
  • add the following lines to your intelxdk.config.additions.xml file
  • see this Cordova doc page for some more details

Assuming your icons and splash screen images are stored in the "pkg" directory inside your source directory (your source directory is usually named www), add lines similar to these into yourintelxdk.config.additions.xml file (the precise name of your png files may be different than what is shown here):

<!-- for adding xxhdpi and xxxhdpi icons on Android --><icon platform="android" src="pkg/xxhdpi.png" density="xxhdpi" /><icon platform="android" src="pkg/xxxhdpi.png" density="xxxhdpi" /><splash platform="android" src="pkg/splash-port-xhdpi.png" density="port-xhdpi"/><splash platform="android" src="pkg/splash-land-xhdpi.png" density="land-xhdpi"/>

The precise names of your PNG files are not important, but the "density" designations are very important and, of course, the respective resolutions of your PNG files must be consistent with Android requirements. Those density parameters specify the respective "res-drawable-*dpi" directories that will be created in your APK for use by the Android system. NOTE: splash screen references have been added for reference, you do not need to use this technique for splash screens.

You can continue to insert the other icons into your app using the Intel XDK Projects tab.

Which plugin is the best to use with my app?

We are not able to track all the plugins out there, so we generally cannot give you a "this is better than that" evaluation of plugins. Check the Cordova plugin registry to see which plugins are most popular and check Stack Overflow to see which are best supported; also, check the individual plugin repos to see how well the plugin is supported and how frequently it is updated. Since the Cordova platform and the mobile platforms continue to evolve, those that are well-supported are likely to be those that have good activity in their repo.

Keep in mind that the XDK builds Cordova apps, so whichever plugins you find being supported and working best with other Cordova (or PhoneGap) apps would likely be your "best" choice.

See Adding Plugins to Your Intel® XDK Cordova* App for instructions on how to include third-party plugins with your app.

What are the rules for my App ID?

The precise App ID naming rules vary as a function of the target platform (eg., Android, iOS, Windows, etc.). Unfortunately, the App ID naming rules are further restricted by the Apache Cordova project and sometimes change with updates to the Cordova project. The Cordova project is the underlying technology that your Intel XDK app is based upon; when you build an Intel XDK app you are building an Apache Cordova app.

CLI 5.1.1 has more restrictive App ID requirements than previous versions of Apache Cordova (the CLI version refers to Apache Cordova CLI release versions). In this case, the Apache Cordova project decided to set limits on acceptable App IDs to equal the minimum set for all platforms. We hope to eliminate this restriction in a future release of the build system, but for now (as of the 2496 release of the Intel XDK), the current requirements for CLI 5.1.1 are:

  • Each section of the App ID must start with a letter
  • Each section can only consist of letters, numbers, and the underscore character
  • Each section cannot be a Java keyword
  • The App ID must consist of at least 2 sections (each section separated by a period ".").

iOS /usr/bin/codesign error: certificate issue for iOS app?

If you are getting an iOS build fail message in your detailed build log that includes a reference to a signing identity error you probably have a bad or inconsistent provisioning file. The "no identity found" message in the build log excerpt, below, means that the provisioning profile does not match the distribution certificate that was uploaded with your application during the build phase.

Signing Identity:     "iPhone Distribution: XXXXXXXXXX LTD (Z2xxxxxx45)"
Provisioning Profile: "MyProvisioningFile"
                      (b5xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxe1)

    /usr/bin/codesign --force --sign 9AxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxA6 --resource-rules=.../MyApp/platforms/ios/build/device/MyApp.app/ResourceRules.plist --entitlements .../MyApp/platforms/ios/build/MyApp.build/Release-iphoneos/MyApp.build/MyApp.app.xcent .../MyApp/platforms/ios/build/device/MyApp.app
9AxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxA6: no identity found
Command /usr/bin/codesign failed with exit code 1

** BUILD FAILED **


The following build commands failed:
    CodeSign build/device/MyApp.app
(1 failure)

The excerpt shown above will appear near the very end of the detailed build log. The unique number patterns in this example have been replaced with "xxxx" strings for security reasons. Your actual build log will contain hexadecimal strings.

iOS Code Sign error: bundle ID does not match app ID?

If you are getting an iOS build fail message in your detailed build log that includes a reference to a "Code Sign error" you may have a bad or inconsistent provisioning file. The "Code Sign" message in the build log excerpt, below, means that the bundle ID you specified in your Apple provisioning profile does not match the app ID you provided to the Intel XDK to upload with your application during the build phase.

Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings (MyBuildSettings) has an AppID of my.app.id which does not match your bundle identifier my.bundleidentifier.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.0'

** BUILD FAILED **

The following build commands failed:
    Check dependencies
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,...

The message above translates into "the bundle ID you entered in the project settings of the XDK does not match the bundle ID (app ID) that you created on Apples developer portal and then used to create a provisioning profile."

What are plugin variables used for? Why do I need to supply plugin variables?

Some plugins require details that are specific to your app or your developer account. For example, to authorize your app as an app that belongs to you, the developer, so services can be properly routed to the service provider. The precise reasons are dependent on the specific plugin and its function.

What happened to the Intel XDK "legacy" build options?

On December 14, 2015 the Intel XDK legacy build options were retired and are no longer available to build apps. The legacy build option is based on three year old technology that predates the current Cordova project. All Intel XDK development efforts for the past two years have been directed at building standard Apache Cordova apps.

Many of the intel.xdk legacy APIs that were supported by the legacy build options have been migrated to standard Apache Cordova plugins and published as open source plugins. The API details for these plugins are available in the README.md files in the respective 01.org GitHub repos. Additional details regarding the new Cordova implementations of the intel.xdk legacy APIs are available in the doc page titled Intel XDK Legacy APIs.

Standard Cordova builds do not require the use of the "intelxdk.js" and "xhr.js" phantom scripts. Only the "cordova.js" phantom script is required to successfully build Cordova apps. If you have been including "intelxdk.js" and "xhr.js" in your Cordova builds they have been quietly ignored. You should remove references to these files from your "index.html" file; leaving them in will do no harm, it simply results in a warning that the respective script file cannot be found at runtime.

The Emulate tab will continue to support some legacy intel.xdk APIs that are NOT supported in the Cordova builds (only those intel.xdk APIs that are supported by the open source plugins are available to a Cordova built app, and only if you have included the respective intel.xdk plugins). This Emulate tab discrepancy will be addressed in a future release of the Intel XDK.

More information can be found in this forum post > https://software.intel.com/en-us/forums/intel-xdk/topic/601436.

Which build files do I submit to the Windows Store and which do I use for testing my app on a device?

There are two things you can do with the build files generated by the Intel XDK Windows build options: side-load your app onto a real device (for testing) or publish your app in the Windows Store (for distribution). Microsoft has changed the files you use for these purposes with each release of a new platform. As of December, 2015, the packages you might see in a build, and their uses, are:

  • appx works best for side-loading, and can also be used to publish your app.
  • appxupload is preferred for publishing your app, it will not work for side-loading.
  • appxbundle will work for both publishing and side-loading, but is not preferred.
  • xap is for legacy Windows Phone; works for both publishing and side-loading.

In essence: XAP (WP7) was superseded by APPXBUNDLE (Win8 and WP8.0), which was superseded by APPX (Win8/WP8.1/UAP), which has been supplemented with APPXUPLOAD. APPX and APPXUPLOAD are the preferred formats. For more information regarding these file formats, see Upload app packages on the Microsoft developer site.

Side-loading a Windows Phone app onto a real device, over USB, requires a Windows 8+ development system (see Side-Loading Windows* Phone Apps for complete instructions). If you do not have a physical Windows development machine you can use a virtual Windows machine or use the Window Store Beta testing and targeted distribution technique to get your app onto real test devices.

Side-loading a Windows tablet app onto a Windows 8 or Windows 10 laptop or tablet is simpler. Extract the contents of the ZIP file that you downloaded from the Intel XDK build system, open the "*_Test" folder inside the extracted folder, and run the PowerShell script (ps1 file) contained within that folder on the test machine (the machine that will run your app). The ps1 script file may need to request a "developer certificate" from Microsoft before it will install your test app onto your Windows test system, so your test machine may require a network connection to successfully side-load your Windows app.

The side-loading process may not over-write an existing side-loaded app with the same ID. To be sure your test app properly side-loads, it is best to uninstall the old version of your app before side-loading a new version on your test system.

How do I implement local storage or SQL in my app?

See this summary of local storage options for Cordova apps written by Josh Morony, A Summary of Local Storage Options for PhoneGap Applications.

How do I prevent my app from auto-completing passwords?

Use the Ionic Keyboard plugin and set the spellcheck attribute to false.

Why does my PHP script not run in my Intel XDK Cordova app?

Your XDK app is not a page on a web server; you cannot use dynamic web server techniques because there is no web server associated with your app to which you can pass off PHP scripts and similar actions. When you build an Intel XDK app you are building a standalone Cordova client web app, not a dynamic server web app. You need to create a RESTful API on your server that you can then call from your client (the Intel XDK Cordova app) and pass and return data between the client and server through that RESTful API (usually in the form of a JSON payload).

Please see this StackOverflow post and this article by Ray Camden, a longtime developer of the Cordova development environment and Cordova apps, for some useful background.

Following is a lightly edited recommendation from an Intel XDK user:

I came from php+mysql web development. My first attempt at an Intel XDK Cordova app was to create a set of php files to query the database and give me the JSON. It was a simple job, but totally insecure.

Then I found dreamfactory.com, an open source software that automatically creates the REST API functions from several databases, SQL and NoSQL. I use it a lot. You can start with a free account to develop and test and then install it in your server. Another possibility is phprestsql.sourceforge.net, this is a library that does what I tried to develop by myself. I did not try it, but perhaps it will help you.

And finally, I'm using PouchDB and CouchDB"A database for the web." It is not SQL, but is very useful and easy if you need to develop a mobile app with only a few tables. It will also work with a lot of tables, but for a simple database it is an easy place to start.

I strongly recommend that you start to learn these new ways to interact with databases, you will need to invest some time but is the way to go. Do not try to use MySQL and PHP the old fashioned way, you can get it work but at some point you may get stuck.

Why doesn’t my Cocos2D game work on iOS?

This is an issue with Cocos2D and is not a reflection of our build system. As an interim solution, we have modified the CCBoot.js file for compatibility with iOS and App Preview. You can view an example of this modification in this CCBoot.js file from the Cocos2d-js 3.1 Scene GUI sample. The update has been applied to all cocos2D templates and samples that ship with Intel XDK. 

The fix involves two lines changes (for generic cocos2D fix) and one additional line (for it to work on App Preview on iOS devices):

Generic cocos2D fix -

1. Inside the loadTxt function, xhr.onload should be defined as

xhr.onload = function () {
    if(xhr.readyState == 4)
        xhr.responseText != "" ? cb(null, xhr.responseText) : cb(errInfo);
    };

instead of

xhr.onload = function () {
    if(xhr.readyState == 4)
        xhr.status == 200 ? cb(null, xhr.responseText) : cb(errInfo);
    };

2. The condition inside _loadTxtSync function should be changed to 

if (!xhr.readyState == 4 || (xhr.status != 200 || xhr.responseText != "")) {

instead of 

if (!xhr.readyState == 4 || xhr.status != 200) {

 

App Preview fix -

Add this line inside of loadTxtSync after _xhr.open:

xhr.setRequestHeader("iap_isSyncXHR", "true");

How do I change the alias of my Intel XDK Android keystore certificate?

You cannot change the alias name of your Android keystore within the Intel XDK, but you can download the existing keystore, change the alias on that keystore and upload a new copy of the same keystore with a new alias.

Use the following procedure:

  • Download the converted legacy keystore from the Intel XDK (the one with the bad alias).

  • Locate the keytool app on your system (this assumes that you have a Java runtime installed on your system). On Windows, this is likely to be located at %ProgramFiles%\Java\jre8\bin (you might have to adjust the value of jre8 in the path to match the version of Java installed on your system). On Mac and Linux systems it is probably located in your path (in /usr/bin).

  • Change the alias of the keystore using this command (see the keytool -changealias -help command for additional details):

keytool -changealias -alias "existing-alias" -destalias "new-alias" -keypass keypass -keystore /path/to/keystore -storepass storepass
  • Import this new keystore into the Intel XDK using the "Import Existing Keystore" option in the "Developer Certificates" section of the "person icon" located in the upper right corner of the Intel XDK.

What causes "The connection to the server was unsuccessful. (file:///android_asset/www/index.html)" error?

See this forum thread for some help with this issue. This error is most likely due to errors retrieving assets over the network or long delays associated with retrieving those assets.

How do I manually sign my Android or Crosswalk APK file with the Intel XDK?

To sign an app manually, you must build your app by "deselecting" the "Signed" box in the Build Settings section of the Android tab on the Projects tab:

Follow these Android developer instructions to manually sign your app. The instructions assume you have Java installed on your system (for the jarsigner and keytool utilities). You may have to locate and install the zipalign tool separately (it is not part of Java) or download and install Android Studio.

These two sections of the Android developer Signing Your Applications article are also worth reading:

Why should I avoid using the additions.xml file? Why should I use the Plugin Management Tool in the Intel XDK?

Intel XDK (2496 and up) now includes a Plugin Management Tool that simplifies adding and managing Cordova plugins. We urge all users to manage their plugins from existing or upgraded projects using this tool. If you were using intelxdk.config.additions.xml file to manage plugins in the past, you should remove them and use the Plugin Management Tool to add all plugins instead.

Why you should be using the Plugin Management Tool:

  • It can now manage plugins from all sources. Popular plugins have been added to the the Featured plugins list. Third party plugins can be added from the Cordova Plugin Registry, Git Repo and your file system.

  • Consistency: Unlike previous versions of the Intel XDK, plugins you add are now stored as a part of your project on your development system after they are retrieved by the Intel XDK and copied to your plugins directory. These plugin files are delivered, along with your source code files, to the Intel XDK cloud-based build server. This change ensures greater consistency between builds, because you always build with the plugin version that was retrieved by the Intel XDK into your project. It also provides better documentation of the components that make up your Cordova app, because the plugins are now part of your project directory. This is also more consistent with the way a standard Cordova CLI project works.

  • Convenience: In the past, the only way to add a third party plugin that required parameters was to include it in the intelxdk.config.additions.xml file. This plugin would then be added to your project by the build system. This is no longer recommended. With the new Plugin Management Tool, it automatically parses the plugin.xml file and prompts to add any plugin variables from within the XDK.

    When a plugin is added via the Plugin Management Tool, a plugin entry is added to the project file and the plugin source is downloaded to the plugins directory making a more stable project. After a build, the build system automatically generates config xml files in your project directory that includes a complete summary of plugins and variable values.

  • Correctness of Debug Module: Intel XDK now provides remote on-device debugging for projects with third party plugins by building a custom debug module from your project plugins directory. It does not write or read from the intelxdk.config.additions.xml and the only time this file is used is during a build. This means the debug module is not aware of your plugin added via the intelxdk.config.additions.xml file and so adding plugins via intelxdk.config.additions.xml file should be avoided. Here is a useful article for understanding Intel XDK Build Files.

  • Editing Plugin Sources: There are a few cases where you may want to modify plugin code to fix a bug in a plugin, or add console.log messages to a plugin's sources to help debug your application's interaction with the plugin. To accomplish these goals you can edit the plugin sources in the plugins directory. Your modifications will be uploaded along with your app sources when you build your app using the Intel XDK build server and when a custom debug module is created by the Debug tab.

How do I fix this "unknown error: cannot find plugin.xml" when I try to remove or change a plugin?

Removing a plugin from your project generates the following error:

Sometimes you may see this error:

This is not a common problem, but if it does happen it means a file in your plugin directory is probably corrupt (usually one of the json files found inside the plugins folder at the root of your project folder).

The simplest fix is to:

  • make a list of ALL of your plugins (esp. the plugin ID and version number, see image below)
  • exit the Intel XDK
  • delete the entire plugins directory inside your project
  • restart the Intel XDK

The XDK should detect that all of your plugins are missing and attempt to reinstall them. If it does not automatically re-install all or some of your plugins, then reinstall them manually from the list you saved in step one (see the image below for the important data that documents your plugins).

NOTE: if you re-install your plugins manually, you can use the third-party plugin add feature of the plugin management system to specify the plugin id to get your plugins from the Cordova plugin registry. If you leave the version number blank the latest version of the plugin that is available in the registry will be retrieved by the Intel XDK.

Back to FAQs Main

5 Must Reads for April

$
0
0

Every day, our team spends hours reading the latest on app development, user experience, monetization, marketing and more. We learn new things, debate how successful a new strategy may be, and take meticulous notes on particularly insightful ideas. So when we come across a really interesting read, we like to share it.

Check out these articles to see what we thought was interesting in the world of app development in April.

Case Study - How Laura Roeder Built Her 'Edgar' App to $150,000 Monthly Revenue in 13 Months

This is an excellent study on how Laura Roeder took her “Edgar” app to mass profitability in 13 months, without ever using a “freemium” model. She implemented modern marketing strategies like email marketing and list building to grow her audience, focusing not only on initial acquisition but also user opt-in rates and user engagement. It’s not just about the app anymore – how you market it is just as important.
 

App Store Optimization - Your Guide to Hacking The App Store’s Search

Getting discovered in an app store can be daunting given the trends in today’s market. According to comScore, an average U.S. user downloads just three new apps per month, whereas data provided by Pocketgamer.biz indicates that developers submit over 1,000 apps in the Apple App Store per day. Check out this article to figure out how you can make your app stand out from the crowd today.


Market Trends - Mobile app stats & growth trends you need to know (infographic)

It’s always good to stay on top of industry trends. Take a look at this infographic to get a glimpse into what you can expect for the rest of 2016 – in the last year alone, global mobile app store downloads are up 33% and will more than double between 2015 and 2020. That’ll make a huge impact on the market, and how your app succeeds moving forward.
 

App & User Engagement - App Engagement & Growth Are The Core Metrics to Focus On

Everyone tells you to focus on analytics, but which ones should you track? As the title indicates, author Bogdan Ianatiev says app engagement rates and growth are the only two metrics you need to worry about. He gives a great overview of how app developers and marketers should focus on getting user attention through different social media channels, and that in this day and age, attention is key.
 

App Downloads - 10 App Experts Share Their Top Growth Hack for Increasing App Installs

Whether you’re launching a new app or are running a season app download campaign, this article provides great insight and numerous strategies to increase your app installs. Full of expert industry advice and resources learn more about “app went free” campaigns to leveraging “analytics and app description optimization” to your apps benefit. If nothing else, you’ll get a solid list of people to follow on Twitter for constant words of wisdom.
 

Did you read anything interesting this month? Share the link in the comments below!

Weather Research and Forecasting Model Optimized for Knights Landing

$
0
0

The Weather Research and Forecasting (WRF) Model is a numerical weather prediction (NWP) system designed for both atmospheric research and operational forecasting needs. It is made up of about a half million lines of code, predominantly in Fortran*.

WRF was first demonstrated on the prototype Intel® Xeon Phi™ Coprocessor (codenamed Knights Ferry) at the Supercomputing Conference in November 2011. WRF is the first NWP model to have been ported to and run in its entirety on Intel’s Many Integrated Core Architecture. It uses a two-level domain decomposition, first over MPI ranks and then within each MPI rank over threads (OpenMP*). This decomposition provides large amounts of hybrid MPI/OpenMP parallelism that is well-suited to the many-core architecture of Intel® Xeon Phi™ Processor x200 (codenamed Knights Landing).

The results on Knights Landing are a notable example of the value of avoiding offload programming models.

The computational cost in WRF is spread over a relatively flat profile comprising dynamics, a computational fluid dynamics (CFD) finite-volume solver using explicit finite-difference approximation, and physics modules that represent atmospheric processes such as radiative transfer, convection and other moist processes, surface land/sea surface and boundary layer effects.

The flatness of WRF’s profile argues against “offload” programming for coprocessors, which is best suited for applications where a majority of an application’s cost is over a small section of code comprising of a few thousand lines of code   Like Intel® Xeon® processors, Knights Landing supports industry standard, mature and widely supported programming models (MPI, OpenMP, and a vector ISA).  Unlike Intel® Xeon Phi™ Coprocessor (codenamed Knights Corner), Knights Landing nodes can be self-hosted avoiding the need for host/co-processor data movement.

The book (Intel® Xeon Phi™ Processor High Performance Programming, 2nd Edition – Knights Landing Edition) describes, among other topics on Knights Landing, the performance of the full WRF model using the 12km resolution Continental United States (CONUS12km) benchmark. The CONUS12km benchmark is a widely cited industry standard workload. Results are provided to explain the nearly triple speedup compared to Knights Corner. In particular, the impact of the high-bandwidth 16GB MCDRAM system on the Knights Landing node is discussed along with the benefits of the AVX-512 instruction set. Use of both all-to-all and quadrant cluster modes, with flat memory mode, are also discussed.

The CONUS12km workload is a computational-only benchmark. Therefore, we ignore the first timestep and measure performance for 149 time steps to exclude I/O and initialization costs from our measurements. Different time steps within the series cost differently; for example, 5 of the 149 steps involve radiative transfer physics costing 3.5x more than other steps on Knights Landing. Performance comparisons are based upon average time step based on wall clock time on an unloaded computational node.

More bandwidth for Knights Landing from MCDRAM is the most important factor contributing to the superior CONUS12km WRF performance on Knights Landing.  In profiling WRF CONUS12km on Knights Landing, WRF CONUS12km is a bandwidth-bound application with bursts of high demands on bandwidth.

Knights Landing is the best performing processor for the WRF CONUS12km benchmark. Knights Landing is 1.71x faster than a 2 Socket Intel® Xeon™ E5-2697v4 (codenamed Broadwell) processor and 2x faster than a 2 Socket Intel® Xeon® E5-2697v3 (codenamed Haswell) Processor. WRF CONUS12km is also exactly three times faster on Knights Landing than Knights Corner.

Overall, we found that running on Knights Landing delivered a substantial performance improvement over the previous generation Knights Corner coprocessors. This was possible only because the per-core AVX‑512 vector units in Knights Landing were able to process the data at the rate possible due to the higher bandwidth. Knights Landing does better than other processors because of its higher memory bandwidth, superior vector capabilities, and higher thread counts.

Intel® Xeon Phi™ Processor High Performance Programming, 2nd Edition – Knights Landing Edition.

 

 

Intel® Math Kernel Library (Intel® MKL) 11.3 Update 3 for Windows*

$
0
0

Intel® Math Kernel Library (Intel® MKL) is a highly optimized, extensively threaded, and thread-safe library of mathematical functions for engineering, scientific, and financial applications that require maximum performance. Intel MKL 11.3 Update 3 packages are now ready for download. Intel MKL is available as part of the Intel® Parallel Studio XE and Intel® System Studio . Please visit the Intel® Math Kernel Library Product Page.

Intel® MKL 11.3 Update 3 Bug fixes

What's New in Intel MKL 11.3 Update 3

  • Performance improvements for Intel Optimized MP LINPACK Benchmark on Intel® Advanced Vector Extensions 512 (Intel® AVX512) and second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
  • BLAS:
    • Improved small matrix [S,D]GEMM performance on Intel AVX2, Intel AVX512 and on second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
    • Improved threading (OpenMP) performance of xGEMMT, xHEMM, xHERK, xHER2K, xSYMM, xSYRK, xSYR2K on Intel AVX512, and on second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
    • Improved [C,Z]GEMV, [C,Z]TRMV, and [C,Z]TRSV performance on Intel AVX2, Intel AVX512, Intel® Xeon® product family,and on second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
  • LAPACK:
    • Updated Intel MKL LAPACK to the latest LAPACK version 3.6 specification. New features introduced in this version are:
      • SVD by Jacobi ([CZ]GESVJ) and preconditioned Jacobi ([CZ]GEJSV) algorithms
      • SVD via EVD allowing computation of a subset of singular values and vectors (?GESVDX)
      • Level 3 BLAS versions of generalized Schur (?GGES3), generalized EVD (?GGEV3), generalized SVD (?GGSVD3) and reduction to generalized upper Hessenberg form (?GGHD3)
      • Multiplication of general matrix by a unitary/orthogonal matrix possessing 2x2 structure ( [DS]ORM22/[CZ]UNM22)
    • Improved performance of LU (?GETRF) and QR(?GEQRF) on Intel AVX512 and on second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
    • Improved check of parameters for correctness in all LAPACK routines to enhance security
  • SCALAPACK:
    • Improved hybrid (MPI + OpenMP) performance of ScaLAPACK/PBLAS by increasing default block size returned by pilaenv
  • SparseBlas:
    • Added examples that cover spmm and spmmd functionality
    • Improved performance of parallel mkl_sparse_d_mv for general BSR matrices on Intel AVX2
    • Parallel Direct Sparse Solver for Clusters:
      • Improved performance of solving step for small matrices (less than 10000 elements)
      • Added mkl_progress support in Parallel Direct sparse solver for Clusters and fixed mkl_progress in Intel MKL PARDISO
  • Vector Mathematical Functions:
    • Improved implementation of Thread Local Storage (TLS) allocation/de-allocation, which helps with thread safety for DLLs in Windows when they are custom-made from static libraries
    • Improved the automatic threading algorithm leading to more even distribution of vectors across larger numbers of threads and improved the thread creation logic on Intel Xeon Phi, leading to improved performance on average

Contents

  • File: w_mkl_11.3.3.207_online.exe

    Online Installer for Windows

  • File: w_mkl_11.3.3.207.exe

    A File containing the complete product installation for Windows* (32-bit/x86-64bit development)

Intel® Math Kernel Library (Intel® MKL) 11.3 Update 3 for Linux*

$
0
0

Intel® Math Kernel Library (Intel® MKL) is a highly optimized, extensively threaded, and thread-safe library of mathematical functions for engineering, scientific, and financial applications that require maximum performance. Intel MKL 11.3 Update 3 packages are now ready for download. Intel MKL is available as part of the Intel® Parallel Studio XE and Intel® System Studio . Please visit the Intel® Math Kernel Library Product Page.

Intel® MKL 11.3 Update 3 Bug fixes

What's New in Intel MKL 11.3 Update 3

  • Performance improvements for Intel Optimized MP LINPACK Benchmark on Intel® Advanced Vector Extensions 512 (Intel® AVX512) and second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
  • BLAS:
    • Improved small matrix [S,D]GEMM performance on Intel AVX2, Intel AVX512 and on second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
    • Improved threading (OpenMP) performance of xGEMMT, xHEMM, xHERK, xHER2K, xSYMM, xSYRK, xSYR2K on Intel AVX512, and on second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
    • Improved [C,Z]GEMV, [C,Z]TRMV, and [C,Z]TRSV performance on Intel AVX2, Intel AVX512, Intel® Xeon® product family,and on second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
  • LAPACK:
    • Updated Intel MKL LAPACK to the latest LAPACK version 3.6 specification. New features introduced in this version are:
      • SVD by Jacobi ([CZ]GESVJ) and preconditioned Jacobi ([CZ]GEJSV) algorithms
      • SVD via EVD allowing computation of a subset of singular values and vectors (?GESVDX)
      • Level 3 BLAS versions of generalized Schur (?GGES3), generalized EVD (?GGEV3), generalized SVD (?GGSVD3) and reduction to generalized upper Hessenberg form (?GGHD3)
      • Multiplication of general matrix by a unitary/orthogonal matrix possessing 2x2 structure ( [DS]ORM22/[CZ]UNM22)
    • Improved performance of LU (?GETRF) and QR(?GEQRF) on Intel AVX512 and on second generation of Intel® Xeon Phi™ Product Family (codename Knights Landing)
    • Improved check of parameters for correctness in all LAPACK routines to enhance security
  • SCALAPACK:
    • Improved hybrid (MPI + OpenMP) performance of ScaLAPACK/PBLAS by increasing default block size returned by pilaenv
  • SparseBlas:
    • Added examples that cover spmm and spmmd functionality
    • Improved performance of parallel mkl_sparse_d_mv for general BSR matrices on Intel AVX2
    • Parallel Direct Sparse Solver for Clusters:
      • Improved performance of solving step for small matrices (less than 10000 elements)
      • Added mkl_progress support in Parallel Direct sparse solver for Clusters and fixed mkl_progress in Intel MKL PARDISO
  • Vector Mathematical Functions:
    • Improved implementation of Thread Local Storage (TLS) allocation/de-allocation, which helps with thread safety for DLLs in Windows when they are custom-made from static libraries
    • Improved the automatic threading algorithm leading to more even distribution of vectors across larger numbers of threads and improved the thread creation logic on Intel Xeon Phi, leading to improved performance on average

Contents

  • File: l_mkl_11.3.3.210_online.sh

    Online Installer for Windows

  • File: l_mkl_11.3.3.210.tgz

    A File containing the complete product installation for Windows* (32-bit/x86-64bit development)

Viewing all 3384 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>