Native Extensions for OpenFL are the things which bind OpenFL applications with the native platform it is running on. There are some extensions provided from OpenFL itself. If you go to OpenFL repository on github, you can find for yourself extensions, such as In-App Purchase and Google AdMob.
Previously it was a lot to do to make an extension for yourself. But as OpenFL and Android platform matured, the getting started with extensions became easier.
Here is a tutorial in detail about the making of Extensions.
There are 2 steps to it.
create
lime create extension MyExtension
Make it ready to use
lime rebuild MyExtension android
Or, if you are calling
rebuild
from inside the extension folderlime rebuild . android
Thats all for an extension to be ready to use in an OpenFL Android Application.
To use the extension in your OpenFL project, add this to your project.xml
as below.
<include path="../relative/path/to/MyExtension" />
And then, from inside your project, you can call the methods as MyExtension.myMethod()
.
I have written down some of my own extensions for Android.
The example implementation for the extnsions are present here.
Happy Coding.