Changes between Version 14 and Version 15 of AndroidBuildApp


Ignore:
Timestamp:
Nov 19, 2014, 4:26:14 PM (9 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AndroidBuildApp

    v14 v15  
    22= How To Build BOINC Apps for Android =
    33
    4 This document describes how to build BOINC apps
    5 for Android devices.
     4This document describes how to build BOINC apps for Android devices.
    65
    76== Requirements ==
     
    98 * Android NKD: http://developer.android.com/tools/sdk/ndk/index.html
    109 * BOINC on Android build script: [http://boinc.berkeley.edu/trac/browser/boinc-v2/android]
    11 
    1210
    1311== Used versions ==
     
    2119 * Android platform 2.3.4
    2220
    23 
    2421== Compatibility with BOINC on Android ==
    2522
    26 BOINC on Android runs on all Android devices, regardless of its CPU architecture.
    27 Possible architectures are ARM, x86 and MIPS. ARM is the predominant platform on Android.
     23BOINC on Android runs on all Android devices, regardless of their CPU architecture.
     24Possible architectures are ARM, x86 and MIPS.
     25ARM is the dominant platform on Android.
    2826
    2927Even within ARM, higher ABIs or specific CPU capabilities might only be available
     
    4139==  Setup NDK toolchain ==
    4240
    43 To set up a custom cross compilation toolchain,
    44 see article at AndroidBuildClient
    45 
     41To set up a custom cross compilation toolchain, see AndroidBuildClient.
    4642
    4743== Build script ==
     
    6460}}}
    6561
    66 It's often useful to build a single executable that can support the vfp or neon libraries & instructions, and then use the BOINC APP_INIT_DATA and HOST_INFO structures to find the capabilities of the host and call the appropriate optimized routines (member variable 'p_features' e.g. strstr(aid.host_info.p_features, " neon "). 
     62It's often useful to build a single executable that can support the vfp or neon libraries & instructions,
     63and then use the BOINC APP_INIT_DATA and HOST_INFO structures
     64to find the capabilities of the host and call the appropriate optimized routines
     65(member variable 'p_features' e.g. strstr(aid.host_info.p_features, " neon "). 
    6766
    68 You can do this by selectively compiling using the above options, into separate small libraries that you link into the single executable, and use C++ namespaces to separate similar function calls.  Refer to the boinc/client/Makefile.am and client/whetstone.cpp, and client/cs_benchmark.cpp files for an example of how to do this.
     67You can do this by selectively compiling using the above options,
     68into separate small libraries that you link into the single executable,
     69and use C++ namespaces to separate similar function calls.
     70 Refer to the boinc/client/Makefile.am and client/whetstone.cpp, and client/cs_benchmark.cpp files
     71 for an example of how to do this.
    6972
    70 == Fortran on Android NDK (optional build) ==
     73== Position-independent executables (PIE) ==
     74Starting with version 4.1, Android supports '''position-independent executables''' (PIE).
     75Starting with version 5.0, PIE is mandatory - Android will refuse to run native executables
     76that are not PIE.
    7177
    72 Note that the Android NDK currently does not have a fortran compiler distributed with it.  But it is possible to build GNU Fortran (gfortran) libraries for ARM/Android using the information at [http://danilogiulianelli.blogspot.co.uk/2013/02/how-to-build-gcc-fortran-cross-compiler.html]
     78You can build PIE apps by including in your Makefile:
     79{{{
     80LOCAL_CFLAGS += -fPIE
     81LOCAL_LDFLAGS += -fPIE -pie
     82}}}
     83
     84== FORTRAN on Android NDK (optional build) ==
     85
     86The Android NDK currently does not have a FORTRAN compiler distributed with it.
     87But it is possible to build GNU Fortran (gfortran) libraries for ARM/Android using the information at
     88[http://danilogiulianelli.blogspot.co.uk/2013/02/how-to-build-gcc-fortran-cross-compiler.html]
    7389
    7490== Example ==
    75 Setup the environment: [http://boinc.berkeley.edu/trac/browser/boinc-v2/samples/example_app/build_android.sh]
     91Setup the environment:
     92[http://boinc.berkeley.edu/trac/browser/boinc-v2/samples/example_app/build_android.sh]
    7693
    7794Android Makefile: [http://boinc.berkeley.edu/trac/browser/boinc-v2/samples/example_app/Makefile_android]