android-ndk

JNI sources in the APK

Hi all, I have an Android project with an NDK/JNI library in Eclipse Ganymede. Inexplicably, the bin folder contains a copy of all my C++ sources from the jni folder. So does the APK, if you rename it to ZIP and examine. If I delete those files from bin, then clean and rebuild, they're there again. What going on, please? I have no intent...

How to resolce the java.lang.UnsatisfiedLinkError in NDK in Android?

Hi, I am new in ndk development in android.I have gone through the file system of ndk android. Here, explaining what i have done. 1) i have created a folder named "jni" then create 2 file named Android.mk and ndkfoo.c. In Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) # Here we give our module name and source file(s) L...

JNI - How to create a library for different classes

Hi, I'm new to JNI, i'm developing a native library for an Android project. I read some papers about JNI programming but i didn't understand if it is possible to create a library that can be loaded in different project classes with different packages. I read that to declare a new JNI method the syntax is: the prefix "Java_" an encoded...

Audio Record using Android NDK

I try to record audio using android ndk. people say I can use "frameworks/base/media/libmedia/AudioRecord.cpp". but it is in kernel. how can I access and use it? ...

Java Queue, Arrays, and JNI

I think this is a general Java question, but it does involve some Android stuff. So here's the deal: I've got a JNI wrapped version of MPG123 for Android, and I can pull PCM data from an MP3 file on the SDCard. I'd like to pull a chunk this data, do an analysis on it using another class I wrote, then push it into a queue. Ideally, I'd...

compiling a driver

i require to convert a linux driver to android. can anyone help me with the kernel twiking ? is there a change to the driver makefile ? where to get the source files of the kernel ? can i use insmod/mknod in adb shell to load the driver dynamically ? any hint will be welcomed... noam ...

Identify Calling Application in Android NDK

I have a native android library (.so) I am bundling with some application. In the native code I want to verify the signer/package name of the calling application. The reason is, currently anyone can open up the .apk file take my .so file and use it to built their own applications. Is there a way to securely identify the calling applica...

How to catch UnsatisifiedLinkError when using NDK-built library in an Android app?

I have an Android project that contains a class that uses JNI to pull a value from a C function. The C function was built into a library using NDK. The value returned from the C function is in turn used to initialize a variable inside a class when its first loaded. This works fine. However, I also want it to work when the library is miss...

Floating point of fixed-point for Android NDK OpenGL apps?

I'm trying to decide on whether to primarily use floats or ints for all 3D-related elements in my app (which is C++ for the most part). I understand that most ARM-based devices have no hardware floating point support, so I figure that any heavy lifting with floats would be noticeably slower. However, I'm planning to prep all data for th...

Is the binary representation of native types guaranteed the same on all targets?

I"m planning to store my data in a binary format as a resource, read it into an int buffer and basically pass it straight down to a native C++ function, which might cast it to a struct/class and work with it. No pointers, obviously, just ints and floats. The question is - what kind of fixing up do I need to do? I suppose that I need to ...

getaddrinfo() failing in Android?

I'm building a C library we have using the Android NDK build chain. Things are working in general, but the following section is causing problems: #include <netdb.h> ... struct addrinfo* addr_result; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; ...

main.xml hiding the view help

Hello all, I am unable to display both the setContentView(R.layout.main) and View together. I think I am not getting the concept right. Could anyone explain me where I am going wrong. Thank you. //please read the comment in code I am trying to display a image on main.xml using BitmapFactory. public class TryGraph extends Activity ...

Internal compiler error when compiling native Android code.

Hello, Currently I am trying to compile native code for Android. The code is from the OpenCV port for Android. I pasted all the code correctly in my project and edited my make files accordingly. When I set android:debuggable to false everything works fine and I get my native library. When I try while android:debuggable is set to true I ...

Android: Write to /sys/ directory

I'm developing an application that is not intended to be released as a standard app. It'll be run on a single rooted device. I require the ability to write to a file in the /sys/ directory. The file in question is owned by root and has -rw-rw-rw- permissions. I am aware that there may be restrictions on the VM my code runs within that ...

static linking fftw3 into shared library

I'm working on some pitch correction software for Android, and I am looking to get fftw3 working on Android using the NDK. The pitch correction library (talentedhack, http://code.google.com/p/talentledhack/ incase anyone wants to know) depends on fftw3, so I am trying to compile fftw3 as a static library, then link it into the talented...

Debug Native Code on Motorola Droid

Hi all, I'm trying to debug an application build with the NDK on a Motorola Droid. I'm following the instructions here and I've had success in the past on an emulator (I have root access obviously) but when I try to start gdbserver :5039 --attach 1082 through the adb shell, I get a gdbserver:permission denied. Obviously as this is...

Installing & using the Android NDK in Eclipse

Hey, I've been running the Android SDK for a while now in Eclipse (MAC OSX). I've downloaded the NDK and installed the C/C++ tools in Eclipse, but could anyone guide me on using the NDK? For example, do I just create an Android project like normal and build it with the NDK instead? Really could do with a decent tutorial if anyone know ...

how to use textures in android ndk with opengl es 2.0?

I tried to the code from http://stackoverflow.com/questions/2878536/fastest-2d-frame-rate-possible-with-android-ndk-my-try-included-better-options/3476199#3476199 , but textures didn't show, just filled with black. who can show me a example of how to use textures in android ndk with opengl es 2.0? Thanks! my phone is Moto Milestone wi...

Can't call glGenTextures on multithreaded android app

I'm making an OpenGLES Android app using Android NDK, expanding from android's gljni example, which can be found here It's using GLSurfaceView. Textures are initialized in a JNI function called from onSurfaceChanged() of GLSurfaceView.Renderer When the user touches screen, the app needs more textures. In order to do so, glGenTextures(...

Linux claiming android (arm-eabi-gcc) is not present when it is clearly there

So I just trying to build a library using the NDK. I believe that the Android.mk and Application.mk files are correct, but whether they are or not is irrelevant. when executing make APP=hello within the NDK directory Android NDK: Building for application 'hello' make: ./build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc: Co...