Thursday, January 5, 2012

Compile CCNX For Android

Get the latest Android SDK and NDK. Current Android SDK is r16 and NDK is r7.
Get the latest ccnx project from http://www.ccnx.org. Current release is 0.4.2

Set the ANDROID_SDK and ANDROID_NDK folder.


export ANDROID_SDK=~/android_tools/android-sdk-mac_x86-r16
export ANDROID_NDK=~/android_tools/android-ndk-r7
export PATH=${ANDROID_SDK}/platform-tools:$PATH


run:
${ANDROID_SDK}/tools/android

Install the android platform you want to use, currently ccnx support until Android 2.3.3.

In ccnx root folder run make, this should build wihout complaint.
goto android folder in ccnx and run make. I got error android-7 is in not my android target list. I want to compile for android 2.3.3 this is API 10. So modify all makefile under ccnx/android folder from android-7 to android-10 and recompile.

run 'make install' to install ccnx in android client or emulator. You must connect your device or run android emulator before installing.

6 comments:

  1. Hi,
    I am a student who is working on Android for a thesis on CCN.
    How do you use on Android ccngetfile ccnputfile and seeing as we only service running CCN Services?
    thanks

    ReplyDelete
  2. I copy paste java code of ccngetfile and ccnputfile into my android source code. That is pretty straight forward.

    ReplyDelete
    Replies
    1. How?
      I tried to include in the Java build path of my project the ccn0.4.2/javasrc/ and to use a ccnputfile and ccngetfile located in src/org/ccnx/ccn/utils but I get errors!
      And then where do I find ccnsendchunk? I also need this ...

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Basically I createed new Android project and copied paste those source code and import necessary libraries. You may need to import CCNX project into your workspace. I did this by click File->Import Select 'Existing Projects Into Workspace' then select ccnx root folder (mine is ccnx-0.4.2) and select all projects.

    What kind of error did you get?
    You cannot use ccnsendchunk as it is built in C code

    ReplyDelete
    Replies
    1. I do not think it's fair to import the entire folder! However you can pass me a sample file?
      It gives me an error on keystore

      Delete