-1

After reading this post I used the author's code to set up a new Cordova project in Intel XDK and used the XDK UI to add Media Capture plugin to project files.

It should open the video UI on phone on touchend event for button, allow recording and saving of video file, and then display the video in the resulting page.

Once USB debugging was set up on Android and an iOS Development Provisioning Profile was successfully added testing the app in the Debug tab (remote debugging on devices) worked for both more or less via in the Intel App Preview app. Playback is not working in iOS but that is not issue for this post. All alert() and console.log() output also function.

The issue is on the Test tab where your local project is pushed to the Intel test server and then loaded on your USB connected device in the Intel App Preview app. Everything appears to go normally on load but no JS alert() calls execute and no console.log() messages appear. And pressing button to open camera has no visible effect. The Weinre debug tag is present in code pushed but no output of any kind except on Remote tab of debugger where it says debug:false concerningly:

enter image description here

The original author told me Weinre debug tool is deprecated and should not be used. Is that accurate? Regardless I am at a loss as to why the apps will not function on the Test tab but seem to work fine on Debug tab. I am wondering if the test server version is untrusted on phone but I have two test apps working with taking and displaying photos and displaying GPS info and these are working without issue in Test tab...

Any advice most welcome.

UPDATE 2016-09-13 Tested again per comments re issues with Weinre on server end but no change. New screenshot: enter image description here

jerrygarciuh
  • 21,158
  • 26
  • 82
  • 139
  • What you're describing sounds like a mix between the Test and Debug tabs. Are you trying to open App Preview when using the Debug tab? That can work, but is not advised. Try using App Preview _without_ the USB connection. The media capture plugin is part of App Preview. However, only the _core_ _Cordova_ plugins are in App Preview, if you are using third-party plugins you will not have access to them within App Preview (that is, when using the Test tab). – xmnboy Sep 12 '16 at 16:09
  • If I misunderstood, then please rephrase the question, because it is not clear what your setup and test scenario is. – xmnboy Sep 12 '16 at 16:10
  • @xmnboy this is just test tab. Steps listed on tab are 1) Push files to test server 2) Open App Preview and scan QR code to load pushed files 3) Click begin remote debugging. The app loads fine minus the alert() output I would expect. When I click the UI button to launch Weinre debug that appears to work minus console output expected. Button clicks do not produce any of the the responses expected: camera does not open, console.log() and alert() calls do not seem to execute. – jerrygarciuh Sep 12 '16 at 20:32
  • Try it again, we had some issues with the weinre client script download that should now be resolved, that script was being truncated during the download. If you're still seeing the problems described above, post another comment. – xmnboy Sep 12 '16 at 22:38
  • @xmnboy thank you for the reply. New test, same result. Added new screenshot of Weinre Remote tab output. No other Weinre tabs have any output. – jerrygarciuh Sep 14 '16 at 02:02
  • Did you try using the "WIFI" mode, rather than the "MOBILE" mode on the Test tab? Also, try locating your weinre script tag in a different location within your app, it can be very sensitive to other JS files in your app. Sometimes it needs to be very first, sometimes in the middle, sometimes very last; depends on the app. Also, try getting the connection to work with a very simple sample, like the "hello cordova" sample, to determine if it's your app or the weinre server connection. – xmnboy Sep 14 '16 at 19:16
  • @xmnboy woohoo! That's got it working. Viewing over wifi got the app working and moving the Weinre tag into head from the end of body got the Weinre output I was expecting!! THANK YOU! Add as answer so I can award bounty? – jerrygarciuh Sep 14 '16 at 20:15

1 Answers1

1

Try using the "WIFI" mode, rather than the "MOBILE" mode on the Test tab. That usually works better.

Also, try relocating your weinre script tag to a different location within your app, it can be very sensitive to other JS files in your app. Sometimes it needs to be the first script, sometimes somewhere in the middle, and sometimes the very last script tag; just depends on the app.

Also, try getting the connection to work with a very simple sample app, to determine if it's your app or the weinre server connection that is causing the problem.

xmnboy
  • 2,314
  • 2
  • 14
  • 31