OpenFL Blog on Android Extensions [IDEA]

rob1221

  • *
  • Posts: 9471
This seems to be implemented already.  Check the Admob extension for an example.

http://www.openfl.org/blog/2013/10/04/evolving-the-android-extension-api/
Quote
Similar to other native platforms, OpenFL supports C and C++ native extensions for Android.

In order to take advantage of certain SDKs or Android platform features, however, you may need to extend your AndroidManifest.xml, place hooks into the Activity events, or post callbacks to the native thread (where your Haxe code is running). These conspire to make Android (hands-down) the most complicated platform for native extensions.

We are excited to announce there are improvements coming to the Android Extension API.

First, the development version of our “openfl-tools” library now has support Android Library projects. This allows the Android SDK tools to merge multiple AndroidManifest.xml files, and helps modularize your code better. These dependencies will be compiled together when a user creates an OpenFL application for Android.

We have also added an Extension API in Java, which allows easy access to the main Activity, a handler to make calls back to the native code thread, and hooks into the onCreate, onDestroy (and other assorted) Android Activity events. This system will allow multiple Android-targeted extensions without modifying the GameActivity.

Together, these improvements should make it possible to write Java-based extensions for Android that are able to live together. No more overriding of templates. We appreciate your feedback and are excited about what this will enable.

Jon, can this be implemented with Stencyl?

« Last Edit: September 13, 2014, 01:41:20 pm by rob1221 »

Jon

  • *
  • Posts: 17529
Yes, we'll get to it once the fundamentals are fixed up.

GeorgeN

  • Posts: 859

GeorgeN

  • Posts: 859
Any news on this?

rob1221

  • *
  • Posts: 9471
It seems to be already implemented, although I don't know when that happened.  Check the Admob extension for an example.

Abliblablobla

  • *
  • Posts: 524
Yes, I am using the Android Extension API. I think I briefly talked about it in one of my journal posts: it was quite difficult to figure out how to use the Extension API since there is almost no documentation for it. When I discovered how to use it, I thought about writing a quick guide so that other interested users would know where to start from, but I completely forgot to write this quick guide. I hope to have some time in the next few days to write something. In the meanwhile you can take a look at the AdMob Extension 3.0. If you have questions, feel free to ask them.
.: BuruBuru :.