Tag: android-ndk

Decoding Airplay Packets in Java or C/C++ on Android

I’m currently working on an AirPlay receiver for a subpart of an android application. I am using the following framework: https://github.com/pentateu/DroidAirPlay While this works great on some mid range devices such as the miPad, we need to get this running on a low spec custom device. The custom device is decoding the airplay packets at […]

java.io.IOException: com.android.jack.api.v01.CompilationException: Failed to compile

Below is the error I am getting while migrating yo Java 8 with API Level 24 Looks like it’s from lombok pre-processor. Any help appreciated Error:/MyApp.native.android/AndroidApp/src/main/java/com/cba/MyApp/android/view/fragment/ProfileDetails/tabs/Profile.java:21: The import lombok cannot be resolved FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:AndroidApp:compileMyAppDebugJavaWithJack’. > java.io.IOException: com.android.jack.api.v01.CompilationException: Failed to compile * Try: […]

How to build an shared library and call it in other ndk program

I want to build an shared library. To build it, I need to call another shared library. Here is what I did: 1.Create one Android project,named “BuildLib”,and add a new folder “jni” under the project directory. Contents of jni folder: jni–>Android.mk –>Application.mk –>add.cpp –>add.h add.cpp just do two numbers addition: add.h: int add(int a,int b); […]

How to build and use ffmpeg within android

I am prototyping a fairly simple camera app to test out using MediaRecorder to create a custom camera activity with one snag, I want to set the aspect ratio of recorded videos to a 1×1. Through much research I have found that this is only possible by using a library like FFMPEG to crop each […]

Debugging native code in Android on the *device* (not emulator)

I followed this description for debugging native code in an Android app and it works when debugging on the emulator. When I want to debug on the actual device, at the point where I switch to the C/C++ debug configuration, Eclipse reports “Remote communication error: Bad file descriptor.”. Apparently there’s a problem reaching GdbServer (I […]

NEON intrinsic types work in C but throw invalid arguments error in C++

I have problems with using NEON intrinsics and inline assembly in Android NDK. NEON types like float32x4_t give an “invalid arguments” error when compiling C++ code with GCC 4.6 and 4.8, however, the code compiles fine if compiled as C. For example, here’s some code: inline float32x4_t VectorAdd(float32x4_t a, float32x4_t b) { return vaddq_f32(a, b); […]

How to use android native libraries in Java using eclipse?

Can any body provide me a steps, How to use native libraries in eclipse. Your help highly appreciated. I don’t want to create any native libraries. I just want to use predefined libraries.

Android: why is native code so much faster than Java code

In the following SO question: https://stackoverflow.com/questions/2067955/fast-bitmap-blur-for-android-sdk @zeh claims a port of a java blur algorithm to C runs 40 times faster. Given that the bulk of the code includes only calculations, and all allocations are only done “one time” before the actual algorithm number crunching – can anyone explain why this code runs 40 times […]

lib/gdbserver Error:Permission denied

I’m trying to debug my android application in Eclipse/ADT by selecting: Debug As->Android Native Application However, after building I get: gdbserver output: run-as: exec failed for lib/gdbserver Error:Permission denied Verify if the application was built with NDK_DEBUG=1 I am indeed building with NDK_DEBUG=1 Any ideas on how to fix this, or at least why this […]

Android camera native access : startPreview() vs startRecording()

Trying to get camera working from native code in Android ICS: most manuals refer to startPreview() method . But browsing AOSP code I’ve found also ‘startRecording()‘ method in <Camera.h>. Here said that it is from interface ICameraRecordingProxy “that allows the recorder to receive video frames during recording“ So the question is – in terms of […]

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