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
Apr 24th, 2024
48 top mobile games in soft launch: Squad Busters, CSR 3, Plants vs. Zombies 3, LEGO Hill Climb Adventures, and more
Feature
Apr 24th, 2024
Mobile Mavens: Analysts share insights on Embracer Group's "rapid dissolution", "mature" split and nervy future
Events
App Promotion Summit London | Europe | Apr 25th |
Esports Future Summit | Middle East | Apr 27th |
Dubai GameExpo Summit 2024 | Middle East | May 1st |
The MENA Games Industry Awards 2024 | Middle East | May 2nd |
GameDev Atlantic 2024 | May 4th | |
Mobidictum Meetup Berlin May 2024 | Europe | May 7th |
Mobidictum Meetup Tallinn May 2024 | Europe | May 21st |
Israel Mobile Summit 2024 | Middle East | Jun 6th |
Popular Stories
News
Apr 23rd, 2024
Supercell’s Squad Busters soft launches today with over 100,000 Google Play downloads
Feature
Apr 24th, 2024