Tag: android-ndk

using pre-built static libraries for Android NDK development

I am trying to build an android application that uses static libraries from some existing c++ code. However I cannot seem to get things building, here are the steps I have taken so far.. I have ndk-r5b and have built the standalone toolchain as per ndk/docs/STANDALINE-TOOLCHAIN.html. I have then used the standalone toolchain compiler (arm-linux-androideabi-g++) […]

How do you troubleshoot an Android system library crash (libwebcore.so)

My Android webview is crashing and the error dump from adb logcat tells me that libwebcore.so is the library causing the segmentation fault. How do you troubleshoot this? My initial research took me to places like this thread: How to use addr2line in Android, which in essence says to get the non-stripped version of the […]

Android L Preview does not search native libraries in “armeabi” folder (UnsatisfiedLinkError)

I have an app with 2 native libraries. 1st works much faster on ARMv7 so I have version both for ARMv7 and ARMv5. 2nd works the same on both platforms so only ARMv5 library is provided. My native library folder looks like this: /jniLibs/ | +—armeabi/ | | | +—libFirstLibrary.so | +—libSecondLibrary.so | +—armeabi-v7a/ | […]

Android – build separate APKs for different processor architectures

Is there an easy way to build separate APK files for Android for different processor architectures, with the old ANT or the new Gradle build process? My way of doing this is to build one “fat” APK with all supported native libraries included, and then splitting them into separate APK as I explained here. However, […]

OpenGL surface view scaling for different DPIs

I have a device with 800×480 res. When I create GLSurfaceView, I get an onSurfaceChanged call with 533×320 (apparently with 1.5 HDPI modifier applied) and surface is upscaled. So when I draw 1 pixel thick line is looks really bad, and I can’t have pixel-perfect rendering. What I want to have is native resolution surface […]

JNI ERROR (app bug): local reference table overflow (max=512)

I am trying to run the LibSVMAndroidClassification Android project with my own dataset. It works perfectly fine with the dataset already provided and it also works fine when I use my csv with 100 rows (which is less than 1% of original size). But when I try to go for “Train CSV” with for e.g […]

Android NDK - multlib support using gradle

My question is directed towards native Android development for 64bit Android systems. I am looking for a way to configure the support of 32bit compiled native libraries at a 64bit Android system using the gradle build system. The libraries the application should use are only available as 32bit build. It would be very time consuming […]

Eclipse-CDT fails to find stdlib symbols in NDK project

I am trying to write a simple Android application using the NDK and C++. Specifically, I’d like to use the gnustdc++ included with the newest version of the NDK (r7). The JNI library has compiled and worked perfectly fine as C, but now that I’m trying to introduce C++, I’ve run into some issues. I […]

Porting a C++ application to android

Is it possible to port a C++ application which uses the STL extensively to Android? I understand that currently the NDK does not support this, but is there any effort (open source or otherwise) underway to achieve this? If not is there a way to cross compile libstdc++ for Android? UPDATE: Ndk Revision 5 promises […]

How to set variable according to gradle flavors

I want to pass a variable test that I set differently per flavor as a define to the NDK. But for some reason he always passes the value of the last flavor. Here is the build.gradle: apply plugin: ‘com.android.library’ def test android { compileSdkVersion 23 buildToolsVersion “23.0.2” defaultPublishConfig “flavorARelease” publishNonDefault true defaultConfig { minSdkVersion 15 […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.