The problem usually falls into the following categories
1) rhoapi-modules.js not properly inserted into their HTML/ERB views
2) Not including the right combinations of build.yml settings. Did you know that the rhoapi-modules.js file is dynamically built based on your application settings and target operating system? For example, you may have expected the 'Sensor' API to be included in a default project setup, but you actually have to include 'Sensor' in your build.yml extensions list. If you did not include that, then the rhoapi-modules.js file will not include the Rho.Sensor object and you will get a lot of 'null references' JS errors.
1) Improper use of the API - trying to access a method or callback parameter that does not exist
2) An actual bug in our code - yes it is beta ;-)
There is a much better to realize these issues as well as learn about the API's without having to write a lot of code - enter Weinre.
Weinre allows you to use the web developer tools that you are most comfortable with for 'typical' web pages...but remotely from your laptop to your device.
- Remote debugging of your application running on a real device
- Check to make sure you have properly included the Rho JS APIs
- Inspect objects that are returned from callbacks
- Try any API you wish to make sure you have the syntax and expected returns right before you start your coding efforts
- Install Weinre
- Create a basic project in RhoStudio
- Get your laptop and device on the same WiFi network
- Launch your app on the device and remotely debug/inspect it from your browser running in your laptop.
Watch the tutorial on how to use this tool in conjunction with RhoMobile 4.0