![]() To add support to Intel architecture, you simply need to add x86 to the list. As I was only targeting armv5 and armv7 before, my variable was set like this: ![]() You need to open the jni/Application.mk in an editor and update the APP_ABI variable (it’s the one defining the different targets). It’s very easy to support as you simply need to include a new compilation target. Overall, it will be a better experience for your users. If you compile your code for x86, your application will run faster on Intel devices and will consume less battery. Even if the x86 devices are doing an amazing job at interpreting ARM code, it’s a shame to not use their full capacity. By consequence, these devices must interpret ARM code via a virtual machine. Devices powered with x86 architecture can’t run ARM code obviously (as they are different architectures). It’s automatically managed by the system - your APK is containing both versions and when your users launch your application, the most appropriate code will be used. Thanks to the NDK, you can compile your code for different architectures - armv5 for old Android devices and armv7 for newer ones. Like many C++ developers, I was only targeting ARM architectures (armv5 and armv7). The majority of Android devices are powered by ARM chips. But when you are developing in C++ like myself, you have to compile your code for specific architectures. This doesn’t matter for applications developed in Java because it’s an interpreted language. Nowadays, you can find different CPU powering Android devices (ARM, Intel x86…). It’s now possible to create an Android application using only C++ (no Java), but I don’t recommend it because sometimes you’ll want to use third parties Java APIs (to display banner ads for example). In my engine, the Java code is kept to a bare bones minimum (mostly the communication with the system) and never changes from one game to the other. When you develop natively for Android, the NDK is compiling your C++ code into a library that can be integrated in the Java project thanks to the JNI interface. Obviously, I’m still using a bit of specific code for each platform (Java, Objective C, DirectX.), but I keep this code to a strict minimum and it never gets mixed with the game code. For managing file format (jpeg, ogg, zip…), I’m using a different C/C++ library available with its source code so I can recompile on any platform. To reach this little miracle, my engine is only using standard C++ code and cross-platforms APIs (OpenGL, OpenAL, OpenSL…). Usually, it only takes a few minutes because everything is 100% compatible across all the different platforms. To port my games to the other platforms, I simply need to copy the resources (source code and data) and recompile using the dedicated tools chain (ADT-NDK with Android, XCode for iOS and OSX.). I’m developing almost exclusively under Win32 with Visual Studio Express (for speed and ease of use purpose). To develop my games, I’m using my own technology: a C++ multi-platforms engine (Android, iOS, BB10, Win32 and OSX). ![]() I’ll describe my experience with the process and hopefully will get you interested to do the same. Recently, during an Intel CodeFest, I optimized all my games for Intel Architecture and it was dead simple. My games are available on a few platforms including Android. I’ve been working in this field for the last 18 years and in 2008, I’ve setup my own solo game studio: Ovogame. I’m Jean-Claude Cottier, a video game industry veteran. ![]()
0 Comments
Leave a Reply. |