Issue
So, I have a little C library. I want to make this library available to other devs that develop native C code in android (other libraries, native apps etc).
What's the best way to go? I don't really have much clue yet, trying to figure all this out.
I've read that there are two paths to go with the NDK: using Android.mk and using create-standalone-toolchain -- is this correct? How does each one of these works? Is there a third way without the NDK, and should this be used now that the NDK is available?
** This may have been asked before, but I understand things have changed since the release of the NDK, as a lot of posts I find seem obsolete.
Solution
this question can have a Huge answer, I will try to be as brief as possible.
Using the Android NDK, make a new android project, create a JNI folder, and create an Android.mk file, in it, make two libs, one being your lib, exported as a shared lib and the other, a jniwrapper that will test it. Here is an example of how it was done by a guy for his own lib.
You can make a shared lib by compiling with the standalone toolchain, here is an article on the subject and also take a look at the curl Readme for android, it explains how to compile curl for Android using the standalone toolchain, I believe it's the better way to do it, and also to easier for you since you will use the cross-compiler in a regular fasion...
Answered By - Tancho
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.