On Wednesday, July 18, 2012 11:47:08 AM UTC+1, MMM wrote:
I have already developed Windows application with native code. I have some queries for porting this application to android by using NDK as follows:
1) I am using data structures like list, queue etc in my application. Do ndk supports such data types? Which headers I need to include?
Read android-ndk/docs/CPLUSPLUS-SUPPORT.html and then choose the right C++ support you need. For example, if you choose "gnustl" the you can see from the table in the document that you get:
- C++ Exceptions
- C++ RTTI
- Standard Library
So just include the header files you are using now, but you need to check its license terms.
2) In my application, I am using Window APIs like createHandle, CloseHandle, also thread specific waitForSingleObject. How to port these methods to ndk native code for android?
All the functions you mention are Win32/64 specific, you need to remove them and and change the code using them. There is no simple/trivial answer, Android should have the equivalent functionality but there is no simple 1-to-1 mapping of API calls. For example, "waitForSingleObject" is probably going to be replace with one of the Posix functions in <pthread.h>, but which one and what parameters it takes you will need to workout referencing how you called "waitForSingleObject".
There are plenty of docs and help available if you search for things like "linux thread locking" etc.
Thanks