Hi everybody,
I'd like to share with the community, my experience of porting Poco on the Android platform.
No, it's not a joke, since Google release its NDK, you can build C/C++ libs to be use with your Java app.
More precisely, it's a custom version of the NDK that allow you to build C++ code with exceptions, rtti and stl support.
You can find the version and more details at Dmitry Moskalchuk website.
So, as you may know, the Android platform is based on a Linux kernel (2.6.x) and Google version of the standard C libraries (Bionic).
This re-coded version is quite light compared to the standard glibc because of some removal. So, here come problems.
I already succeed to build Poco foundation as a static library with the NDK toolchain but I had to remove a few things :
('--' means removed sources)
* File_Unix::setSizeImpl() : temporary turn empty due to missing 'truncate()' function in 'unistd.h'
* -- NamedEvent, -- NamedMutex : missing 'sys/sem.h'
* -- RWLock : missing typdefs in 'sys/types.h' (like 'pthread_rwlock_t')
* No FPEnvironment (there's no floating point env on default ARM architectures)
* No SharedMemory : missing 'shm_open' and 'shm_unlink' in 'sys/mman.h)
* -- TextConverter, -- TextEncoding : missing RWLock
* -- TextIterator, ASCIIEncoding : missing TextConverter and TextEncoding
* -- Latin1Encoding, -- Latin9Encoding, -- StreamConverter : missing TextEncoding
* -- UnicodeConverter, -- UTF8Encoding, -- UTF16Encoding, -- UTF8String : missing TextConverter
* -- Glob : missing TextIterator
* Thread_POSIX::setStackSizeImpl : set size to 0 (as if PTHREAD_STACK_MIN not defined) because of missing PAGE_SIZE definition
I built Poco Foundation with flags '__arm' (default is little_endian) as NDK toolchain only build libs for ARM targets and as Android
phones are (almost) all using such architecture. I also set 'POCO_NO_FPENVIRONMENT', 'POCO_NO_SHAREDMEMORY' and define
'POCO_OS_FAMILY_UNIX'.
After all, I'd like to have some feedback on this. Does somebody can give me some piece of advice to improve this results ?
I'd like to hear about the Posix thread typedefs too. Even if Google remove a lot of original functionnalities, I hope I can
build RWLock and dependencies, by emulating (or something), theses (maybe like in this old Android project).
Thanks for your help.





