Changes between Version 107 and Version 108 of AndroidPort


Ignore:
Timestamp:
Jan 16, 2012, 4:15:27 AM (12 years ago)
Author:
Anders Feder
Comment:

Added TOC

Legend:

Unmodified
Added
Removed
Modified
  • AndroidPort

    v107 v108  
     1[[TOC]]
     2
    13This page documents how 0 A.D. might be ported to the [http://www.android.com/ Android] platform.
    24
    3 = Plan =
     5== Plan ==
    46 1. Set up a generic Android NDK build environment.
    57 1. Find and adapt replacement libraries for every dependency in the PC edition.
     
    1315The port is very much a work-in-progress. If you are technically inclined and want to help out, follow the steps under the [http://trac.wildfiregames.com/wiki/AndroidPort#Implementation Implementation] section below, read the error output generated by ndk-build, and suggest solutions here or [http://www.wildfiregames.com/forum/index.php?showtopic=15436&view=getnewpost&hl=&fromsearch=1 on the forum].
    1416
    15 = Target devices =
    16 == Samsung Galaxy Nexus ==
     17== Target devices ==
     18=== Samsung Galaxy Nexus ===
    1719 * 720×1280 px at 316 ppi
    1820 * !16:9 aspect-ratio
     
    2022 * Multi-touch, capacitive touchscreen
    2123
    22 = Design =
    23 == User Interface ==
     24== Design ==
     25=== User Interface ===
    2426Due to the vastly different controls and form factor, the whole user interface of the game needs to be rethought.
    2527
     
    3234A ''pinch'' is a two-point touch motion.
    3335
    34 === Camera ===
     36==== Camera ====
    3537Camera panning is performed by applying inverse swipe gestures on the screen:
    3638
     
    6264 * Touch position on minimap - pan camera to the corresponding position on the map.
    6365
    64 === Entity selection ===
     66==== Entity selection ====
    6567If an entity is tapped once, the entity is immediately selected.
    6668
     
    7779When touch is released in selective mode, all units within the drawn bounding box are selected.
    7880
    79 === Unit orders ===
     81==== Unit orders ====
    8082If a position in the game world is double tapped, the selected unit is ordered to apply its context-dependent primary action to the position.
    8183
    8284 * Double-tap position in game world - apply selected unit's primary action to the position.
    8385
    84 == Libraries ==
     86=== Libraries ===
    8587Android-compatible replacements must be found for all [http://trac.wildfiregames.com/wiki/BuildInstructions#Linux the dependencies of the PC edition]. This is what we have so far:
    8688
     
    108110 * ''FCollada'' - We use a customised/bugfixed version of FCollada, so a port of the standard version of FCollada probably wouldn't work. Our own version has no significant dependencies other than libxml2.
    109111
    110 = Implementation =
     112== Implementation ==
    111113The [http://en.wikipedia.org/wiki/Dalvik_(software) Android VM] allows applications to call methods implemented in native code through [http://docs.oracle.com/javase/7/docs/technotes/guides/jni/index.html JNI]. This means we have to produce a native shared library which implements the core game functions as a set of methods (functions) which can be called from a [http://en.wikipedia.org/wiki/Shim_(computing) shim] running in the standard Android VM. The native library and the shim can then be packaged and distributed together as a standard Android application.
    112114
    113 == Setting up your workstation ==
     115=== Setting up your workstation ===
    114116For everything short of actually running the application, we will use a PC workstation. This section will assume your workstation runs Ubuntu Linux, but the steps should be relatively easy to adapt to other platforms. Begin by setting up a working directory for the project:
    115117
     
    146148$ sudo apt-get install ant subversion
    147149}}}
    148 == Setting up an Android project ==
     150=== Setting up an Android project ===
    149151All data that is to be compiled and packaged into the Android application must be assembled in an Android ''project''.
    150152
     
    190192Then save the file and exit the text editor.
    191193
    192 == Installing replacement libraries ==
     194=== Installing replacement libraries ===
    193195The Android platform provides only a very minimal C++ runtime support library (/system/lib/libstdc++) and corresponding headers for it in the NDK. To compile the game with the Standard C++ Library, we have to explicitly instruct `ndk-build` to compile against the STL runtime.
    194196
     
    250252$ make
    251253}}}
    252 .
    253 
    254 == Building the application ==
     254=== Building the application ===
    255255The native library (i.e. the actual game) is built by running the `ndk-build` command in the project directory, e.g.:
    256256