This post is a part 23 of Intel XDK Complete Tutorial post series.
We can easily find if the app is currently running in emulator or device by the below code snippet
document.addEventListener("intel.xdk.device.ready",onDeviceReady,false);
function onDeviceReady(evt)
{
if (intel.xdk.isnative==true)
{
// Application is running on native device
console.log("Running on a native device");
}
if (intel.xdk.istest==true)
{
// Application is running in app.lab
console.log("Running in app.lab test");
}
}
function onDeviceReady(evt)
{
if (intel.xdk.isnative==true)
{
// Application is running on native device
console.log("Running on a native device");
}
if (intel.xdk.istest==true)
{
// Application is running in app.lab
console.log("Running in app.lab test");
}
}
Leave a Reply