= Installation = == Pre-Compiled Debian Packages == [[CollapsibleStart(Make sure you have appropriate package repository configured.)]][[Include(Documentation/Other/RepositoryConfig)]][[Include(Documentation/Other/RepositoryConfigOml)]][[CollapsibleEnd]] The MF host protocol stack is installed with: {{{ sudo apt-get install mfclient }}} This will install the following components: * '''mfstack binary''': user level implementation of the !MobilityFirst client network stack * '''mfstack configuration files''': sample configuration file for the network protocol stack installed under ''/etc/mfstack/''. * '''libmfapi''': c/c++ api library for !MobilityFirst based applications * '''jmfapi''': java api library for !MobilityFirst based applications. The library is provided as a jar file called ''jmfapi-1.0-SNAPSHOT.jar'' which is installed under /usr/lib/mfjava/ * '''libgnrs''': c/c++ gnrs library for DMap * '''jgnrs''': java gnrs library for DMap. The library is provided as a jar file called ''jgnrs-1.0-SNAPSHOT.jar'' which is installed under /usr/lib/mfjava/ == Compiling From Source == === 1.1. Required Packages === The implementation has been tested on Ubuntu 10.04, 12.04 and 13.04, but it should work on basically any linux distribution. These are the required packages (for Ubuntu). {{{ sudo apt-get update sudo apt-get -y install git-core libpcap0.8-dev }}} === 1.2. Download MobilityFirst Sources === Git: The development versions of the prototype components can be checked out from the [https://mobilityfirst.orbit-lab.org/browser/mf MobilityFirst git repository host on orbit-lab]: {{{ git clone ssh://username@external1.orbit-lab.org/common/git/mf }}} '''Note: cloning the git repository requires setting your ssh agent to use your orbit-lab key pair.'' Set and export path of top-level folder to an env. variable 'MF_HOME' {{{ export MF_HOME=/home/username/mobilityfirst }}} === 1.3. Compiling the Network Service API Library === {{{ cd $MF_HOME/netapi/c/ make }}} === 1.4. Installing the Network Service API Library (optional) === Install the compiled application running (from the same folder as before): {{{ sudo make install }}} == 2. Android == === 2.1. Required Packages === The implementation should compatible with any ARM based device. To check out the MobilityFirst code git is required. {{{ sudo apt-get update sudo apt-get -y install git-core }}} Download the latest ndk distribution from the [http://developer.android.com/tools/sdk/ndk/index.html Android Developer website] and make sure to add the folder containing the kit to the environment PATH variable: {{{ export PATH=$PATH:/path/to/ndk/ }}} Download the Android Developer Tools from the [http://developer.android.com/tools/index.html Android Developer website]. Only the ''adb'' executable is necessary for the installation process. Enable the read/write permissions on the root and system folders of your Android device. To do so you have two options, install the application [ES File Explorer])https://play.google.com/store/apps/details?id=com.estrongs.android.pop) from the Play Store and use its root explorer function to change permissions or you can run the following commands: {{{ $ adb shell $ su $ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system (Replace /dev/block/mtdblock3 & /system with appropriate device path and mount point, as obtained from cat /proc/mounts) }}} Finally, to install the library the Android device will need to be rooted. === 2.2. Download MobilityFirst Sources === Git: The development versions of the prototype components can be checked out from the [https://bitbucket.org/nkiran/mobilityfirst/wiki/Home MobilityFirst git repository on BitBucket]: {{{ git clone https://username@bitbucket.org/nkiran/mobilityfirst.git }}} Set and export path of top-level folder to an env. variable 'MF_HOME' {{{ export MF_HOME=/home/username/mobilityfirst }}} === 2.3. Compiling the Network Service API Library === To run the compiling script provided, is necessary to add the ''ndk-build'' command contained in the ndk package to the system PATH variable. {{{ PATH=$PATH:/path/to/ndk/folder/ }}} Compile the Network Service API Library : {{{ cd $MF_HOME/netapi/android/ ./compile }}} === 2.4. Installing the Network Service API Library === Install the compiled libraries and executable found in the generated bin folder. To install the libraries is necessary to have write permissions on the Android root and system folders. {{{ adb push libmfapi.so /system/lib/ }}}