DEVELOPERS BLOG

Live QML Coding is Finally Here!

CASCADES / 01.09.14 / sabdelsayed

Happy New Year!

With a brand new year, I’m happy to introduce to you a brand new Cascades API and a brand new Momentics IDE feature that was conceived and developed by the TAT Developer Experience team. Introducing: the DevelopmentSupport API and the Cascades Development Support feature of the Momentics IDE version 2.0!

This is the much awaited combination that will allow you to see updates to your QML assets in the Momentics IDE directly on your running app, without the need to rebuild and rerun the application. Live QML coding will not only allow you to reduce the development turnaround time, but will also allow you to plan, design and redesign your scene graph more easily.

Here’s a quick summary of what you need to do to start benefiting from this awesome feature:

  • First, make sure you update your Momentics IDE to version 2.0 available here and your BlackBerry 10 Native SDK API level to 10.2 as described here.
  • Next, in the Momentics IDE enable the Cascades Development Support feature by going in Windows to Window->Preferences > BlackBerry > check the “Send QML files to device on save” checkbox.
  • Next, add some relevant code to your Cascades project that basically listens for changes in the QML files in the assets folder and sends the updated files to the running app on the device. You can do this in one of two ways: by adding some code snippets to your ApplicationUI class as explained on the DevelopmentSupport API documentation, or by adding and creating an instance of the stand-alone QMLBeam custom class available through the DevSupportTemplate sample available on Github. For the details on how to use this template in your app, checkout the new documentation section on Updating QML live on a target.
  • Finally, compile and run your application. Et voilà! Any updates you make to your QML assets will now show instantly to your running app with a click of the “Save” button.

Start using the newly added feature right now! It will take you just a few minutes to incorporate into your app, and will conveniently save you valuable development time. Let me know if you have any comments or questions in the comments’ section below, or send me a tweet on @SamarAbdelsayed. I’ll be happy to respond to you.

About sabdelsayed