Game Development Reference
In-Depth Information
Chapter
13
Porting to Android
How cool would it be if you could build and run your SpriteBuilder app on Android
devices?
You can!
There's no Java or C++ programming needed to do so. SpriteBuilder provides the neces-
sary plugins for Xcode to cross-compile your Objective-C code to Android. In fact, all the
libraries used by SpriteBuilder apps—most notably Cocos2D-Swift, Chipmunk2D and Ob-
jectAL—are fully compatible.
How Does Android Support Work?
The development of SpriteBuilder and Cocos2D since version 3 (Cocos2D-Swift to be pre-
cise) is done by Apportable developers. Apportable is a company that specializes in cross-
compiling Objective-C code for the Android platform.
Originally, Apportable was a command-line tool for expert programmers and game-devel-
opment studios. The company has since created Xcode plugins and integrated them into
SpriteBuilder, beginning with version 1.3. You'll know them as SpriteBuilder Android plu-
gins.
You will also often hear of a framework called BridgeKit . This is the framework that Ap-
portable created to give Objective-C developers access to Android, Java, and Verde fea-
tures and functionality. Verde is a lightweight equivalent of UIKit. You'll find the
BridgeKit reference here: http://static.apportable.com/documentation/
BridgeKit/html/ .
The SpriteBuilder Android plugins work by cross-compiling Objective-C code to native
ARM and x86 code that runs on Android devices. There are no emulation layers, virtual
machines, or Java translations done. The resulting executable will typically run faster than
if the same code were written in Java using Google's Android SDK.
Search WWH ::




Custom Search