With Google making a splash on the Mobile/Handheld Summit at GDC - thanks in part to giving out free Droids and Nexus Ones - Jack Palevich's talk about Bringing your games to Android was well attended.
The core of the talk concerned the process of bringing existing games to Android; the effective title therefore being Porting your games to Android.
In most cases, this will see C/C++ code being ported, although Palevich pointed out that developers don't need to use native code for Android games. You can use the Android Dalvik (Java) virtual machine for many types of games especially puzzle and strategy.
Making the most
For developers who want to maximise their performance on Android, there's the Native Development Kit (NDK), which enhances the basic Android SDK.
The new version of the NDK has been released, with NDK r3 supporting OpenGL ES 2.0 for the first time.
However, there are a number of issues developers have to be aware of. For one thing, the NDK is based on the GNU (Linux) toolchain so if you're developing on Windows, you have to install the Cygwin package.
As for the porting process itself; it works something like this.
Convert the game to a shared library
Port to the NDK APIs
Compile using NDK
Write a small Java app to call shared library
Package into a game APK (Android's deployment zip file format)
Most of these - changing your build system, porting the game engine, libraries and art assets - should be straightforward. Porting platform APIs calls such as DirectX to OpenGL ES is harder, while non technical features such as reworking controls for touchscreen were pointed out as being one of the largest potential issues.
Taste of Java
Developers will also have to spend time creating the interface between their C/C++ code and the Java Dalvik virtual machine shell which Android uses for deploying games on device and via the Android Market.
Most of this can be copied from the sample code provided via the Java Native Interface, which is the standard way for a Java virtual machine to call C/C++ APIs.
As an example of how the porting process works, Palevich provided details of how he ported glQuake to Android. This required 200 news of Java code, 2,500 lines of new C++ code.
You can find more details, and the code, on the website.
News
Contributing Editor
A Pocket Gamer co-founder, Jon is Contributing Editor at PG.biz which means he acts like a slightly confused uncle who's forgotten where he's left his glasses. As well as letters and cameras, he likes imaginary numbers and legumes.
Related Articles
Top Stories
Feature
2 hours, 12 minutes ago
Hot Five: AppLovin revenue surges 48% Y/Y, Plarium and Big Fish up for sale, and a look inside Merge Mansion's growth
Feature
4 hours ago
55 top mobile games in soft launch: Squad Busters, Battle Guys: Royale, Plants vs. Zombies 3, LEGO Hill Climb Adventures, and more
Events
Digital Dragons | Europe | May 19th |
GamesBeat Summit 2024 | North America | May 20th |
Mobidictum Meetup Tallinn May 2024 | Europe | May 21st |
Nordic Game Spring 2024 | Nordic | May 21st |
Impact 2024 - Indie Games | May 23rd | |
MomoCon 2024 | North America | May 24th |
Morocco Gaming Expo | Africa | May 24th |
For The Win 2024 | Europe | May 29th |
Popular Stories
Feature
4 hours ago
55 top mobile games in soft launch: Squad Busters, Battle Guys: Royale, Plants vs. Zombies 3, LEGO Hill Climb Adventures, and more
Interview
May 13th, 2024
"Web3’s promise of decentralisation offers a fresh perspective on how games can be developed, played, and valued"
Feature
May 14th, 2024