How to unwind the stack to get backtrace for the specified stack pointer (SP)?

In order to to get stacktrace of code which caused SIGSEGV instead of stacktrace of the signal handler, you have to get ARM registers from ucontext_t and use them for unwinding. But it is hard to do with _Unwind_Backtrace(). Thus, if you use libc++ (LLVM STL) and compile for 32-bit ARM, better try precompiled libunwind, … Read more

How to install android ndk in linux?

The Standard Way Android’s NDK now ships as an self extracting executable. You likely need to set the executable bit: $ chmod +x android-ndk-r10c-linux-x86_64.bin $ ./android-ndk-r10c-linux-x86_64.bin The above will cause the NDK to extract into the current working directory. Manual Extraction Since the .bin file is really just a 7-Zip self extracting archive, you can … Read more

How to find the Android version name programmatically?

As suggested earlier, reflection seems to be the key to this question. The StringBuilder and extra formatting is not required, it was added only to illustrate usage. import java.lang.reflect.Field; … StringBuilder builder = new StringBuilder(); builder.append(“android : “).append(Build.VERSION.RELEASE); Field[] fields = Build.VERSION_CODES.class.getFields(); for (Field field : fields) { String fieldName = field.getName(); int fieldValue = … Read more

Android: sound API (deterministic, low latency)

SoundPool is the lowest-latency interface on most devices, because the pool is stored in the audio process. All of the other audio paths require inter-process communication. OpenSL is the best choice if SoundPool doesn’t meet your needs. Why OpenSL? AudioTrack and OpenSL have similar latencies, with one important difference: AudioTrack buffer callbacks are serviced in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)