Unlocking the SQL Yoga Library

Now that you have the blank To-Do application open in the IDE we can get started with SQL Yoga. First I will show you how to register the SQL Yoga library. The SQL Yoga library must be unlocked once per session. That means that each time your application launches sqlyoga_register should be called. Doing so will remove the demo limitations of the library.

Edit application Stack Script

In the GLX Application Framework code that runs when your application launches is stored in the application stack script. Edit the script of the application stack.

sqlyoga_register

SQL Yoga is incorporated into your application as a library stack named libSQLYoga. The GLX Application Framework takes care of the loading and putting in use of the sql_yoga.rev stack. All you need to worry about is unlocking the library each time your application launches.

To unlock SQL Yoga add a call to sqlyoga_register in the glxapp_initializeApplication handler and pass in your email and registration key. The glxapp_initializeApplication message is only called once when your application first launches so it is a good place to place the sqlyoga_register command.

Notice that in the code the result of sqlyoga_register is stored in theError but nothing is done with theError afterwards. If SQL Yoga is unable to validate the email/key combination then the error will not be empty. Use the error to help troubleshoot why your registration information was not accepted.

What if I don't have a SQL Yoga registration key? Don't worry, SQL Yoga will run in demo mode if it isn't registered. In demo mode no more than 10 rows of data will be returned and a dialog will appear every 10 minutes reminding you that you are in demo mode.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.