Porting a C/C++ program into Android
I am attempting to put my C++ program onto an Android phone but have run into several problems with the library linking. It seems most of the useful information I find on this topic through google is outdated (motz) or simply does not account for the complexity of my program. I have been able to run simple C programs but fail when attempting to use libraries outside of Android's Bionic/libc.
So my questions are:
- Is it possible to port pre-existing *.so libraries onto Android? If so, how could I do this without seg faulting?
- Should I be using the CodeSourcery compiler (arm-none-linux-gnueabi-*)?
- How can I work around the lack of a seperate pthread library?
Please help me out! Thanks.
You can't use pre-existing *.so files because they need to be compiled for Android. In order to create an *.so for Android you need to use their NDK, which is already set up to build the correct format so you don't need to worry about arm-none-linux-gnueabi or anything. If you want to use a library that isn't available on Android you'll need to build it yourself using the NDK. I had to do this with the STL.
Please refer to the following :
This should answer you some queries...