***ADDED RUDIMENTARY ANDROID SUPPORT. PERFORMED SOME BASIC TESTING. APPEARS TO WORK.***
**Posted a fix to the build instructions below. BE SURE TO CHECK IT OUT AS IT FIXES THE LINKING PROCESS**
So i finally got tired of waiting for 39DLL to be ported, so i decided to do it myself. It hasn't been extensively tested but it should work. I have added instructions for building it in Ubuntu (and other Debian based OS's)
So without further ado, HERE is is
You can also just simply download the binaries from HERE if you don't want to compile. Again the lib has been tested with Ubuntu 10.04 and Android 4.0 so I cannot guarantee support for other operating systems (although, since I use POSIX interfaces, it SHOULD work without any issues on most distributions). The Android lib is compiled for Android Froyo (2.2) and above ONLY. If you need a version for an earlier Android, you'll need to compile it yourself. Just change the 'APP_PLATFORM' value in the Application.mk file and build. Consult THIS chart for an API (APP_PLATFORM) to Android version chart. (Although, if you need an earlier version, I think it's time to upgrade phones as Froyo is really the basic necessity for any real games anyway...)
Complete instructions HERE
1. Make sure build-essential AND g++ is installed.
2. Cd to the source directory
3. execute the following FOR EACH cpp file: g++ -fPIC -c -o obj/<INSERT CPP FILE NAME WITHOUT .CPP HERE>.o <INSERT CPP FILE NAME HERE>
so an example would be:
g++ -fPIC -c -o obj/main.o main.cpp
4. Then execute the following: g++ -shared obj/*.o -o 39dll-4-linux.so
And thats it! you have your .so linux shared library! As a note, you can also run ./make-linux and it'll run the commands for you!
1. Make sure the NDK is installed and ndk-build is on your path. You will also require the Android SDK with its tools and platform -tools on your path
2. CD to the project root dir if you are not already there.
3. Simply execute the following command: ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application.mk
And thats it! you have your .so Android shared library!
NOTE: If you get the following error: 'Android NDK: There is no Android.mk under ./jni' then you are in the wrong directory (probably android-src). MAKE SURE you are in the ROOT of the source tree
Please let me know how it works!
PS I'm working on getting it to build with Code::Blocks and also making a makefile. Please check back often with my GitHub as there will be patches, improvements, and better instructions there as I make them.
PPS The code is compatible with 39dylib and 39dll as it has the same method calls (i.e you use it the same way).
PPPS Forgot to add: Licensed under the Apache 2.0 license.
Edited by nick, 27 October 2012 - 06:44 AM.