we are now developing some features with c/c++ for android client.
So we will use android NDK - r8 to compile our code.
We use libuv also in our code.
Unfortunately, android NDK cannot complie libuv correctly. All the terms started with 'pthread_'cannot be recognized.
Anyone has idea or hint? Thanks a lot.
The support for android is not yet in mainline libuv, but I know of at least two patch-sets to fix it:
As implemented in rust
As a recently submitted pull-request
While I can't speak of the latter (seemingly very good quality), I can tell you that the former is currently being used for the Android port of rust and servo.
Related
I have been having tough time in finding a IDE or Editor which can help me easily modify the Android's C/C++ classes (mainly the classes under frameworks/base/core/jni)?
All the sites point to using Eclipse for development. But the dependencies were not resolved for C/C++ files. Java related dependencies are correctly resolved and the project is good enough to view the source files without any errors.
Right now, I just browse the C/C++ code in Eclipse CDT and make changes, compile using regular AOSP make commands and push it to my custom ROM. I am working on device drivers related work, so cannot use Emulator to test the changes :(
Two queries:
Is there a way, I can get content assist for Native C/C++ code for Android Source code ?
Is there any easy way to edit/build/run the native libraries quickly on Device ?
Any pointers will be highly appreciated.
You are on the right track. You build AOSP from terminal, but use IDE for browse/edit/debug sessions.
What worked for me is creating a big eclipse C/C++ project containing everything under frameworks/base. Use it for browsing/editing/debugging using all the helpers that eclipse provides.
Please check Debugging Android native applications to understand AOSP debugging.
I also have this problem! My solution is to re-set NDK path in "local.properties".
When i use default ndk path (ex: ndk.dir=C:\Users\%user\AppData\Local\Android\Sdk\ndk-bundle sdk.dir=C:\Users\%user\AppData\Local\Android\Sdk ) , I will have the same problem. So I download other NDK (from google official web-site) ,and set "ndk.dir", and I sloved.
You can try it~ maybe helpful for you.
ps. I use NDK version:14 , will happen this. I use v13 or v12 will solved.
I have a custom made C (cross-platform) application. An OpenVPN variant. I want to compille this for the Android version with NDK.
It compiles under Linux. Does this mean i can easily compile it for Andoird too with the NDK? And if so, how can i communicate with my library through Java code (the normal Android SDK)?
I'm not really that far yet to do the actual implementation part. But i'd like to know what i can expect in advance.
So if you have any experience with the NDK and have any tips/pointers for me, then you'd really help me alot. Like, things i should look out for when working with the NDK. Compile settings etc.
Thanks for any help.
My Openvpn for Android application is open sourced. See https://github.com/schwabe/ics-openvpn/ Since you wrote that you are using an OpenVPN variant looking at the Android.mk files of my project might help you.
I was installing the last ADT version on eclipse and there's some NDK plugins (https://dl-ssl.google.com/android/eclipse/). Does anybody know what is does? Does it allow eclipse do compile native code? How do you use it?
I can't find any documentation out there.
NDK is a toolset that allows you to write part of your android app using native code in languages such as C and C++. Many developers will probably not need this for android development, however, for accessing certain libraries and optimizing performance it can be useful.
Check out a description here:
This page explains how to build Native Applications using the NDK plugins
I am a newbie in android development but having plans to become an active developer
I had a c++/Java library called Wt. I need to install this library on android.
http://www.webtoolkit.eu/wt
Do I need to port the source code of library?
If yes please point to me a good resource to start with.
Expecting a good helping hand from this community
It is possible to use native C/C++ code in Android applications, using the Android NDK (Native Development Kit)
And it is apparently possible to compile wt for Android, so hopefully not much porting to do!
See http://redmine.emweb.be/projects/wt/wiki/Installing_Wt_on_Android
Are the Linux capabilities (libcap.so) library available for use with Android? If not, how can I compile it?
I would like to use the capabilities-related API in sys/capabilities.h, which is included with the NDK. But when I try to call functions like cap_get_proc(), I get "undefined reference" error.
I would imagine that using this api would go way, way beyond the contract in the Android framework. It might work on some devices, but not on others.
In fact, there's no guarantee, afaik, that Android even runs under Linux. For example, the new Blackberry devices run Blackberry's proprietary OS, but still run Android apps.
Finally, the version of Linux that most Android devices run is a highly-stripped-down version. They didn't include any features that the Android API doesn't need. If Android doesn't need libcap, then it's probably not included.
Perhaps you could tell us exactly what it is you're trying to do.
Here is the link - https://github.com/scopichmu/libcap-for-Android. This is original libcap (was cloned from https://kernel.googlesource.com/pub/scm/linux/kernel/git/morgan/libcap) with supporting of android ndk build. You can build now libcap.so, setcap and getcap for android.
Lots of discussion out there on this topic... google around a bit:
http://permalink.gmane.org/gmane.comp.handhelds.android.ndk/4075
Here someone compiled it and described:
http://blog.umitproject.org/2011/05/libpcap-for-android.html