Porting study
Table of contents
Port completed and published on the Android market
Toolchain
WarMUX will probably build in native code using the NDK, then wrapped in java code, requiring a JDK and the Android SDK.
Status: confirmed.
JDK
I don't know if the OpenJDK is ok, trying with Sun's JDK (1.6 update 20 as of writing).
Status: using Sun JDK 1.6 update 22.
Android SDK
Available here.
Status: OK.
NDK
aka Native Development Kit. Provides the crosscompiling toolchain.
Status: OK. codesourcery toolchain can be adapted to do this.
ant
Seems needed. Requires setting ANT_HOME and JAVA_HOME without space, quotes or the like in the full pathname.
Status: confirmed.
Dependencies
Provided by google
Seem to build as static lib.
- libxml2: check, current is 2.7.3
- libpng: check, current seems to be 1.2.38
- libjpeg: check, current seems to be 6b
Status: confirmed, the libs are now integrated to the build system (in build/android/jni) with local modifications to target either Android or our own requirements.
SDL
Note that the following section list a package having numerous bits relevant to this.
-
SDL for 0xdroid: relies on lots of external stuff (framework 0xdr0id?) -
Another SDL 1.2 port: relies on lots of external stuff (framework, skia) - SDL port with H/W acceleration: see below.
Status: Using pelya's version (last link) with great success.
Around SDL
The important thing is this topic about Alien Blaster, which features the following important libs:
- SDL_image 1.2.10 supporting jpeg and png; those are not included so one has to expect they are from the above google offerings
- SDL_mixer 1.2.11 + ogg based on tremor (better arm implementation exist AFAIK)
- SDL_ttf (2.0.9) and freetype (2.3.12)
- stlport might be also needed, as NDK doesn't seem to have STL (libstdc++ / libsupc++, with <30Ko, seem to be place holders)
Only investigating sdl_gfx left. Problematic though, probably low performance.
Author has switched to SDL 1.3 but SDL 1.2 still is OK.
Status: all libs from pelya's work. Using SDL 1.2 in S/W mode.
i18n: drop for now
Checked:
- android C library does not seem to offer the classical gettext stuff
- The Java parts use XML resources which do not seem to handle plural forms
Status: extracted libintl from gettext and integrated it to our build system. Used by pelya's in its SDL port. Gotcha: Android C lib doesn't have a implementation of setlocale really useful, it has to be workarounded in our code.
To drop?
Essentially issues around network play & co: too many dependencies, problems around data plan, ...
- curl: mainly to fetch data from url, therefore used for update availability, server list, ...
- fribidi: depends on NLS
Status: fribidi not integrated. curl replaced by use of JNI to call Android's stuff.
Problems
- Memory & screen size => resample resources & co
- Audio: crappy speaker + increased CPU requirement for ogg decoding => downsample / reencode audio, in essence same solution as for memory constraint
- i18n support: deactivated for now
- network: SDL_net is ok, but need to check on curl.
- Controls...
- Code: make a svn branch / new module ?
Status:
- Memory: improved internal efficiency in general, particular tweaks for Android (like directly outputting to RGB565); resources not resampled
- Audio: reencoded as listed above
- i18n support: on
- Network: SDL_net ok, curl replaced by JNI calls
- Controls: important work to add a control toolbar
- Code: integrated into build/android with build system not using autotools; lib/warmux/WMX_config_android.h needs updates matching those of autotools defines
Wrap-up, action points
Port complete and published to the Android Market
This page has been seen 5359 times
Tools
Contribute