Changes between Version 107 and Version 108 of AndroidPort
- Timestamp:
- Jan 16, 2012, 4:15:27 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AndroidPort
v107 v108 1 [[TOC]] 2 1 3 This page documents how 0 A.D. might be ported to the [http://www.android.com/ Android] platform. 2 4 3 = Plan=5 == Plan == 4 6 1. Set up a generic Android NDK build environment. 5 7 1. Find and adapt replacement libraries for every dependency in the PC edition. … … 13 15 The 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]. 14 16 15 = Target devices=16 == Samsung Galaxy Nexus==17 == Target devices == 18 === Samsung Galaxy Nexus === 17 19 * 720×1280 px at 316 ppi 18 20 * !16:9 aspect-ratio … … 20 22 * Multi-touch, capacitive touchscreen 21 23 22 = Design=23 == User Interface==24 == Design == 25 === User Interface === 24 26 Due to the vastly different controls and form factor, the whole user interface of the game needs to be rethought. 25 27 … … 32 34 A ''pinch'' is a two-point touch motion. 33 35 34 === Camera===36 ==== Camera ==== 35 37 Camera panning is performed by applying inverse swipe gestures on the screen: 36 38 … … 62 64 * Touch position on minimap - pan camera to the corresponding position on the map. 63 65 64 === Entity selection===66 ==== Entity selection ==== 65 67 If an entity is tapped once, the entity is immediately selected. 66 68 … … 77 79 When touch is released in selective mode, all units within the drawn bounding box are selected. 78 80 79 === Unit orders===81 ==== Unit orders ==== 80 82 If a position in the game world is double tapped, the selected unit is ordered to apply its context-dependent primary action to the position. 81 83 82 84 * Double-tap position in game world - apply selected unit's primary action to the position. 83 85 84 == Libraries==86 === Libraries === 85 87 Android-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: 86 88 … … 108 110 * ''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. 109 111 110 = Implementation=112 == Implementation == 111 113 The [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. 112 114 113 == Setting up your workstation==115 === Setting up your workstation === 114 116 For 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: 115 117 … … 146 148 $ sudo apt-get install ant subversion 147 149 }}} 148 == Setting up an Android project==150 === Setting up an Android project === 149 151 All data that is to be compiled and packaged into the Android application must be assembled in an Android ''project''. 150 152 … … 190 192 Then save the file and exit the text editor. 191 193 192 == Installing replacement libraries==194 === Installing replacement libraries === 193 195 The 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. 194 196 … … 250 252 $ make 251 253 }}} 252 . 253 254 == Building the application == 254 === Building the application === 255 255 The native library (i.e. the actual game) is built by running the `ndk-build` command in the project directory, e.g.: 256 256