android-ndk

Android OpenGL using both Java and C++

Can you blend Java and native OpenGL calls. For instance having the setup happen in the onSurfaceCreated, but having the onDraw call into native code (or even both)? I'm having trouble getting native code to render, but can't tell if this could be a problem or if I'm throwing c++ exceptions, but they don't bubble up... private stati...

Is there a need to check for NULL after allocating memory, when kernel uses overcommit memory

It is general practice to check for NULL (whether memory is successfully allocated) after a malloc, some thing like void *ptr = malloc(10); if (ptr) { // do some thing usefull } else { // no memory. safely return/throw ... } with memory overcommit enabled in kernel, is there a chance of getting NULL. Should i follow the practice o...

gdb Input/Output error remote debugging to Android

I'm trying to debug an android app that call native code to do some GL rendering. The native code is existing code that I'm trying to port (and that I don't really know that well). I've got the existing code compiling, linking, and installing correctly, and I've got some native functions that call in to that code that are being correct...

Android: How to make game asset files readable from c++ code using ndk

I am creating a game using the irrlicht c++ 3D graphics engine port to android platform. The graphics engine is written in c++. I need to be able to load meshes and textures etc from c++ code. My current plan is to place all the game asset files in either the res/raw directory or the assets directory then on startup copy these files to t...

JNI Application State

How is state kept when accessing methods through JNI? In the example below my Java code is calling the native method drawFromJni, will my native class _nc be persisted between calls? If there were better native debugging tools for the NDK this would be pretty easy to find out, but I'm really having problems with the NDK and C++. exter...

How to find out the memory footprint of my Android App?

Well, the title says it. It would also be handy to know how many memory is still available. I am writing a memory hungry application that tends to crash randomly (in native Code), and my suspicion is that it gets out-of-memory. ...

Android play raw Audio from C++ side

I need to be able to stream audio from a custom file format on the C++ side of the Android system. I am working on porting a custom media player and need to be able to open a custom file and stream audio from it. This is important as I do not think porting the whole player to JAVA is feasible from a performance stand point and moving t...

Get function names from call stack

I am working on an Android program which calls in to native code. That native code is segfaulting, and since getting debugging working through the android NDK is not really doable, I'm left with a callstack like the following (captured from ddms). My question is whether there is something I can manually run after the fact to translate ...

Android NDK - does it support straight ARM code or just Thumb

All, I have been asked to evaluate the Android platform for our product and I am looking at various options, I am only just scratching the surface just now and the one thing that is bothering me is that I cannot see how to compile code as straight ARM code (no Thumb), I know that Thumb runs slower and we will need the performance in key...

Objective-C and Android

I've just finished a relatively large project for the Android, and it's left a bitter taste in my mouth with the knowledge that it will never run on one of the most ubiquitous handsets this side of the solar system (the one by that fruity little club). So, for my next project, I want to write it in a way that makes most of the component...

Android - NDK - GNU make problems

I'm new to the NDK. (using Windows) I have downloaded cygwin and the NDK. I have unzipped the NDK in C:\ When I run cygwin I change to the NDK directory and I run the command build/host-setup.sh But I get Error: could not find a valid GNU Make executable. I have downloaded GNU make 3.81 but still no luck, What do I have to do with ...

How do I know what android ndk version I'm running in

In the gui you can go to Settings->About Phone->Firmware Version and get 2.1 (or whatever). How do I do it from command line (or for a native application that needs to do it in run time ) ? ...

How do I upload my own library to Nexus one?

I'm porting my native C engine to android 2.1 using NDK r6, but I can't use the commands like: "adb root" or "adb remout" to my Nexus one. How should I do to upload my engine(.so file) to Nexus one? ...

how to use the opengl interface in android ndk

if i wanna use the opengl interface in android ndk, then will it be possible to show me a simple tutorial to let me master the android ndk? i just wanna know how to operate in android ndk first! thanks in advance! ...

MP3 Decoding on Android

Hi. We're implementing a program for Android phones that plays audio streamed from the internet. Here's approximately what we do: Download a custom encrypted format. Decrypt to get chunks of regular MP3 data. Decode MP3 data to raw PCM data in a memory buffer. Pipe the raw PCM data to an AudioTrack Our target devices so far are Dro...

Can anyone explain what features of the C runtime in Android (via NDK) are not supported?

More specifically, does NDK have a complete STL implementation. We're looking at this for devices running 1.6 and upwards. ...

Which Android phone to use for development...?

Hi, I'm planning to port a couple of games from iPhone/Windows Mobile to the Android platform. The games are written in C++ so I plan to use the NDK with a thin java wrapper. I'm new to the Android platform and need some advice on which phone to buy for development. I suspect like Windows Mobile there is a level of fragmentation with d...

Are there java bindings for OpenGL ES 2.0 on the Android platform?

I know that the recently released android ndk r3 supports opengl es 2.0 on supported phones (nexus one for example), however it doesn't say whether there are java bindings for opengl es 2.0 included in the SDK yet. Are said bindings on the way, and if not, does JOGL2 support the opengl es 2.0 profile on the android? ...

How do I handle calls to AudioTrack from jni without crashing?

I was trying to write to an AudioTrack from a jni callback, and I get a signal 7 (SIGBUS), fault addr 00000000. I have looked at the Wolf3D example for odroid and they seem to use a android.os.Handler to post a Runnable that will do an update in the correct thread context. I have also tried AttachCurrentThread, but I fail in this case a...

Fast way to perform addition of 2 LARGE float arrays in Android. Optional JNI or Opengl ES

I simply need to add floatArray1 to floatArray2 storing the result in floatArray2.. no third array.. all arrays are one dimensional but are very large... probibly as large as the os will let me get away with. Max i would need is two float arrays with 40,000 floats each... but i could get away with 1/10th that i suppose minimum. Would lo...