I would like to use OpenSSL with Netty 4.1.17 on Android 4.x. The maven builds of netty-tcnative include only the x86_64 implementations. Is there documentation on how to build netty-tcnative for Android runtime environments?
I have the Android NDK installed, but I'm not sure how to configure the netty-tcnative build to use it. And presumably I need to build x86_32 as well as various ARM targets?
Honestly we never tried this and I am not sure it will work. That said it should be as easy as calling mvn clean package but again I am not sure if this will work. We also ship a dockerfile in the repository which will include all needed native dependencies etc.
Related
I am trying to debug a C++ Android application using Android NDK r20.
The project used to use the old way of building using ndk-build and the android.mk file.
Now the project is migrated to using gradle and cmake. Because of this, the ndk-gdb script no longer works, since it uses the old build system which expects an android.mk file.
So how am I supposed to debug from the command line using the latest ndk along with a gradle/cmake build system? Is there a new script that is provided?
ndk-gdb doesn't know how to do it out of the box right now. You can set up some symlinks in a gradle project to make the directory layout match a standalone ndk-build project which will let ndk-gdb work. See https://android.googlesource.com/platform/ndk/+/refs/heads/master/samples/NdkGdbSample/ for an example.
ndk-gdb doesn't work at all with CMake though.
See https://github.com/android-ndk/ndk/issues/1024 (I assume that's actually you that filed it). I don't know when we'll be able to do it, but what's described there is essentially what we'll do. We'll keep the existing script, get it to work with gradle projects, and (eventually) switch it to lldb under the covers.
Using Android Studio is your best bet for native debugging on Android right now.
I am building a custom app in Android AOSP and added it under packages/apps/Car/MyApp
Currently, the only way that I know how to integrate it into the build process is to create a Makefile Android.mk. Since adding dependencies/3rd party libraries with that approach is very tedious I would prefer being able to do it via gradle.
Is there any known solution how to use gradle as the build system for the app and trigger it with the Android.mk so it is still included in the overall build?
You can build it with gradle, and write Android.mk for your built apk. For adding prebuilt apk as system/privilege app, you can visit the stackoverflow question How to include prebuilt APK into AOSP with platform privileges
I am trying to build a .so for android and I want to build with address sanitizer but the only instructions I see are for Android NDK based Makefiles, but I am using the newer endorsed CMake setup. Just adding the flag -fsanitize=address wasn't enough as the clang runtime library was missing.
what is the correct thing to add in my CMakeLists for Android built libraries?
You also need to prepare your device as described in documentation. You have to run asan_device_setup script from NDK. It will put asan .so on the device.
I'm using the Android SDK as a standalone version (since I don't like IDEs very much).
However, now I wanted to use the Support Libraries and downloaded them with the ./android tool. And I checked that the /extras/android/support/v4/android-support-v4.jar exists.
Yet, my compiler doesn't seem to recoginize them (error: package android.support does not exist).
I believe that I have to get them in my classpath somehow, but have no idea how this should work (on the android page it is only explained for IDEs).
Any suggestions?
While the Android Support library documentation focuses on the two main IDEs, the documentation on command-line projects has instructions on how to reference an Android library project.
I needed to specifically get the support libraries (a jar file) to be included in a legacy ant-based Android build, and I wasn't able to get the command line suggested by the links from CommonsWare to work (specifically, the suggestions from https://developer.android.com/tools/projects/projects-cmdline.html#ReferencingLibraryProject required that I actually have a full project to reference.)
As it turns out, all I had to do was put the support library jar (eg: android-support-v4.jar) in the project's lib directory and everything worked. That may be specific to the ant build I'm using, but I think it's the same build file that the google tools used to generate.
For the past 3 weeks I've played heavily with Android Maven build process. For the most part I find it a much better experience than Eclipse but have a few questions I'd like answered:
Is there a way to make Eclipse work with APKLIB files without importing the project into Eclipse?
Using Maven is there a way to push the APK to the device without uninstalling the application? Using mvn android:deploy uninstalls the APK and installs a new one.
I've yet to get the Android JavaDoc to work well in IntelliJ, any solutions?
Does IntelliJ work well with the NDK?
I'm open to any tips in the best build process for the platform as it will be what I use moving forward. Should I go Ant or Maven?
APKLIB support in Eclipse is still not fully there. Use m2eclipse and m2eandroid and maybe help with patches for m2eandroid.
mvn android:deploy can install an apk to the device (or all attached devices). mvn android:run can start it. undeploy and redeploy work as well.
the maven android sdk deployer can also deploy the source and it should hook up fine with intellij and the maven integration
NDK and Intellij - not for writing code but the build process via Maven will work just fine also in Intellij..
Last but not least.. you should definitely NOT go ant. Either Maven or use the new, upcoming Gradle build. Don't waste time on the old (and soon to be deprecated) Ant build and all its problems.