Tag: android-ndk

Android std and stl support

I am playing with android ndk. I am using Window Vista with cygwin (latest version). I compiled and launched the hello world jni sample on my phone. It is working. The code is (is a .cpp file): #include <string.h> #include <jni.h> extern “C” { JNIEXPORT jstring JNICALL Java_org_android_helloworld_HelloworldActivity_invokeNativeFunction(JNIEnv* env, jobject javaThis); }; jstring Java_org_android_helloworld_HelloworldActivity_invokeNativeFunction(JNIEnv* env, […]

How to create a thread in Android NDK?

Can anyone tell me how to create a thread in Android NDK? I’m porting some C++ code from Win32 to Android, I don’t know what’s the NDK API corresponding to Win32 API AfxBeginThread(). Thanks!

build android with clang instead of gcc ? and the clang stl lib instead of gnustl lib?

Am trying to build an android ndk app using clang instead of gcc, for know i have tried this in the Android.mk NDK_TOOLCHAIN_VERSION := clang LOCAL_CLANG :=true LOCAL_LDLIBS := -lc++_static LOCAL_CFLAGS := -std=c++11 and in the Application.mk APP_PLATFORM := android-9 APP_STL := libc++_static APP_CPPFLAGS := -fexceptions -frtti APP_ABI := armeabi-v7a but it always give me […]

Android NDK UnsatisfiedLinkError – a surprising reason

Update 8/7/2013: The problem is solved now, but the reason for the error was quite unexpected, all the usual suspects for such errors were eliminated on start, and I have learned something new. See my answer below. I’m pretty desperate here. Have an Android app with a native library, from where I call a method. […]

Android NDK, keeping live C++ objects

I’ve got a following problem. I want to write an Android application, which uses my legacy C++ classes. I have to keep a C++ object alive during the whole application lifetime. I wrote a similar application in C# and solved the problem by passing a pointer to a C++ class to C# and storing it […]

Can't run a Java Android program with Valgrind

I’m trying to start a Java program under Valgring like this (in adb shell): valgrind am start -a android.intent.action.MAIN -n com.me.myapp/.MainActivity I’m getting: ==2362== Memcheck, a memory error detector ==2362== Copyright (C) 2002-2012, and GNU GPL’d, by Julian Seward et al. ==2362== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==2362== Command: am […]

Error: Program “/ndk-build.cmd” is not found in PATH

I am stuck with this following problem on Mac OS X(10.8.4) and eclipse JUNO since 10 days and I haven’t found anything working on web. I have downloaded and unzipped the android NDK. After that, I have set the NDK location in ‘Android’ option in preferences menu. I want to run a sample opencv code(https://www.dropbox.com/s/6s3qwkon9v67u5z/tutorial-3-native.rar) […]

Android Crashlytics ndk; values of NdkOut and NdkLibsOut in build.gradle

I have integrated Crashlytics, Fabric into my app, the sdk related crashes are reported successfully. For the ndk part, i have followed instructions from the blog; The Wait is Over: Launching Crashlytics for Android NDK, but the ndk crashes aren’t being reported. My doubt is, because other parts are sufficiently clear, i’m not providing the […]

Fixing Eclipse errors when using Android NDK and std::vector

I’m using eclipse to develop an android app that also uses the ndk. I vectors in my app and I’ve done the necessary stuff to get them by including APP_STL := stlport_static In my Application.mk Everything is working fine it compiles and runs but Eclipse keeps giving me errors when I use the vectors std::vector<int> […]

Why is gcc emmiting code aligned to a 2 byte boundary for the ARM instruction set?

I’m inspecting the assembly language output of a C program I’m compiling for the ARM Android platform using GCC (the version included in the Android NDK). I’m specifying the ARM instruction set which are 4 bytes in length rather than THUMB, but surprisingly, the emmited assembly language code is aligning functions to a 2 byte […]

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