Project

General

Profile

Actions

Android » History » Revision 4

« Previous | Revision 4/6 (diff) | Next »
Yi Huang, 12/23/2014 01:43 PM


Android

To run cross-compiled NFD binary on rooted Android device, there are several steps:

Preparation:

  1. A rooted Android device. (It has to be rooted or no one can run binaries copied to sdcard from command line. It is possible to use an Android application wrapper to carry and run native binaries on unrooted device. I have not test that yet since we need to do debugging on command line and wrapper is just too complicated for debugging.)

  2. Get cross-compiled NFD binary (there is a prepared package called "nfd-android.tar.gz")

  3. Get Android SDK. (I use adb "shell" to open up a shell to run NFD)

  4. Enable development mode on the Android device.

Steps to run NFD on rooted Android devices:

  1. untar the package. You should get nfd-android directory from this step.

  2. Copy the directory possible that you have the permission to adb push to /data/local/ already. In this case, go to step 6). To do this, you can:

    a. Use "adb push" command; or

    b. Use other applications like "Android File Transfer" on OS X.

  3. On terminal, type "adb shell" to get a shell on Android phone.

  4. Type su to switch to root user. (You might need to click "allow" on your phone to grant super user privilege if you have never done so.)

  5. Copy binary from sdcard to /data/local/nfd-android. (You must use cp, mv won't work for this case.)

  6. cd to /data/local/nfd-android. Use "chmod 700 ./bin/*" on all binaries to make them executable. (syntax like "u+x" won't work on Android.)

  7. Create directory ".ndn" under /data/local/nfd-android. And then copy ./etc/ndn/client.conf to .ndn directory

  8. Run nfd binary with environment variable HOME pointing to /data/local/nfd-android. For me, I ran "HOME=/data/local/nfd-android ./bin/nfd --config ./etc/ndn/nfd.conf"

Steps to run NRD after NFD is running:

  1. Make sure you did step 7 from the steps to run NFD.

  2. "HOME=/data/local/nfd-android ./bin/nrd --config ./etc/ndn/nfd.conf"

Steps to register prefix using nfdc:

  1. Make sure you did step 7 from the steps to run NFD.

  2. For example, "HOME=/data/local/nfd-android ./bin/nfdc register /ndn/edu/arizona tcp4://128.196.203.36:6363"

    Note: DNS resolution for android is not working. So please only use IP addresses (i.e. tcp4://hobo.cs.arizona.edu:6363 won't work).

Running other applications is very similar. Prepare correct configuration file and then run the binary with correct HOME path.

Updated by Yi Huang over 5 years ago · 4 revisions