@Diederik Thanks for the support, glad the example helped you out!
You should be using an editor that has JSHint syntax validation support. Here is a list of JSHint plugins for various editors. It truly would be cumbersome if you were waiting to discover small syntax errors only after running your app on a device!
The Ripple Emulator that is bundled with the Ionic Generator aims at emulating some of the device specific hardware that the plugins communicate with seems promising and might work for a handful of Cordova plugins, but it’s not fully operational just yet.
The Cordova plugins contain Objective C, Java, C#, etc, code that runs on a mobile device, and a glue layer that provides JavaScript interfaces for communicating with the hardware. This means that in the absence of full hardware emulation, you have no choice but to run your application on a physical device and monitor logs just like you would with the Chrome DevTools, etc, console.
If this is your first time developing mobile apps, I can understand how it might seem like a tedious task at first, but if at the end of the day you’re needing to use device specific hardware, the Ionic Generator provides a few helpful tasks to make launching your app on a device less of a pain.
For instance, when I was building an NFC enabled Android application, I had to test it out on a physical device that had NFC support. Running grunt cordova && grunt run:android
from the command line took about 30 seconds on my machine and allowed me to quickly test new NFC plugin related code. All grunt cordova
does is skip the build process and copy over all your app/
assets as they are (no minification, obfuscation, concatenation). This should hopefully speed up your workflow.
In your question about network connectivity above, it would definitely be a good idea to handle faulty responses from your API regardless. Using the plugin could give you supplemental information on why the response might have failed, allowing you to better communicate to the user what might have gone wrong.
Happy hacking!