-
Notifications
You must be signed in to change notification settings - Fork 133
How are bindings to existing native frameworks generated?
If you're looking for a binding to a popular 3rd party library, it maybe already be done by the RoboPod project. For a list of current supported libraries take a look at: https://github.com/MobiVM/robovm-robopods/issues/1
bro-gen is a Ruby script that generates RoboVM bindings semi-automatically. You need to write a YAML mapping file for the library to generate the binding. For details head over to our fork of bro-gen which works with the current RoboVM version https://github.com/MobiVM/robovm-bro-gen
For some examples of YAML mapping files take a look at the config files for the iOS Cocoatouch or UIKit bindings in this repository https://github.com/MobiVM/robovm/tree/master/compiler/cocoatouch/src/main/bro-gen Those mappings are automatically generated with our bro-gen fork.
Generate Admob Bindings with bro gen Tutorial
For small to medium sized libraries it maybe feasible to write the bindings manually. For a simple example binding take a look at the bindings to the SVGgh library https://github.com/florianf/robopod-ghs-svg.
The original RoboVM documentation has a nice introduction to the binding mechanism used by RoboVm https://github.com/MobiVM/robovm/wiki/The-Bro-Java-to-Native-Bridge
-
CGRect
andCGSize
method parameters should always be annotated with the@ByVal
annotation. - Bro doesn't support
float
, always use adouble
annotated with@MachineSizedFloat
@Method(selector = "asImageWithSize:andScale:")
public native UIImage asImageWithSize(@ByVal CGSize maximumSize, @MachineSizedFloat double scale);
- Developer Guide
- Changelog
- What we're currently working on and where you can help
- F.A.Q.
- Are non libGDX iOS apps supported?
- Is there a debugger available?
- How are bindings to existing native frameworks generated?
- Who is behind this project?
- Are there any alternatives to RoboVM?
- Can RoboVM be built on Linux?
- My app is crashing without a stacktrace, what should I do?
- Is XCode interface builder supported?
- Memory Management Guide
- Howto Create an Asset Catalog for XCode 9 Appstore Submission?
- Generate Admob Bindings with bro gen Tutorial