22 August 2014
From the Forum — Issue #34
Welcome to the latest installment of From the Forum. In this series, guest blogger Alex Jackson highlights outstanding threads from the Corona Forum. The goal is to bring attention to the most captivating, interesting, and thought-provoking discussions taking place in our very own backyard.
Please visit the forum to join these conversations or start your own!
1. Yet another EventDispatcher
In Corona, having Runtime listeners and listeners based on display objects are very useful when coupled with OOP methodology. However, it can be limiting in the same way, as there are cases where you want multiple objects to communicate states with each other. Corona provides us with APIs to develop custom events so that we can send information to and from different parts of our code.
Developer qwidave has come up with his own custom event library which he has titled EventDispatcher. The idea is, predictably, to give the ability to send custom events from listeners. It’s got some extra bells and whistles that have been thrown in from the conversion to Lua from ActionScript, so it’s worth checking out to get some new ways to get things done in Corona.
Head to the original thread to find the link to the API documentation and to find some samples. Don’t forget to say thanks!
2. CRUD database example
There are many cases where we need to prototype setups, configurations and functionality while making them scalable and extensible enough for several different projects. We all have our snippets, shortcuts and favorite modules that handle the simplier of our needs, without needing to reinvent the wheel every single time we want to start a new project.
It’s been a while since we talked about developer ksan, but he’s back with an extremely useful sample of a CRUD database. For those of you who aren’t familiar (including me!) CRUD stands for Create, Read, Update and Delete. The idea here is that you can keep an database updated (either locally or by using the Coronium server implementation) and have a nice, stable frontend with which users can interact.
I don’t want to spoil the ending, so check out the original thread below. The more well-developed and strong, shared code is available to the Corona community, the better all of our apps and games will become! If you have something you want to share, don’t hesitate to post to the forum!
3. Subscription model for Android
Auto-renewal subscriptions have been a feature chased by Corona developers for some time. The subscription model has many benefits that aren’t on offer by an IAP program, but programmatically, it’s difficult to implement.
Developer Rune7 felt the same way, but still felt like the idea had merit. Engaging in a conversation on the way one could implement a subscription-based service with Corona. It involves some fancy footwork and some knowledge of token expiration on Android and the catch of not being able to use auto-renewable subscriptions on iOS, but the methods are discussed and has been confirmed to work!
Go ahead and check out the the original thread to find out how you can incorporate subscription services with your app. Have your own method? Let us know in the forum!
Alex Jackson is an indie developer and the founder of Panc Software, specializing in retro-style gaming. He has created several mobile applications, enjoys long walks on the beach, pixel art, and reading the Corona forums. Contact him by email or follow him on Twitter: @pancsoftware. Check out his new game Crosstown Smash on iOS, Android, and Amazon devices!