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
May 17th, 2024
New release roundup: The best new mobile games from a battle royale to a console classic remake
Feature
May 16th, 2024
Behind the scenes: How adding sandwich offers to an idle merge game boosted three metrics at once
Events
Valencia Indie Summit 2024 | Europe | May 16th |
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 |
Popular Stories
Feature
May 14th, 2024
53 top mobile games in soft launch: Squad Busters, Battle Guys: Royale, Plants vs. Zombies 3, LEGO Hill Climb Adventures, and more
Feature
May 13th, 2024
Hot Five: Dubai's new Gaming Visa, April's mobile game charts, and Xbox studio closures
News
May 10th, 2024